/* =============================================================================
   NorthStar Paralegal — Blog & Newsletter Playbook
   Shared stylesheet for the guide site. Brand palette + fonts mirror the main
   site (src/styles/global.css): navy #0c4067, gold #c8a45e, warm cream.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   INDEX  —  search the ALL-CAPS banners below to jump to a section.

   TOKENS, RESET & BASE ........ :root tokens (color · spacing scale · type
                                 scale · semantic theme tokens) · reset · body
   LAYOUT, HEADER & HERO ....... site header/nav · container/card · home hero
   TYPOGRAPHY .................. headings · body · links · lists · h2.section
   CONTENT COMPONENTS .......... toc · callouts · steps · checklist · grids &
                                 minicards · guide-cards · calendar · pills ·
                                 shot · linklist
   PAGE CHROME ................. footer · backlink · wordmark · cover ·
                                 page-banner · dev-cta + .btn-gold · credit
   CORE RESPONSIVE & PRINT ..... base @media (max-width:700) and @media print
   BLOG / ARTICLE COMPONENTS ... article-banner · article-meta/byline · lead +
                                 drop-cap · pullquote · figure · stat-grid ·
                                 beforeafter · table-scroll/compare · faq ·
                                 reader-cta + .btn-primary · article-tags ·
                                 related · post-card/posts-grid (+resp/print)
   DARK MODE ................... [data-theme="dark"] token overrides + re-skins
   NEW COMPONENTS .............. takeaways · post-toc · gallery · buttons (.btn)
   PROGRESSIVE-ENHANCEMENT CONTROLS  theme-toggle · reading-progress ·
                                 back-to-top · reveal  (paired w/ scripts/ui.js)
   UTILITY CLASSES ............. sr-only · stack · measure · text-center · mt/mb
   FOCUS + MOTION POLISH ....... :focus-visible · prefers-reduced-motion ·
                                 new-component responsive + print

   Everything is driven by the CSS custom properties in :root. To move this into
   the main Astro site, see PORTING-TO-NSP-WEB.md (token-name reconciliation +
   which pieces become global CSS, post-layout chrome, or Sanity blocks).
   ----------------------------------------------------------------------------- */

/* =============================================================================
   TOKENS, RESET & BASE
   ============================================================================= */
:root {
    --primary: #0c4067;
    --primary-dark: #082d49;
    --primary-light: #1a5a8a;
    --accent: #c8a45e;
    --accent-hover: #b8943e;
    --cream: #f4f1ec;
    --bg: #f9f7f4;
    --white: #ffffff;
    --text-dark: #1a2332;
    --text-body: #3a4553;
    --text-light: #6b7a8d;
    --border: #e2ddd5;
    --danger: #c0563f;

    --font-heading: "Playfair Display", Georgia, serif;
    --font-body:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --shadow-sm:
        0 1px 3px rgba(12, 64, 103, 0.06), 0 1px 2px rgba(12, 64, 103, 0.04);
    --shadow-md: 0 4px 16px rgba(12, 64, 103, 0.08);
    --shadow-lg: 0 12px 40px rgba(12, 64, 103, 0.12);
    --radius: 14px;

    /* ---- Spacing scale (4px base) ---- */
    --space-2xs: 4px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* ---- Type scale (aligned to existing sizes) ---- */
    --text-xs: 0.72rem;
    --text-sm: 0.86rem;
    --text-base: 1rem;
    --text-md: 1.05rem;
    --text-lg: 1.18rem;
    --text-xl: 1.6rem;
    --text-2xl: clamp(1.9rem, 4vw, 2.6rem);
    --text-3xl: clamp(2.1rem, 5vw, 3.1rem);

    /* ---- Semantic tokens (split out so dark mode can reskin them) ----
       These map to the brand tokens above in light mode, and are overridden
       under [data-theme="dark"]. --ink-accent = navy-as-text (headings/links
       that need to lighten in dark); --surface-warm = the cream fill used by
       toc/stat/pill/reader-cta; --divider = the subtle cream rules. */
    --ink-accent: var(--primary);
    --surface-warm: var(--cream);
    --divider: var(--cream);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-body);
    background: var(--bg);
    line-height: 1.7;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

/* =============================================================================
   LAYOUT, HEADER & HERO
   ============================================================================= */
/* ---------- Site header / nav ---------- */
.site-header {
    background: var(--primary);
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    color: var(--cream);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}
.site-header.is-hidden {
    transform: translateY(-100%);
}
.site-header__inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    min-height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--cream);
}
.brand__star {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
}
.brand__name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.2px;
    color: #fff;
}
.brand__name span {
    color: var(--accent);
}
.site-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-self: center;
}
.site-nav a {
    color: rgba(240, 237, 232, 0.82);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 8px;
    transition:
        background 0.15s,
        color 0.15s;
}
.site-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.site-nav a.active {
    color: var(--primary-dark);
    background: var(--accent);
}

/* ---------- Layout ---------- */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 44px 48px;
}

