/* =============================================================================
   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 ·
                                 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(--white);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--shadow-sm);
    padding: 0 20px 26px;
    margin-bottom: 36px;
    overflow: hidden;
}
.toc h4 {
    background: var(--primary);
    color: var(--cream);
    margin: 0 -30px 30px;
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.toc ol {
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 32px;
    list-style-position: inside;
}
.toc li {
    margin-bottom: 7px;
    border-left: 2px solid transparent;
    padding-left: 8px;
    transition: border-color 0.15s ease;
}
.toc li:hover {
    border-left-color: var(--accent);
}
.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: -6px;
}

/* ---------- 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;
    margin-bottom: var(--space-md);
}
.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-accordion {
    margin: 16px 0 0;
    border: none;
}

summary.calendar-label {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-accent);
    padding-bottom: 6px;
    border-bottom: 2px solid var(--ink-accent);
}

summary.calendar-label::-webkit-details-marker { display: none; }

.calendar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.calendar-right::after {
    content: '▾';
    font-size: 1.1rem;
    display: inline-block;
    transform: rotate(-90deg);
    transition: transform 0.2s ease;
}

.calendar-accordion[open] .calendar-right::after {
    transform: rotate(0deg);
}

.calendar-hint {
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-light);
    font-style: italic;
}

.calendar-accordion[open] .calendar-hint {
    display: none;
}

.calendar-accordion + .callout {
    margin-top: 32px;
}

.calendar col.col-mo  { width: 7%; }
.calendar col.col-ttl { width: 46.5%; }
.calendar col.col-ang { width: 46.5%; }

.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);
}
.calendar col.col-mo  { width: 52px; }
.calendar col.col-ttl { width: auto; }
.calendar col.col-tog { width: 36px; }
.calendar .cal-row {
    cursor: pointer;
    user-select: none;
}
.calendar .cal-row:hover .ttl {
    color: var(--accent-hover);
}
.calendar .cal-tog {
    text-align: center;
    color: var(--text-light);
    font-size: 0.75rem;
    transition: transform 0.2s;
}
.calendar .cal-tog::after {
    content: '▾';
}
.calendar .cal-row.is-open .cal-tog {
    transform: rotate(-180deg);
    display: inline-block;
}
.calendar .cal-detail td.ang {
    background: var(--bg);
    border-top: none;
    padding-top: 0;
    padding-bottom: 14px;
    font-style: italic;
}

/* ---------- 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 p + p { margin-top: 6px; }
.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__icon {
        display: none;
    }
    .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: 20px 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 + p { margin-top: var(--space-md); }
.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;
}

/* ---------- 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,
    .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,
    .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 {
    color: var(--nav-gold);
    font-size: 1.2rem;
    line-height: 1;
}
.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,
.navbar .menu-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);
}

/* ---- Menu button (mobile) ---- */
.navbar .mobile-wrap {
    position: absolute;
    right: 20px;
}
.navbar .menu-btn {
    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;
    color: var(--nav-text-muted);
    cursor: pointer;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}
