/* ============================================
   TOOLKIT LOFT - COMPLETE CSS
   ============================================ */

:root {
    --ink: #14162b;
    --slate: #5b5f78;
    --bg: #f7f8fc;
    --navy: #161a3d;
    --primary: #3538cd;
    --primary-deep: #2426a3;
    --amber: #c17d1f;
    --line: #e3e4f0;
    --card: #ffffff;
    --good: #1a8a5f;
    --good-bg: #e8f7f0;
    --mid: #c17d1f;
    --mid-bg: #fbf1e2;
    --weak: #c23a3a;
    --weak-bg: #fbeaea;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

h1, h2, h3, .logo {
    font-family: 'Space Grotesk', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */

header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(247, 248, 252, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.nav {
    max-width: 1160px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
}

.logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--navy));
    flex-shrink: 0;
    position: relative;
}

.logo-mark::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 3px;
    background: var(--amber);
}

.nav-links {
    display: none;
    gap: 30px;
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--slate);
}

.nav-links a:hover {
    color: var(--primary);
}

@media (min-width: 820px) {
    .nav-links {
        display: flex;
    }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-cta {
    background: var(--navy);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    display: none;
}

@media (min-width: 820px) {
    .nav-cta {
        display: inline-block;
    }
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--card);
    cursor: pointer;
    align-items: center;
}

@media (min-width: 820px) {
    .hamburger {
        display: none;
    }
}

.hamburger span {
    width: 18px;
    height: 2px;
    background: var(--navy);
    border-radius: 2px;
    transition: .2s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    max-height: 0;
    overflow: hidden;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    transition: max-height .25s ease;
}

.mobile-menu.open {
    max-height: 400px;
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 14px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 0.98rem;
    font-weight: 500;
}

.mobile-menu a:hover {
    color: var(--primary);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    max-width: 1160px;
    margin: 0 auto;
    padding: 70px 24px 44px;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: #eceefb;
    padding: 7px 16px;
    border-radius: 999px;
    margin-bottom: 22px;
    border: 1px solid #dadcf7;
}

.hero h1 {
    font-size: clamp(1.9rem, 4.6vw, 3rem);
    margin: 0 0 16px;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.01em;
}

.hero p {
    color: var(--slate);
    font-size: 1.05rem;
    max-width: 620px;
    margin: 0 auto 36px;
}

.search-wrap {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}

.search-wrap input {
    width: 100%;
    padding: 16px 22px 16px 48px;
    border-radius: 12px;
    border: 1px solid var(--line);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background: var(--card);
    box-shadow: 0 10px 30px -12px rgba(20, 22, 61, 0.18);
    outline: none;
}

.search-wrap input:focus {
    border-color: var(--primary);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 19px;
    height: 19px;
    color: var(--slate);
}

.result-count {
    font-size: 0.85rem;
    color: var(--slate);
    margin-top: 12px;
    min-height: 1.2em;
}

.stat-strip {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px 8px;
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat b {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    color: var(--navy);
}

.stat span {
    font-size: 0.82rem;
    color: var(--slate);
}

/* ============================================
   AD SLOTS
   ============================================ */

.ad-slot {
    max-width: 1160px;
    margin: 36px auto;
    padding: 0 24px;
}

.ad-slot .placeholder {
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    color: var(--slate);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    padding: 12px;
}

/* ============================================
   TOOLS GRID / CATEGORIES
   ============================================ */

main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 12px 24px 20px;
}

.category {
    margin-top: 52px;
}

.category-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 6px;
}

.category h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--navy);
}

.category-head::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
}

.cat-desc {
    color: var(--slate);
    font-size: 0.9rem;
    margin: 0 0 20px 22px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px -16px rgba(20, 22, 61, 0.28);
    border-color: var(--primary);
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #eceefb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.card h3 {
    font-size: 1.02rem;
    margin: 0;
    font-weight: 600;
    color: var(--navy);
}

.card p {
    margin: 0;
    color: var(--slate);
    font-size: 0.88rem;
    flex-grow: 1;
}

.card .use {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.card:hover .use {
    color: var(--amber);
}

.badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--amber);
    background: #fbf1e2;
    padding: 2px 8px;
    border-radius: 999px;
    align-self: flex-start;
}

#noResults {
    display: none;
    text-align: center;
    color: var(--slate);
    margin-top: 44px;
}

/* ============================================
   SINGLE TOOL PAGE - FIXED LAYOUT
   ============================================ */

.breadcrumb {
    max-width: 1160px;
    margin: 0 auto;
    padding: 18px 24px 0;
    font-size: 0.85rem;
    color: var(--slate);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    color: #b7bad0;
}