/* ---------- Hero (home) ---------- */
.hero {
    text-align: center;
    padding: 72px 24px 48px;
    max-width: 760px;
    margin: 0 auto;
}
.hero__logo {
    display: inline-block;
    margin-bottom: 22px;
    padding: 10px 18px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
.hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--accent-hover);
    margin-bottom: 18px;
}
.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.1rem, 5vw, 3.1rem);
    line-height: 1.15;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 18px;
}
.hero p {
    font-size: 1.12rem;
    color: var(--text-body);
}
.hero__rule {
    width: 60px;
    height: 3px;
    background: var(--accent);
    border: none;
    border-radius: 2px;
    margin: 28px auto 0;
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    font-weight: 600;
}

.page-title {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    line-height: 1.18;
    margin-bottom: 10px;
}
.page-lead {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 8px;
}
.page-head {
    margin-bottom: 36px;
}
.page-head .eyebrow {
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-hover);
    margin-bottom: 14px;
}

h2.section {
    font-size: 1.6rem;
    color: var(--ink-accent);
    margin: 46px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--divider);
}
h3 {
    font-size: 1.18rem;
    color: var(--text-dark);
    margin: 28px 0 10px;
}

p {
    margin-bottom: 16px;
}
a {
    color: var(--primary-light);
}
strong {
    color: var(--text-dark);
    font-weight: 600;
}

ul,
ol {
    margin: 0 0 18px 22px;
}
li {
    margin-bottom: 8px;
}

/* =============================================================================
   CONTENT COMPONENTS
   ============================================================================= */
/* ---------- Table of contents ---------- */
.toc {
    background: var(--surface-warm);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 36px;
}
.toc h4 {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.74rem;
    font-family: var(--font-body);
    color: var(--text-light);
    margin-bottom: 12px;
}
.toc ol {
    margin: 0 0 0 18px;
    columns: 2;
    column-gap: 32px;
}
.toc li {
    margin-bottom: 7px;
}
.toc a {
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.94rem;
}
.toc a:hover {
    color: var(--ink-accent);
}

/* ---------- Callouts ---------- */
.callout {
    border-radius: 10px;
    padding: 18px 22px;
    margin: 22px 0;
    font-size: 0.97rem;
    border-left: 4px solid;
}
.callout__label {
    display: block;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.callout p:last-child {
    margin-bottom: 0;
}
.callout.tip {
    background: #fbf7ee;
    border-color: var(--accent);
}
.callout.tip .callout__label {
    color: var(--accent-hover);
}
.callout.note {
    background: #eef4f8;
    border-color: var(--primary-light);
}
.callout.note .callout__label {
    color: var(--ink-accent);
}
.callout.important {
    background: #fbefec;
    border-color: var(--danger);
}
.callout.important .callout__label {
    color: var(--danger);
}

/* ---------- Numbered steps ---------- */
.steps {
    list-style: none;
    margin: 24px 0;
    counter-reset: step;
}
.steps > li {
    position: relative;
    padding: 4px 0 22px 56px;
    counter-increment: step;
    border-left: 2px solid var(--divider);
    margin-left: 18px;
}
.steps > li:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}
.steps > li::before {
    content: counter(step);
    position: absolute;
    left: -19px;
    top: -2px;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}
.steps > li h3 {
    margin-top: 0;
}

/* ---------- Checklist ---------- */
.checklist {
    list-style: none;
    margin: 18px 0;
}
.checklist li {
    position: relative;
    padding-left: 34px;
    margin-bottom: 12px;
}
.checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent);
    border-radius: 5px;
    background: #fff;
}
.checklist li::after {
    content: "✓";
    position: absolute;
    left: 4px;
    top: 1px;
    color: var(--accent-hover);
    font-weight: 700;
    font-size: 0.9rem;
}

/* ---------- Cards / grids ---------- */
.grid {
    display: grid;
    gap: 18px;
    margin: 24px 0;
}
.grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}
.grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.minicard {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
}
.minicard h3 {
    margin-top: 0;
    font-size: 1.05rem;
    color: var(--ink-accent);
}
.minicard p {
    font-size: 0.92rem;
    margin-bottom: 0;
    color: var(--text-body);
}

/* Guide index cards (home) */
.guide-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 28px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.15s,
        box-shadow 0.15s,
        border-color 0.15s;
}
.guide-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.guide-card__num {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    background: var(--primary);
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.guide-card__body h3 {
    margin: 2px 0 6px;
    color: var(--text-dark);
}
.guide-card__body p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.96rem;
}

/* ---------- Calendar table ---------- */
.calendar {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.93rem;
}
.calendar th,
.calendar td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.calendar thead th {
    background: var(--primary);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.calendar tbody tr:nth-child(even) {
    background: var(--bg);
}
.calendar td.mo {
    font-weight: 700;
    color: var(--accent-hover);
    white-space: nowrap;
    font-family: var(--font-heading);
}
.calendar td.ttl {
    color: var(--text-dark);
    font-weight: 600;
}
.calendar td.ang {
    color: var(--text-light);
}

/* ---------- Pills ---------- */
.pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-warm);
    color: var(--accent-hover);
    margin: 0 4px 4px 0;
}

/* ---------- Screenshot placeholder ---------- */
.shot {
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(
        45deg,
        #f3efe8,
        #f3efe8 12px,
        #efe9e0 12px,
        #efe9e0 24px
    );
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 0.82rem;
    letter-spacing: 0.4px;
    padding: 34px 20px;
    margin: 20px 0;
    text-align: center;
}