.navbar .menu-btn:hover {
    color: var(--nav-gold);
    border-color: var(--nav-gold);
    background: var(--nav-gold-bg);
}
/* ---- Mobile card (revealed by the menu button) ---- */
.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 menu button ---- */
@media (max-width: 900px) {
    .navbar .nav-links {
        display: none;
    }
    .navbar .settings-wrap {
        display: none;
    }
    .navbar .menu-btn {
        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 .toggle-switch,
    .navbar .toggle-switch::after {
        transition: none !important;
    }
}

/* =============================================================================
   FABLE GUIDE EXTENSIONS
   Everything below this banner was added for Helen's Blogging Guide
   (nsp-webguides-fable) — the Fable 24-post campaign site. Nothing above it
   is modified; these components build on the inherited token system and are
   documented in this folder's README.md.
   ============================================================================= */

/* ---------- Cluster color tokens (A–E) ---------- */
:root {
    --cluster-a: #0c4067; /* A — Working With a Freelance Paralegal (navy) */
    --cluster-b: #2e7d6e; /* B — Medical Records & Chronologies (teal) */
    --cluster-c: #b04a3a; /* C — Demand Letters & Settlement (brick) */
    --cluster-d: #7a5ca8; /* D — Discovery & Depositions (plum) */
    --cluster-e: #a87b1f; /* E — Caseload, Trial Prep & Overflow (gold) */
}
[data-theme="dark"] {
    --cluster-a: #6fb0e6;
    --cluster-b: #5fc0ad;
    --cluster-c: #e08a78;
    --cluster-d: #b39ddb;
    --cluster-e: #d9b876;
}

/* ---------- Cluster pills (extends .pill) ---------- */
.cluster-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-warm);
    color: var(--text-body);
    white-space: nowrap;
}
.cluster-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--_c, var(--accent));
    flex: 0 0 auto;
}
.cluster-pill--a { --_c: var(--cluster-a); }
.cluster-pill--b { --_c: var(--cluster-b); }
.cluster-pill--c { --_c: var(--cluster-c); }
.cluster-pill--d { --_c: var(--cluster-d); }
.cluster-pill--e { --_c: var(--cluster-e); }

/* ---------- Shape chip (Essay / Reference / Walkthrough tag) ---------- */
.shape-chip {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    color: var(--accent-hover);
    background: transparent;
    white-space: nowrap;
}
.shape-chip--faq {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

/* ---------- Read-time label ---------- */
.read-time {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: var(--text-light);
    background: var(--surface-warm);
    border-radius: 999px;
    padding: 2px 11px;
    vertical-align: middle;
    margin-left: 10px;
    white-space: nowrap;
}
.read-time::before {
    content: "◔ ";
    color: var(--accent-hover);
}
h2.section .read-time { font-family: var(--font-body); }

/* ---------- "Why this works" aside (one-sentence SEO teaching layer) ---------- */
.why-aside {
    background: var(--surface-warm);
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    padding: 12px 18px;
    margin: 18px 0 22px;
    font-size: 0.9rem;
    color: var(--text-body);
}
.why-aside::before {
    content: "✦ Why this works";
    display: block;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-hover);
    margin-bottom: 4px;
}
.why-aside p:last-child { margin-bottom: 0; }

/* ---------- Review-flag callout (items Helen must verify before publish) ---------- */
.review-flag {
    background: #fdf3e3;
    border: 1px solid #e3c89a;
    border-left: 4px solid #c87f2a;
    border-radius: 10px;
    padding: 18px 22px;
    margin: 22px 0;
    font-size: 0.95rem;
}
.review-flag__label {
    display: block;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a05c12;
    margin-bottom: 6px;
}
.review-flag__label::before { content: "⚑ "; }
.review-flag p:last-child, .review-flag ul:last-child { margin-bottom: 0; }
.review-flag ul { margin-left: 20px; }
[data-theme="dark"] .review-flag {
    background: #2c2212;
    border-color: #5a4622;
    border-left-color: #c87f2a;
}
[data-theme="dark"] .review-flag__label { color: #e0a45c; }

/* ---------- Sanity-survival badges (template annotation layer) ---------- */
.sanity-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.5;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid;
    white-space: normal; /* long badge labels must wrap on narrow screens */
}
.sanity-badge--yes {
    color: #2e7d4f;
    border-color: #7fbf99;
    background: #eaf5ee;
}
.sanity-badge--port {
    color: #a05c12;
    border-color: #e3c89a;
    background: #fdf3e3;
}
[data-theme="dark"] .sanity-badge--yes  { color: #8fd6ac; border-color: #2e7d4f; background: #14281c; }
[data-theme="dark"] .sanity-badge--port { color: #e0a45c; border-color: #5a4622; background: #2c2212; }

/* ---------- Template margin notes (the teaching layer on template pages) ----------
   Inline annotation boxes by default; float into a true right margin rail on
   wide screens (the container shifts left to make room). Print keeps them
   inline so nothing falls off the page. */
.tpl-note {
    border: 1px dashed var(--accent);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 20px 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-body);
    background: transparent;
}
.tpl-note__label {
    display: block;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-hover);
    margin-bottom: 6px;
}
.tpl-note__label::before { content: "✎ "; }
.tpl-note p { margin-bottom: 8px; }
.tpl-note p:last-child { margin-bottom: 0; }
.tpl-note .sanity-badge { margin-top: 2px; }
@media print {
    .tpl-note {
        float: none;
        width: auto;
        margin: 16px 0;
        break-inside: avoid;
    }
}