/* ===== PAGE CONTAINER - FIXED ===== */
.page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 20px 24px 0;
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 32px;
    align-items: start;
}

/* ===== MAIN CONTENT - FULL WIDTH ON DESKTOP ===== */
.page > div:first-child {
    min-width: 0;
    width: 100%;
}

/* ===== SIDEBAR - STICKY ===== */
.page aside {
    position: sticky;
    top: 88px;
}

/* ===== TOOL HEADER ===== */
.tool-header {
    margin-bottom: 6px;
    width: 100%;
}

.tool-header h1 {
    font-size: clamp(1.5rem, 5vw, 2.3rem);
    margin: 0 0 10px;
    color: var(--navy);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
    word-break: break-word;
}

.tool-header p {
    color: var(--slate);
    font-size: 1.02rem;
    max-width: 600px;
    margin: 0;
}

.tool-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    background: #eceefb;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
    border: 1px solid #dadcf7;
}

/* ===== TOOL CARD ===== */
.tool-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 32px;
    margin-top: 26px;
    box-shadow: 0 16px 40px -22px rgba(20, 22, 61, 0.25);
    width: 100%;
    overflow: hidden;
}

.tool-content {
    width: 100%;
    overflow: hidden;
}

/* ===== TOOL DESCRIPTION ===== */
.tool-description-section {
    margin-top: 30px;
    padding: 24px 30px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--line);
    width: 100%;
}

.tool-description {
    color: #5b5f78;
    font-size: clamp(0.92rem, 1vw, 0.98rem);
    line-height: 1.8;
}

.tool-description h1,
.tool-description h2,
.tool-description h3 {
    color: #161a3d;
    font-family: 'Space Grotesk', sans-serif;
    margin: 16px 0 8px;
}

.tool-description h1 {
    font-size: 1.6rem;
}
.tool-description h2 {
    font-size: 1.3rem;
}
.tool-description h3 {
    font-size: 1.1rem;
}

.tool-description p {
    margin: 8px 0;
    color: #5b5f78;
}

.tool-description ul,
.tool-description ol {
    margin: 8px 0;
    padding-left: 24px;
    color: #5b5f78;
}

.tool-description ul li,
.tool-description ol li {
    margin-bottom: 4px;
}

.tool-description strong,
.tool-description b {
    color: #14162b;
}

.tool-description a {
    color: #3538cd;
    text-decoration: underline;
}

.tool-description a:hover {
    color: #2426a3;
}

.tool-description blockquote {
    border-left: 4px solid #3538cd;
    margin: 12px 0;
    padding: 8px 16px;
    background: #f7f8fc;
    border-radius: 0 8px 8px 0;
    color: #14162b;
}

.tool-description code {
    background: #eceefb;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #3538cd;
}

.tool-description pre {
    background: #14162b;
    color: #ffffff;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.tool-description pre code {
    background: transparent;
    color: #ffffff;
    padding: 0;
}

.tool-description img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.tool-description table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.tool-description table th,
.tool-description table td {
    border: 1px solid #e3e4f0;
    padding: 8px 12px;
    text-align: left;
}

.tool-description table th {
    background: #f7f8fc;
    font-weight: 600;
    color: #14162b;
}

/* ===== INFO BLOCK ===== */
.info-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 30px;
    margin-top: 32px;
    width: 100%;
}

.info-block h2 {
    font-size: 1.2rem;
    color: var(--navy);
    margin: 0 0 14px;
}

.info-block p {
    color: var(--slate);
    font-size: 0.94rem;
    margin: 0 0 14px;
}

.info-block ol,
.info-block ul {
    color: var(--slate);
    font-size: 0.94rem;
    padding-left: 20px;
    margin: 0 0 14px;
}

.info-block li {
    margin-bottom: 6px;
}

/* ===== FAQ SECTION ===== */
.faq-section {
    margin-top: 30px;
    padding: 24px 30px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e3e4f0;
    width: 100%;
}

.faq-section h3 {
    color: #161a3d;
    font-size: 1.1rem;
    margin: 0 0 16px 0;
    font-family: 'Space Grotesk', sans-serif;
}

.faq-item {
    border-bottom: 1px solid #e3e4f0;
    padding: 14px 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    color: #14162b;
    font-size: 0.98rem;
    margin: 0 0 6px 0;
    font-weight: 600;
    cursor: pointer;
}

.faq-question:hover {
    color: #3538cd;
}

.faq-answer {
    color: #5b5f78;
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
}

.sidebar-block h3 {
    font-size: 0.95rem;
    color: var(--navy);
    margin: 0 0 16px;
}

.related {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    transition: background .15s;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink);
}