/* ---------- Links list (where things live) ---------- */
.linklist {
    list-style: none;
    margin: 18px 0;
}
.linklist li {
    display: flex;
    flex-direction: column;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
}
.linklist .lbl {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}
.linklist a {
    font-size: 0.96rem;
    word-break: break-all;
}

/* =============================================================================
   PAGE CHROME  (footer, banners, CTA)
   ============================================================================= */
/* ---------- Footer ---------- */
.site-footer {
    text-align: center;
    padding: 32px 24px 48px;
    color: var(--text-light);
    font-size: 0.86rem;
}
.site-footer .star {
    color: var(--accent);
}
.site-footer a {
    color: var(--primary-light);
    text-decoration: none;
}

/* ---------- Hover-underline (reusable) ----------
   The animated grow-from-center underline (formerly the navbar's gold
   nav-link ::after) kept on file in just two spots as a reference: the footer
   email link (thin blue line) and the TOC links (accent gold). Set
   --underline-color per consumer; reduced-motion handled in the FOCUS +
   MOTION POLISH section. */
.site-footer a[href^="mailto:"],
.toc a,
.post-toc a {
    position: relative;
}
.site-footer a[href^="mailto:"]::after,
.toc a::after,
.post-toc a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: var(--underline-color, var(--accent));
    transform: translateX(-50%) scaleX(0);
    transition: transform 0.25s ease;
}
.site-footer a[href^="mailto:"]:hover::after,
.toc a:hover::after,
.post-toc a:hover::after {
    transform: translateX(-50%) scaleX(1);
}
.site-footer a[href^="mailto:"] {
    --underline-color: var(--primary-light);
}

/* ---------- Back-to-packet link ---------- */
.backlink {
    display: inline-block;
    margin-bottom: 24px;
    font-size: 0.88rem;
    color: var(--text-light);
    text-decoration: none;
}
.backlink:hover {
    color: var(--ink-accent);
}

/* ---------- Wordmark (logo lockup) ---------- */
.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.7rem;
    color: #fff;
    letter-spacing: 0.3px;
}
.wordmark .star {
    color: var(--accent);
    font-size: 1.5rem;
}
.wordmark .light {
    color: var(--accent);
}

/* ---------- Image cover (home hero) ---------- */
.cover {
    position: relative;
    overflow: hidden;
    text-align: center;
    color: #fff;
    padding: 92px 24px 80px;
    /*margin-bottom: 60px;*/
    background-size: cover;
    background-position: center;
}
.cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(12, 64, 103, 0.88),
        rgba(8, 45, 73, 0.93)
    );
}
.cover > * {
    position: relative;
    z-index: 1;
}
.cover .wordmark {
    margin-bottom: 26px;
}
.cover .hero__eyebrow {
    color: var(--accent);
}
.cover h1 {
    color: #fff;
}
.cover p {
    color: rgba(240, 237, 232, 0.92);
}

/* ---------- Page banner (guide headers) ---------- */
.page-banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 30px;
    min-height: 210px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-md);
}
.page-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(8, 45, 73, 0.25) 0%,
        rgba(8, 45, 73, 0.9) 100%
    );
}
.page-banner__inner {
    position: relative;
    z-index: 1;
    padding: 28px 34px;
}
.page-banner .eyebrow {
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
}
.page-banner h1 {
    color: #fff;
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    line-height: 1.15;
    margin-bottom: 6px;
}
.page-banner p {
    color: rgba(240, 237, 232, 0.92);
    margin: 0;
    font-size: 1.02rem;
}

/* ---------- Developer call-to-action (upsell) ---------- */
.dev-cta {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--cream);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 32px 0;
    box-shadow: var(--shadow-md);
}
.dev-cta__icon {
    flex: 0 0 auto;
    font-size: 1.7rem;
    line-height: 1;
}
.dev-cta__body {
    flex: 1 1 auto;
}
.dev-cta__body h3 {
    color: #fff;
    margin: 0 0 5px;
    font-size: 1.12rem;
}
.dev-cta__body p {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(240, 237, 232, 0.9);
}
.dev-cta__body a:not(.btn-gold) {
    color: var(--accent);
    font-weight: 500;
}
.dev-cta__body strong {
    color: yellow;
}
.btn-gold {
    flex: 0 0 auto;
    display: inline-block;
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 11px 18px;
    border-radius: 9px;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background 0.15s,
        transform 0.15s;
}
.btn-gold:hover {
    background: #d9b876;
    transform: translateY(-1px);
}

/* ---------- Image credit ---------- */
.credit {
    font-size: 0.76rem;
    color: var(--text-light);
}
.credit a {
    color: var(--text-light);
}

/* =============================================================================
   CORE RESPONSIVE & PRINT
   ============================================================================= */
/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    body {
        font-size: 16px;
    }
    .card {
        padding: 28px 22px;
    }
    .toc ol {
        columns: 1;
    }
    .grid.cols-2,
    .grid.cols-3 {
        grid-template-columns: 1fr;
    }
    .site-header__inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .site-nav {
        width: 100%;
        justify-content: flex-start;
    }
    .dev-cta {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .dev-cta .btn-gold {
        align-self: stretch;
        text-align: center;
    }
}