/* ---------- Deliverable blocks (styled sample work product — Helen's marketing) ---------- */
.deliverable {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    margin: 28px 0;
    overflow: hidden;
    font-size: 0.93rem;
}
.deliverable__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--primary);
    color: #fff;
    padding: 10px 20px;
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.deliverable__head .doc-type { color: var(--accent); }
.deliverable__body { padding: 20px 24px; }
.deliverable__entry {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}
.deliverable__entry:last-child { border-bottom: none; padding-bottom: 2px; }
.deliverable__entry p { margin-bottom: 6px; }
.deliverable__entry p:last-child { margin-bottom: 0; }
.d-date {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--ink-accent);
}
.d-note {
    display: block;
    margin-top: 4px;
    font-style: italic;
    font-size: 0.86rem;
    color: var(--accent-hover);
}
.d-note::before { content: "⚐ "; }
.deliverable__foot {
    padding: 8px 20px 12px;
    font-size: 0.76rem;
    color: var(--text-light);
    border-top: 1px solid var(--divider);
    font-style: italic;
}
/* Chronology variant: entries hang on a timeline rule */
.deliverable--chronology .deliverable__entry {
    border-bottom: none;
    border-left: 2px solid var(--divider);
    padding: 8px 0 8px 18px;
    margin-left: 5px;
    position: relative;
}
.deliverable--chronology .deliverable__entry::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
@media print {
    .deliverable { box-shadow: none; break-inside: avoid; }
    .deliverable__head {
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ---------- Campaign progress tracker (calendar.html) ---------- */
.tracker { list-style: none; margin: 24px 0; }
.tracker__item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--_c, var(--border));
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 10px;
    transition: background 0.2s, border-color 0.2s;
}
.tracker__item--a { --_c: var(--cluster-a); }
.tracker__item--b { --_c: var(--cluster-b); }
.tracker__item--c { --_c: var(--cluster-c); }
.tracker__item--d { --_c: var(--cluster-d); }
.tracker__item--e { --_c: var(--cluster-e); }
.tracker__check {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    margin-top: 4px;
    accent-color: var(--accent);
    cursor: pointer;
}
.tracker__mo {
    flex: 0 0 auto;
    min-width: 96px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent-hover);
    line-height: 1.3;
    padding-top: 2px;
}
.tracker__mo small {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.74rem;
    color: var(--text-light);
}
.tracker__body { flex: 1 1 auto; }
.tracker__title {
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
}
.tracker__job {
    display: block;
    font-size: 0.87rem;
    color: var(--text-light);
    margin-top: 2px;
}
.tracker__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    align-items: center;
}
.tracker__done {
    display: none;
    font-size: 0.74rem;
    font-weight: 700;
    color: #2e7d4f;
    white-space: nowrap;
}
[data-theme="dark"] .tracker__done { color: #8fd6ac; }
.tracker__item:has(.tracker__check:checked) {
    background: var(--surface-warm);
}
.tracker__item:has(.tracker__check:checked) .tracker__title {
    color: var(--text-light);
}
.tracker__item:has(.tracker__check:checked) .tracker__done { display: inline; }
.tracker__item.is-current {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}
.tracker__here {
    display: none;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.tracker__item.is-current .tracker__here { display: inline-block; }

/* Progress summary (JS-enhanced; hidden without JS) */
.tracker-progress { display: none; margin: 22px 0 6px; }
.js .tracker-progress { display: block; }
.tracker-progress__text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.tracker-progress__bar {
    height: 10px;
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.tracker-progress__fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transition: width 0.4s ease;
}

/* Cluster legend (calendar.html) */
.cluster-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 6px;
}

/* ---------- Fable responsive ---------- */
@media (max-width: 700px) {
    .tracker__item { flex-wrap: wrap; }
    .tracker__mo { min-width: 0; }
    .tracker__body { flex-basis: 100%; order: 3; }
}

/* ---------- Run-it checklist variant (empty boxes — for checklists Helen
   actually runs, vs the decorative pre-checked .checklist) ---------- */
.checklist--todo li::after { content: none; }

/* ---------- Fable print ---------- */
@media print {
    .tracker__item, .review-flag, .why-aside { break-inside: avoid; }
    .tracker-progress { display: none !important; }
    .tracker__check { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    /* The modern navbar + floating controls never print (the old print rules
       only knew .site-header/.site-nav). */
    .navbar,
    .back-to-top { display: none !important; }
    .checklist li { break-inside: avoid; }
}

/* ---------- Fable small utilities ---------- */
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.86em;
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 6px;
    color: var(--ink-accent);
}
@media print {
    .no-print { display: none !important; }
}

/* =============================================================================
   FABLE GUIDE EXTENSIONS — VISUAL COMPONENTS (round 2)
   Teaching visuals built on the same tokens: the campaign phase track, shape
   anatomy wireframes, the hour-split bar, the SERP preview, front-matter
   cards, and the cluster rotation strip. Documented in README.md.
   ============================================================================= */

/* ---------- Campaign phase track (index) ----------
   Three phase cards on one gold timeline; each card's top track shows how
   much of the payoff has arrived by that phase (--fill). */
.phases {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 28px 0;
}
.phase {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px 22px;
    box-shadow: var(--shadow-sm);
}
.phase::before {
    content: "";
    display: block;
    height: 6px;
    border-radius: 999px;
    margin-bottom: 16px;
    background:
        linear-gradient(90deg,
            var(--accent) 0,
            var(--accent) var(--fill, 0%),
            var(--divider) var(--fill, 0%),
            var(--divider) 100%);
}
.phase__months {
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-hover);
}
.phase__name {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text-dark);
    margin: 2px 0 8px;
}
.phase p {
    font-size: 0.92rem;
    color: var(--text-body);
    margin: 0;
}