.related a:hover {
    background: var(--bg);
}

.related .ic {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #eceefb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.trust-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.87rem;
    color: var(--slate);
}

.trust-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.trust-list .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--good);
    margin-top: 7px;
    flex-shrink: 0;
}

/* ============================================
   MAIN FAQ SECTION (HOMEPAGE)
   ============================================ */

.faq {
    max-width: 840px;
    margin: 70px auto 0;
    padding: 0 24px;
}

.faq h2 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--navy);
    margin-bottom: 28px;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    border-top: 1px solid var(--line);
    background: var(--card);
    margin-top: 56px;
}

.foot-grid {
    max-width: 1160px;
    margin: 0 auto;
    padding: 52px 24px 26px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}

@media (max-width: 760px) {
    .foot-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .foot-grid {
        grid-template-columns: 1fr;
    }
}

.foot-grid h4 {
    font-size: 0.85rem;
    color: var(--slate);
    margin: 0 0 16px;
    font-weight: 600;
}

.foot-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
    font-size: 0.92rem;
}

.foot-grid ul a:hover {
    color: var(--primary);
}

.foot-about p {
    color: var(--slate);
    font-size: 0.9rem;
    max-width: 340px;
}

.foot-bottom {
    text-align: center;
    font-size: 0.82rem;
    color: var(--slate);
    padding: 20px 24px;
    border-top: 1px solid var(--line);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablets and smaller laptops */
@media (max-width: 992px) {
    .page {
        grid-template-columns: 1.5fr 1fr;
        gap: 24px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    .nav {
        padding: 12px 16px;
    }

    .hero {
        padding: 40px 16px 30px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .stat-strip {
        gap: 24px;
    }

    main {
        padding: 8px 16px 16px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 14px;
    }

    .page {
        grid-template-columns: 1fr;
        padding: 16px 16px 0;
        gap: 24px;
    }

    .page aside {
        position: static;
        margin-top: 20px;
        display: block;
        width: 100%;
    }

    .tool-card {
        padding: 20px;
        border-radius: 14px;
    }

    .tool-description-section {
        padding: 16px 18px;
        margin-top: 20px;
    }

    .info-block {
        padding: 20px;
        border-radius: 14px;
        margin-top: 24px;
    }

    .faq-section {
        padding: 16px 18px;
    }

    .ad-slot {
        margin: 24px auto;
        padding: 0 16px;
    }

    .ad-slot .placeholder {
        min-height: 70px;
    }

    .sidebar-block {
        padding: 16px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .nav {
        padding: 10px 12px;
    }

    .logo {
        font-size: 1rem;
    }

    .logo-mark {
        width: 28px;
        height: 28px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card {
        padding: 18px;
    }

    .tool-card {
        padding: 16px;
    }

    .tool-header h1 {
        font-size: 1.3rem;
    }

    .tool-header p {
        font-size: 0.92rem;
    }

    .info-block {
        padding: 16px;
    }

    .faq-section {
        padding: 14px 16px;
    }

    .faq-question {
        font-size: 0.9rem;
    }

    .faq-answer {
        font-size: 0.85rem;
    }

    .sidebar-block {
        padding: 14px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .hero {
        padding: 30px 12px 20px;
    }

    .hero h1 {
        font-size: 1.3rem;
    }

    .search-wrap input {
        padding: 12px 16px 12px 40px;
        font-size: 0.85rem;
    }

    .search-icon {
        left: 14px;
        width: 16px;
        height: 16px;
    }

    .tool-card {
        padding: 12px;
        border-radius: 12px;
    }

    .tool-description-section {
        padding: 12px 14px;
    }

    .info-block {
        padding: 14px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #e8f7f0;
    color: #1a8a5f;
    border: 1px solid #b5e6d0;
}

.alert-danger {
    background: #fbeaea;
    color: #c23a3a;
    border: 1px solid #f5d0d0;
}

.alert-warning {
    background: #fbf1e2;
    color: #c17d1f;
    border: 1px solid #f5e5c8;
}

.alert-info {
    background: #eceefb;
    color: #3538cd;
    border: 1px solid #d5d8f5;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--navy);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    background: var(--card);
    transition: border-color .15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.generate-btn {
    display: inline-block;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    box-shadow: 0 12px 26px -12px rgba(53, 56, 205, 0.55);
    transition: opacity .15s, transform .1s;
    text-align: center;
}

.generate-btn:hover {
    opacity: 0.94;
}

.generate-btn:active {
    transform: scale(0.99);
}


/* Make card title clickable */
.card-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-title-link:hover h3 {
    color: var(--primary);
}

.card-title-link h3 {
    transition: color 0.2s ease;
    margin: 0;
}