/* ---------- Print ---------- */
@media print {
    body {
        background: #fff;
        font-size: 11.5pt;
    }
    .site-header,
    .site-nav,
    .backlink {
        display: none !important;
    }
    .container {
        padding: 0;
        max-width: 100%;
    }
    .card {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    .guide-card,
    .minicard,
    .callout,
    .calendar tbody tr,
    .dev-cta,
    .page-banner {
        break-inside: avoid;
    }
    a {
        color: var(--text-dark);
        text-decoration: none;
    }
    .hero {
        padding-top: 12px;
    }
    /* Background images don't print reliably — fall back to solid navy so the
     white text stays readable, and force color output. */
    .cover,
    .page-banner,
    .dev-cta {
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .cover::before,
    .page-banner::before {
        display: none;
    }
    .page-banner {
        min-height: 0;
    }
}

/* =============================================================================
   BLOG / ARTICLE COMPONENTS
   Additive, on-brand styles for the sample-posts section (blog.html + posts).
   Nothing above this line is modified.
   ============================================================================= */

/* ---------- Article hero (taller page-banner for posts) ---------- */
.article-banner {
    min-height: 320px;
}
.article-banner .page-banner__inner {
    padding: 34px 40px;
    max-width: 760px;
}
.article-banner h1 {
    font-size: clamp(2rem, 4.4vw, 2.9rem);
    margin-bottom: 10px;
}

/* ---------- Byline / article meta ---------- */
.article-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.byline-avatar {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}
.byline-text {
    line-height: 1.4;
}
.byline-text .byline-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.98rem;
}
.byline-text .byline-detail {
    font-size: 0.84rem;
    color: var(--text-light);
}

/* ---------- Lead paragraph + drop cap ---------- */
.lead {
    font-size: 1.18rem;
    line-height: 1.7;
    color: var(--text-body);
    margin-bottom: 22px;
}
.lead--dropcap::first-letter {
    float: left;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent-hover);
    font-size: 3.4rem;
    line-height: 0.82;
    padding: 8px 12px 0 0;
}

/* ---------- Pull quote ---------- */
.pullquote {
    margin: 34px 0;
    padding: 6px 0 6px 28px;
    border-left: 4px solid var(--accent);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--ink-accent);
    font-style: italic;
}
.pullquote cite {
    display: block;
    margin-top: 12px;
    font-family: var(--font-body);
    font-style: normal;
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--text-light);
}

/* ---------- Inline figure + caption ---------- */
.figure {
    margin: 32px 0;
}
.figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.figure figcaption {
    margin-top: 10px;
    font-size: 0.84rem;
    color: var(--text-light);
    text-align: center;
}
.figure figcaption a {
    color: var(--text-light);
}

/* ---------- Stat row ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 30px 0;
}
.stat {
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 18px;
    text-align: center;
}
.stat .stat-num {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--ink-accent);
}
.stat .stat-label {
    display: block;
    margin-top: 8px;
    font-size: 0.84rem;
    color: var(--text-light);
}

/* ---------- Before / After block ---------- */
.beforeafter {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 14px;
    margin: 30px 0;
}
.ba-panel {
    border-radius: 14px;
    padding: 26px 20px;
    text-align: center;
    border: 1px solid var(--border);
}
.ba-panel.before {
    background: var(--bg);
}
.ba-panel.after {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary-dark);
}
.ba-panel .ba-num {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.6rem;
    line-height: 1;
}
.ba-panel.before .ba-num {
    color: var(--text-light);
}
.ba-panel.after .ba-num {
    color: var(--accent);
}
.ba-panel .ba-label {
    display: block;
    margin-top: 8px;
    font-size: 0.86rem;
}
.ba-panel.before .ba-label {
    color: var(--text-light);
}
.ba-panel.after .ba-label {
    color: rgba(240, 237, 232, 0.92);
}
.ba-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.8rem;
    font-weight: 700;
}