/* ---------- Shape anatomy wireframe (templates + template pages) ----------
   A post's skeleton as stacked blocks; widths via --w. Modifiers:
   --accent (the shape's signature move), --dashed (optional block),
   --doc (a deliverable block: mini document header), --thin (repeated beats). */
.anatomy {
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px 20px;
    margin: 26px 0;
}
.anatomy__title {
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 12px;
}
.anatomy__title::before {
    content: "▤ ";
    color: var(--accent);
}
.anatomy__list {
    list-style: none;
    margin: 0;
}
.anatomy__block {
    width: var(--w, 100%);
    max-width: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 3px solid var(--ink-accent);
    border-radius: 7px;
    padding: 8px 14px;
    margin: 0 0 7px;
    font-size: 0.84rem;
    color: var(--text-light);
    line-height: 1.45;
}
.anatomy__block:last-child { margin-bottom: 0; }
.anatomy__block b {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    color: var(--text-dark);
}
.anatomy__block--accent {
    border-left-color: var(--accent);
    background: linear-gradient(0deg, rgba(200, 164, 94, 0.10), rgba(200, 164, 94, 0.10)) var(--white);
}
.anatomy__block--accent b { color: var(--accent-hover); }
.anatomy__block--dashed { border-style: dashed; }
.anatomy__block--thin { padding: 4px 14px; }
.anatomy__block--doc {
    border-left: 3px solid var(--primary);
    padding-top: 0;
    overflow: hidden;
}
.anatomy__block--doc::before {
    content: "≡ work product";
    display: block;
    margin: 0 -14px 6px;
    padding: 2px 14px;
    background: var(--primary);
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.anatomy__caption {
    margin: 10px 0 0;
    font-size: 0.78rem;
    font-style: italic;
    color: var(--text-light);
}

/* ---------- Hour-split bar (workflow) ---------- */
.time-split {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 26px 0;
    box-shadow: var(--shadow-sm);
}
.time-split__title {
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 12px;
}
.time-split__bar {
    display: flex;
    height: 26px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.time-split__seg { height: 100%; }
.time-split__seg--done {
    width: var(--w, 10%);
    background: repeating-linear-gradient(
        -45deg,
        var(--divider),
        var(--divider) 6px,
        var(--surface-warm) 6px,
        var(--surface-warm) 12px);
}
.time-split__seg--compose {
    width: var(--w, 33%);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.time-split__seg--review {
    width: var(--w, 57%);
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}
.time-split__legend {
    list-style: none;
    margin: 14px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
}
.time-split__legend li {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-body);
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.time-split__legend .dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    align-self: center;
}
.time-split__legend .dot--done {
    background: var(--divider);
    border: 1px solid var(--border);
}
.time-split__legend .dot--compose { background: var(--primary-light); }
.time-split__legend .dot--review { background: var(--accent); }
.time-split__legend b { color: var(--text-dark); }

/* ---------- SERP preview (publishing) ----------
   What the meta title + description become in a Google result. */
.serp {
    margin: 26px 0;
}
.serp__label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 10px;
}
.serp__label::before {
    content: "🔍︎ ";
}
.serp__card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 18px 22px;
    max-width: 600px; /* a real result column is ~600px */
}
.serp__url {
    display: block;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 3px;
}
.serp__title {
    display: block;
    font-family: var(--font-body);
    font-size: 1.12rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--primary-light);
    margin-bottom: 4px;
}
.serp__desc {
    font-size: 0.86rem;
    color: var(--text-body);
    margin: 0;
}
.serp__desc .serp-cut {
    color: var(--text-light);
    font-style: italic;
}
.serp__caption {
    margin: 8px 0 0;
    font-size: 0.78rem;
    font-style: italic;
    color: var(--text-light);
    max-width: 600px;
}

/* ---------- Front-matter card (publishing) ----------
   Extends .deliverable: the draft's header block as labeled rows. */
.deliverable--meta .deliverable__body { padding: 8px 24px 14px; }
.meta-rows {
    margin: 0;
}
.meta-rows > div {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 4px 16px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
}
.meta-rows > div:last-child { border-bottom: none; }
.meta-rows dt {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--accent-hover);
    padding-top: 3px;
}
.meta-rows dd {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-body);
    overflow-wrap: break-word;
}
.meta-rows dd .chars {
    font-size: 0.74rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* ---------- Cluster rotation strip (calendar) ----------
   24 cells, one per month, colored by cluster — the rotation in one glance. */
.coverage {
    margin: 22px 0;
}
.coverage__grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 5px;
    margin: 0;
}
.coverage__cell {
    margin: 0;
    aspect-ratio: 1 / 1;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    background: var(--_c, var(--divider));
}
.coverage__cell--a { --_c: var(--cluster-a); }
.coverage__cell--b { --_c: var(--cluster-b); }
.coverage__cell--c { --_c: var(--cluster-c); }
.coverage__cell--d { --_c: var(--cluster-d); }
.coverage__cell--e { --_c: var(--cluster-e); }
[data-theme="dark"] .coverage__cell { color: var(--primary-dark); }
.coverage__caption {
    margin: 8px 0 0;
    font-size: 0.78rem;
    font-style: italic;
    color: var(--text-light);
}