/* ---------- Comparison table ---------- */
.table-scroll {
    margin: 26px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-scroll .compare {
    margin: 0;
    min-width: 460px;
}
.compare {
    width: 100%;
    border-collapse: collapse;
    margin: 26px 0;
    font-size: 0.94rem;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
.compare th,
.compare td {
    text-align: left;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.compare thead th {
    background: var(--primary);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.compare thead th.col-highlight {
    background: var(--accent-hover);
    color: var(--primary-dark);
}
.compare tbody td:first-child {
    font-weight: 600;
    color: var(--text-dark);
}
.compare td.col-highlight {
    background: #fbf7ee;
}
.compare tbody tr:last-child td {
    border-bottom: none;
}

/* ---------- FAQ accordion (native details) ---------- */
.faq {
    margin: 24px 0;
}
.faq details {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    margin-bottom: 12px;
    overflow: hidden;
}
.faq details[open] {
    box-shadow: var(--shadow-sm);
}
.faq summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 20px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.04rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    transition: background 0.15s;
}
.faq summary:hover {
    background: var(--surface-warm);
}
.faq summary::-webkit-details-marker {
    display: none;
}
.faq summary::after {
    content: "+";
    color: var(--accent-hover);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    flex: 0 0 auto;
}
.faq details[open] summary::after {
    content: "\2212"; /* minus */
}
.faq .faq-body {
    padding: 0 20px 18px;
}
.faq .faq-body p:last-child {
    margin-bottom: 0;
}

/* ---------- Reader CTA (gentle, reader-facing) ---------- */
.reader-cta {
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 28px 30px;
    margin: 38px 0 8px;
}
.reader-cta h3 {
    margin: 0 0 8px;
    color: var(--ink-accent);
    font-size: 1.25rem;
}
.reader-cta p {
    margin-bottom: 18px;
    color: var(--text-body);
}
.reader-cta p:last-child {
    margin-bottom: 0;
}
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 12px 22px;
    border-radius: 9px;
    text-decoration: none;
    transition:
        transform 0.15s,
        box-shadow 0.15s;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ---------- Article tags ---------- */
.article-tags {
    margin: 34px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.article-tags .tags-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.72rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

/* ---------- Related posts strip ---------- */
.related {
    margin-top: 30px;
}
.related h2.section {
    margin-top: 0;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.related-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.15s,
        box-shadow 0.15s,
        border-color 0.15s;
}
.related-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.related-card .rc-cat {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-hover);
}
.related-card h3 {
    margin: 6px 0 0;
    font-size: 1.08rem;
    color: var(--text-dark);
}

/* ---------- Blog index post cards ---------- */
.post-card {
    display: grid;
    grid-template-columns: 1fr;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.15s,
        box-shadow 0.15s,
        border-color 0.15s;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}
.post-card__media {
    background-size: cover;
    background-position: center;
    min-height: 180px;
}
.post-card__body {
    padding: 24px 26px 26px;
}
.post-card__body h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin: 12px 0 8px;
}
.post-card__body p {
    color: var(--text-body);
    font-size: 0.96rem;
    margin-bottom: 14px;
}
.post-card__meta {
    font-size: 0.82rem;
    color: var(--text-light);
}
.post-card__more {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.9rem;
}
/* Featured card: image beside content on wide screens */
.post-card--featured {
    grid-template-columns: 1.05fr 1fr;
}
.post-card--featured .post-card__media {
    min-height: 260px;
}
.post-card--featured .post-card__body {
    padding: 34px 36px;
    align-self: center;
}
.post-card--featured .post-card__body h3 {
    font-size: 1.6rem;
}
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    margin-top: 22px;
}

/* ---------- Blog responsive ---------- */
@media (max-width: 700px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .beforeafter {
        grid-template-columns: 1fr;
    }
    .ba-arrow {
        transform: rotate(90deg);
        padding: 4px 0;
    }
    .related-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    .post-card--featured {
        grid-template-columns: 1fr;
    }
    .post-card--featured .post-card__media {
        min-height: 200px;
    }
    .post-card--featured .post-card__body {
        padding: 24px 24px 26px;
    }
    .article-banner .page-banner__inner {
        padding: 24px 22px;
    }
    .pullquote {
        font-size: 1.25rem;
    }
}

/* ---------- Blog print ---------- */
@media print {
    .article-banner,
    .ba-panel.after {
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .reader-cta,
    .figure,
    .pullquote,
    .stat,
    .beforeafter,
    .compare,
    .faq details,
    .post-card,
    .related-card {
        break-inside: avoid;
    }
}

/* =============================================================================
   DARK MODE
   Brand tokens (--primary/--accent) stay constant; only surfaces, text, borders
   and the split tokens (--ink-accent / --surface-warm / --divider) reskin. Set
   on <html data-theme="dark"> by the no-flash head script + the theme toggle.
   ============================================================================= */
[data-theme="dark"] {
    --bg: #0e1620;
    --white: #18222e;
    --border: #2c3a48;
    --text-dark: #eef2f6;
    --text-body: #c3ccd6;
    --text-light: #8e9aa8;
    --primary-light: #6fb0e6;
    --ink-accent: #9cc6ec;
    --surface-warm: #1e2933;
    --divider: #2c3a48;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.6);
}
/* Re-skin the few hardcoded literals that tokens can't reach */
[data-theme="dark"] .callout.tip {
    background: #2a2417;
}
[data-theme="dark"] .callout.note {
    background: #142532;
}
[data-theme="dark"] .callout.important {
    background: #2c1b18;
}
[data-theme="dark"] .compare td.col-highlight {
    background: #2a2417;
}
[data-theme="dark"] .checklist li::before {
    background: var(--white);
}
[data-theme="dark"] .shot {
    background: repeating-linear-gradient(
        45deg,
        #1b2530,
        #1b2530 12px,
        #212c38 12px,
        #212c38 24px
    );
}

/* =============================================================================
   NEW COMPONENTS
   ============================================================================= */

/* ---------- Key takeaways box ---------- */
.takeaways {
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: var(--space-lg) var(--space-xl);
    margin: var(--space-xl) 0;
}
.takeaways__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: var(--text-md);
    color: var(--ink-accent);
    margin: 0 0 var(--space-sm);
}
.takeaways__title::before {
    content: "✦";
    color: var(--accent);
}
.takeaways ul {
    list-style: none;
    margin: 0;
}
.takeaways li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 10px;
    font-size: 0.97rem;
}
.takeaways li:last-child {
    margin-bottom: 0;
}
.takeaways li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-hover);
    font-weight: 700;
}

/* ---------- Auto table of contents (in-flow, scroll-spy) ---------- */
.post-toc {
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    margin: 0 0 var(--space-xl);
}
.post-toc__title {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--muted, var(--text-light));
    margin: 0 0 10px;
}
.post-toc__list {
    list-style: none;
    margin: 0;
}
.post-toc__list li {
    margin: 0 0 6px;
}
.post-toc__list li:last-child {
    margin-bottom: 0;
}
.post-toc a {
    display: inline-block;
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.92rem;
    line-height: 1.4;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition:
        color 0.15s,
        border-color 0.15s;
}
.post-toc a:hover {
    color: var(--ink-accent);
}
.post-toc a.is-active {
    color: var(--ink-accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* ---------- Media gallery (wraps .figure) ---------- */
.gallery {
    display: grid;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.gallery--2 {
    grid-template-columns: repeat(2, 1fr);
}
.gallery--3 {
    grid-template-columns: repeat(3, 1fr);
}
.gallery .figure {
    margin: 0;
}

/* ---------- Button system (.btn-gold / .btn-primary kept as aliases) ---------- */
.btn {
    display: inline-block;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.2;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: 9px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s,
        transform 0.15s,
        box-shadow 0.15s;
}
.btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}
.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn--gold {
    background: var(--accent);
    color: var(--primary-dark);
}
.btn--gold:hover {
    background: #d9b876;
    transform: translateY(-1px);
}
.btn--outline {
    background: transparent;
    border-color: var(--accent);
    color: var(--ink-accent);
}
.btn--outline:hover {
    background: var(--accent);
    color: var(--primary-dark);
}
.btn--ghost {
    background: transparent;
    color: var(--primary-light);
    padding-left: 6px;
    padding-right: 6px;
}
.btn--ghost:hover {
    color: var(--ink-accent);
}
.btn--sm {
    font-size: 0.82rem;
    padding: 8px 16px;
}
.btn--lg {
    font-size: 1rem;
    padding: 15px 28px;
}

/* =============================================================================
   PROGRESSIVE-ENHANCEMENT CONTROLS (styled here, driven by scripts/ui.js)
   ============================================================================= */

/* ---------- Theme toggle (in header; only shown when JS is active) ---------- */
.theme-toggle {
    display: none;
}
.js .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: var(--cream);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition:
        background 0.15s,
        transform 0.15s;
}
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
}
/* Push brand left so nav + toggle group on the right (and brand + toggle share
   the top row on mobile, with nav wrapping below). */
.js .site-header__inner > .brand {
    margin-right: auto;
}
.theme-toggle__sun {
    display: none;
}
.theme-toggle__moon {
    display: inline;
}
[data-theme="dark"] .theme-toggle__sun {
    display: inline;
}
[data-theme="dark"] .theme-toggle__moon {
    display: none;
}

/* ---------- Reading progress bar ---------- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    z-index: 60;
    will-change: transform;
}

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--accent);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition:
        opacity 0.2s,
        transform 0.2s,
        visibility 0.2s;
    z-index: 55;
}
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.back-to-top:hover {
    transform: translateY(-2px);
}

/* ---------- Reveal-on-scroll (only hides when JS is present) ---------- */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}
.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* dev-cta reveal variant: subtle scale-in instead of slide-up */
.js [data-reveal].dev-cta {
    transform: scale(0.96);
}
.js [data-reveal].dev-cta.is-visible {
    transform: scale(1);
}

/* =============================================================================
   UTILITY CLASSES (small, curated)
   ============================================================================= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.stack > * + * {
    margin-top: var(--space-md);
}
.measure {
    max-width: 68ch;
}
.text-center {
    text-align: center;
}
.mt-sm {
    margin-top: var(--space-sm);
}
.mt-md {
    margin-top: var(--space-md);
}
.mt-lg {
    margin-top: var(--space-lg);
}
.mt-xl {
    margin-top: var(--space-xl);
}
.mb-sm {
    margin-bottom: var(--space-sm);
}
.mb-md {
    margin-bottom: var(--space-md);
}
.mb-lg {
    margin-bottom: var(--space-lg);
}
.mb-xl {
    margin-bottom: var(--space-xl);
}

/* =============================================================================
   FOCUS + MOTION POLISH
   ============================================================================= */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.btn:focus-visible,
.theme-toggle:focus-visible,
.back-to-top:focus-visible,
.site-nav a:focus-visible,
.post-toc a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .js [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .back-to-top,
    .theme-toggle,
    .reading-progress,
    .site-footer a[href^="mailto:"]::after,
    .toc a::after,
    .post-toc a::after {
        transition: none !important;
    }
}

/* ---------- New-component responsive ---------- */
@media (max-width: 700px) {
    .gallery--2,
    .gallery--3 {
        grid-template-columns: 1fr;
    }
    .takeaways {
        padding: var(--space-lg);
    }
    /* Float the toggle to the top-right so it shares the brand's row instead
       of orphaning below the wrapped nav. */
    .js .site-header__inner {
        position: relative;
        padding-right: 64px;
    }
    .js .theme-toggle {
        position: absolute;
        top: 13px;
        right: 18px;
    }
}