/* ---------- Round-2 responsive ---------- */
@media (max-width: 700px) {
    .phases { grid-template-columns: 1fr; }
    .coverage__grid { grid-template-columns: repeat(8, 1fr); }
    .meta-rows > div { grid-template-columns: 1fr; padding: 7px 0; }
    .anatomy__block { width: 100%; }
}

/* ---------- Round-2 print ---------- */
@media print {
    .phase, .anatomy, .time-split, .serp__card, .coverage { break-inside: avoid; }
    .time-split__seg--compose, .time-split__seg--review, .coverage__cell {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* =============================================================================
   FABLE GUIDE EXTENSIONS — POST LIBRARY (round 3)
   The posts.html card index + the calendar's "styled draft" links.
   ============================================================================= */

/* ---------- Library cards ----------
   Builds on .related-card: cluster-colored top rule, month eyebrow, job line,
   tag row. A card without an href renders as the muted "draft only" state. */
.lib-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 24px 0;
}
.lib-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 4px solid var(--_c, var(--border));
    border-radius: 12px;
    padding: 18px 22px 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
}
a.lib-card {
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
a.lib-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    border-top-color: var(--_c, var(--accent));
}
.lib-card--a { --_c: var(--cluster-a); }
.lib-card--b { --_c: var(--cluster-b); }
.lib-card--c { --_c: var(--cluster-c); }
.lib-card--d { --_c: var(--cluster-d); }
.lib-card--e { --_c: var(--cluster-e); }
.lib-card__mo {
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--accent-hover);
    margin-bottom: 4px;
}
.lib-card h3 {
    margin: 0 0 4px;
    font-size: 1.06rem;
    line-height: 1.35;
    color: var(--text-dark);
}
.lib-card__job {
    display: block;
    font-size: 0.86rem;
    color: var(--text-light);
    margin-bottom: 10px;
}
.lib-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.lib-card__state {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 9px;
    border-radius: 999px;
}
.lib-card__state--ready {
    background: #eaf5ee;
    color: #2e7d4f;
    border: 1px solid #7fbf99;
}
.lib-card__state--draft {
    background: var(--surface-warm);
    color: var(--text-light);
    border: 1px solid var(--border);
}
[data-theme="dark"] .lib-card__state--ready {
    background: #14281c;
    color: #8fd6ac;
    border-color: #2e7d4f;
}
div.lib-card {
    opacity: 0.78;
}

/* ---------- Calendar: link to the styled rendering ---------- */
.tracker__view {
    font-size: 0.74rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--primary-light);
    white-space: nowrap;
}
.tracker__view:hover { color: var(--ink-accent); text-decoration: underline; }

/* ---------- Reader-view note (top of each rendered post) ---------- */
.reader-note {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    margin: 0 0 22px;
    font-size: 0.84rem;
    color: var(--text-body);
}
.reader-note__label {
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-hover);
}
.reader-note a { color: var(--primary-light); }

/* ---------- Round-3 responsive + print ---------- */
@media (max-width: 700px) {
    .lib-grid { grid-template-columns: 1fr; }
}
@media print {
    .lib-card, .reader-note { break-inside: avoid; }
}

/* ---------- Utility classes (matches sibling guide naming convention) ---------- */
.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); }
.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }

/* ---------- Post disclaimer (educational footer line, every post) ---------- */
.post-disclaimer {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    font-size: 0.9rem;
    color: var(--text-light);
}
.pt-3xl   { padding-top: var(--space-3xl); }
.font-normal { font-weight: 400; }
.section-sub { font-weight: 400; font-size: 0.9rem; font-family: var(--font-body); color: var(--text-light); }
.text-muted  { font-size: 0.9rem; color: var(--text-light); }