/* ---------- New-component + dark-mode print ---------- */
@media print {
    /* Neutralize dark mode for printing so text stays readable on white */
    [data-theme="dark"] {
        --bg: #f9f7f4;
        --white: #ffffff;
        --border: #e2ddd5;
        --text-dark: #1a2332;
        --text-body: #3a4553;
        --text-light: #6b7a8d;
        --primary-light: #1a5a8a;
        --ink-accent: #0c4067;
        --surface-warm: #f4f1ec;
        --divider: #f4f1ec;
    }
    .theme-toggle,
    .reading-progress,
    .back-to-top,
    .post-toc {
        display: none !important;
    }
    .takeaways,
    .gallery .figure {
        break-inside: avoid;
    }
}

/* =============================================================================
   MODERN NAVBAR (index.html) — ported from the Qwen prototype.
   Self-contained: unique class names, scoped CSS vars, no impact on the
   .site-header used by the other pages. Theme follows the site convention —
   light is the default, [data-theme="dark"] overrides — and the toggle persists
   via scripts/ui.js. Hide-on-scroll is preserved through [data-hide-on-scroll].
   ============================================================================= */
.navbar {
    /* ---- light-mode tokens (default) ---- */
    --nav-bg: #ffffff;
    --nav-text: #1a2d3f;
    --nav-text-muted: #5a6b7d;
    --nav-gold: #b8943f;
    --nav-gold-light: #c9a96e;
    --nav-gold-bg: rgba(184, 148, 63, 0.12);
    --nav-border: rgba(0, 0, 0, 0.08);
    --nav-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    --nav-shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.08);
    --nav-mobile-bg: #ffffff;
    --nav-hover-bg: rgba(0, 0, 0, 0.04);
    --nav-ease: cubic-bezier(0.34, 1.56, 0.64, 1);

    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    transition:
        transform 0.3s ease,
        background 0.3s ease,
        box-shadow 0.3s ease;
}
[data-theme="dark"] .navbar {
    /* ---- dark-mode token overrides ---- */
    --nav-bg: #1a2d3f;
    --nav-text: #e8e8e8;
    --nav-text-muted: #a0b4c8;
    --nav-gold: #c9a96e;
    --nav-gold-light: #dfc08a;
    --nav-gold-bg: rgba(201, 169, 110, 0.15);
    --nav-border: rgba(255, 255, 255, 0.06);
    --nav-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --nav-shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.25);
    --nav-mobile-bg: #162536;
    --nav-hover-bg: rgba(255, 255, 255, 0.05);
}
.navbar.scrolled {
    box-shadow: var(--nav-shadow-sm);
}
/* hide-on-scroll (driven by scripts/ui.js toggling .is-hidden) */
.navbar.is-hidden {
    transform: translateY(-100%);
}
.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    height: 64px;
}

/* ---- Logo ---- */
.navbar .logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}
.navbar .logo-star {
    width: 22px;
    height: 22px;
    color: var(--nav-gold);
    transition:
        transform 0.4s var(--nav-ease),
        color 0.3s ease;
}
.navbar .logo:hover .logo-star {
    transform: rotate(72deg) scale(1.15);
}
.navbar .logo-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--nav-text);
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}
.navbar .logo-text span {
    color: var(--nav-gold);
    font-weight: 400;
}

/* ---- Desktop nav links ---- */
.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-self: center;
}
.navbar .nav-link {
    position: relative;
    top: 5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.9rem;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1;
    font-weight: 500;
    color: var(--nav-text-muted);
    text-decoration: none;
    border: none;
    background: transparent;
    border-radius: 4px;
    white-space: nowrap;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease;
}
.navbar .nav-link:hover {
    color: var(--nav-text);
    background: var(--nav-hover-bg);
}
.navbar .nav-link.active {
    color: var(--nav-text);
    background: var(--nav-gold-bg);
}
.navbar .chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.25s var(--nav-ease);
}
.navbar .nav-dropdown-wrap.open .chevron,
.navbar .mobile-card-link[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* ---- Sample Posts dropdown ---- */
.navbar .nav-dropdown-wrap {
    position: relative;
}
.navbar .nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    min-width: 230px;
    padding: 0.5rem;
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    box-shadow: var(--nav-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-8px) scale(0.96);
    transform-origin: top center;
    transition:
        opacity 0.2s ease,
        transform 0.25s var(--nav-ease),
        visibility 0.2s ease;
    z-index: 60;
}
.navbar .nav-dropdown-wrap.open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}
.navbar .nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--nav-text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition:
        color 0.15s ease,
        background 0.15s ease,
        transform 0.15s ease;
}
.navbar .nav-dropdown-item:hover {
    color: var(--nav-text);
    background: var(--nav-hover-bg);
    transform: translateX(2px);
}
.navbar .nav-dropdown-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--nav-gold-bg);
    color: var(--nav-gold);
    flex-shrink: 0;
}
.navbar .nav-dropdown-item-icon svg {
    width: 14px;
    height: 14px;
}

/* ---- Actions cluster ---- */
.navbar .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.navbar .settings-wrap {
    position: relative;
}

/* ---- Kebab (settings) button — Chrome-style vertical three dots ---- */
.navbar .settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--nav-border);
    border-radius: 10px;
    background: transparent;
    color: var(--nav-text-muted);
    cursor: pointer;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}
.navbar .settings-btn:hover {
    color: var(--nav-gold);
    border-color: var(--nav-gold);
    background: var(--nav-gold-bg);
}
.navbar .settings-btn:active {
    transform: scale(0.92);
}
.navbar .settings-btn svg {
    width: 18px;
    height: 18px;
}

/* ---- Settings (Appearance) dropdown ---- */
.navbar .settings-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    padding: 0.75rem;
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    box-shadow: var(--nav-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition:
        opacity 0.2s ease,
        transform 0.25s var(--nav-ease),
        visibility 0.2s ease;
    z-index: 60;
}
.navbar .settings-wrap.open .settings-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.navbar .settings-dropdown-header {
    padding: 0.5rem 0.5rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nav-text-muted);
}
.navbar .settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.navbar .settings-item:hover {
    background: var(--nav-hover-bg);
}
.navbar .settings-item-left,
.navbar .mobile-card-settings-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.navbar .settings-item-icon,
.navbar .mobile-card-settings-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--nav-gold-bg);
    color: var(--nav-gold);
    flex-shrink: 0;
}
.navbar .settings-item-icon svg,
.navbar .mobile-card-settings-icon svg {
    width: 16px;
    height: 16px;
}
.navbar .settings-item-label,
.navbar .mobile-card-settings-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--nav-text);
}
.navbar .settings-item-sublabel,
.navbar .mobile-card-settings-sublabel {
    display: block;
    margin-top: 1px;
    font-size: 0.72rem;
    color: var(--nav-text-muted);
}

/* ---- Toggle switch ---- */
.navbar .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.12);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.3s ease;
}
[data-theme="dark"] .navbar .toggle-switch {
    background: rgba(255, 255, 255, 0.1);
}
.navbar .toggle-switch.active {
    background: var(--nav-gold);
}
.navbar .toggle-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s var(--nav-ease);
}
.navbar .toggle-switch.active::after {
    transform: translateX(20px);
}

/* ---- Hamburger (mobile) ---- */
.navbar .mobile-wrap {
    position: absolute;
    right: 20px;
}
.navbar .hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--nav-border);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}
.navbar .hamburger:hover {
    border-color: var(--nav-gold);
    background: var(--nav-gold-bg);
}
.navbar .hamburger-line {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--nav-text);
    transform-origin: center;
    transition:
        transform 0.3s var(--nav-ease),
        opacity 0.2s ease,
        width 0.2s ease;
}
.navbar .hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.navbar .hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    width: 0;
}
.navbar .hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---- Mobile card (revealed by the hamburger) ---- */
.navbar .mobile-card {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    padding: 0.75rem;
    background: var(--nav-mobile-bg);
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    box-shadow: var(--nav-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition:
        opacity 0.2s ease,
        transform 0.25s var(--nav-ease),
        visibility 0.2s ease;
    z-index: 60;
}
.navbar .mobile-card.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.navbar .mobile-card-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.navbar .mobile-card-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--nav-text-muted);
    text-decoration: none;
    border: none;
    background: transparent;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}
.navbar .mobile-card-link:hover {
    color: var(--nav-text);
    background: var(--nav-hover-bg);
}
.navbar .mobile-card-link.active {
    color: var(--nav-gold);
    background: var(--nav-gold-bg);
}
.navbar .mobile-card-link-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nav-gold);
    opacity: 0;
    transform: scale(0);
    flex-shrink: 0;
    transition:
        opacity 0.2s ease,
        transform 0.3s var(--nav-ease);
}
.navbar .mobile-card-link.active .mobile-card-link-dot {
    opacity: 1;
    transform: scale(1);
}
.navbar .mobile-card-link .chevron {
    margin-left: auto;
}
.navbar .mobile-card-divider {
    height: 1px;
    margin: 0.5rem 0;
    background: var(--nav-border);
}
.navbar .mobile-card-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.navbar .mobile-card-settings:hover {
    background: var(--nav-hover-bg);
}

/* ---- Mobile Sample Posts submenu (inline expand) ---- */
.navbar .mobile-submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-left: 1.5rem;
    transition:
        max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease;
}
.navbar .mobile-submenu.open {
    max-height: 320px;
    opacity: 1;
}
.navbar .mobile-submenu-item {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--nav-text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}
.navbar .mobile-submenu-item:hover {
    color: var(--nav-text);
    background: var(--nav-hover-bg);
}

/* ---- Responsive: collapse to hamburger ---- */
@media (max-width: 900px) {
    .navbar .nav-links {
        display: none;
    }
    .navbar .settings-wrap {
        display: none;
    }
    .navbar .hamburger {
        display: flex;
    }
    .navbar .mobile-card {
        display: block;
    }
}
@media (max-width: 480px) {
    .navbar .mobile-card {
        width: calc(100vw - 2rem);
        right: -8px;
    }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .navbar,
    .navbar .logo-star,
    .navbar .chevron,
    .navbar .nav-dropdown,
    .navbar .settings-dropdown,
    .navbar .mobile-card,
    .navbar .mobile-submenu,
    .navbar .hamburger-line,
    .navbar .toggle-switch,
    .navbar .toggle-switch::after {
        transition: none !important;
    }
}
