/* guides.css — Revetti & Company guide pages */

.guide-header { padding: 72px 0 56px; border-bottom: 1px solid var(--ash); background: var(--bone); }
.guide-header-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.signal-rule { display: inline-block; width: 48px; height: 1px; background: var(--signal); }
.guide-category { color: var(--signal-deep); font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.guide-meta-row { display: flex; gap: 8px; align-items: center; margin-top: 20px; font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; color: var(--stone); letter-spacing: 0.04em; }

.guide-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; padding: 40px 0; border-top: 1px solid var(--ash); border-bottom: 1px solid var(--ash); margin: 40px 0; }
@media (max-width:640px) { .guide-stats { grid-template-columns: 1fr; gap: 20px; } }
.guide-stat-value { font-family: 'Spectral', Georgia, serif; font-size: 36px; font-weight: 600; color: var(--ink); display: block; line-height: 1; margin-bottom: 8px; }
.guide-stat-label { font-size: 14px; color: var(--stone); line-height: 1.5; }

.guide-body { padding: 64px 0; }
.guide-body .wrap { max-width: 740px; }
.guide-body h2 { font-family: 'Spectral', Georgia, serif; font-size: clamp(1.4rem,2.4vw,1.9rem); font-weight: 500; letter-spacing: -0.01em; margin: 52px 0 20px; color: var(--ink); }
.guide-body h3 { font-family: 'IBM Plex Sans', sans-serif; font-size: 1.05rem; font-weight: 600; margin: 32px 0 12px; color: var(--ink); }
.guide-body p { font-size: 1rem; line-height: 1.72; color: var(--graphite); margin-bottom: 18px; }
.guide-body strong { color: var(--ink); font-weight: 600; }

.guide-table { width: 100%; border-collapse: collapse; margin: 32px 0; font-size: 15px; }
.guide-table th { text-align: left; padding: 10px 16px; background: var(--ink); color: var(--bone); font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.guide-table td { padding: 12px 16px; border-bottom: 1px solid var(--ash); vertical-align: top; color: var(--graphite); font-size: 15px; line-height: 1.55; }
.guide-table tr:last-child td { border-bottom: none; }

.guide-list { list-style: none; margin: 0 0 20px; padding: 0; }
.guide-list li { padding: 10px 0 10px 20px; border-bottom: 1px solid var(--ash); color: var(--graphite); font-size: 1rem; line-height: 1.65; position: relative; }
.guide-list li:last-child { border-bottom: none; }
.guide-list li::before { content: '—'; color: var(--signal); position: absolute; left: 0; font-weight: 600; }

.guide-callout { background: #f4f5f1; border-left: 3px solid var(--signal); padding: 24px 28px; margin: 36px 0; }
.guide-callout p { color: var(--graphite); font-size: 15px; line-height: 1.65; margin: 0 0 16px; }
.guide-callout p:last-child { margin: 0; }

.guide-bottom-cta { padding: 80px 0; background: var(--ink); }
.guide-bottom-cta h2 { font-family: 'Spectral', Georgia, serif; font-size: clamp(1.6rem,3vw,2.4rem); color: var(--bone); margin-bottom: 36px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.cta-pair { display: flex; gap: 16px; flex-wrap: wrap; }
.btn-guide-primary { display: inline-block; background: var(--signal); color: var(--bone); font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 14px; padding: 14px 24px; text-decoration: none; transition: background 150ms ease; }
.btn-guide-primary:hover { background: var(--signal-deep); }
.btn-guide-ghost { display: inline-block; background: transparent; color: var(--bone); font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 14px; padding: 14px 24px; border: 1px solid rgba(237,239,234,0.35); text-decoration: none; transition: border-color 150ms ease; }
.btn-guide-ghost:hover { border-color: var(--bone); }

/* Guide card grid (guides hub) — dark-glow ampersand cards */
.guide-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 36px; }
.guide-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 30px 28px; background: var(--bone); border: 1px solid var(--ash);
  border-radius: var(--r-sm); text-decoration: none; color: inherit;
  transition: border-color .2s ease, box-shadow .25s ease, transform .2s ease;
}
.guide-card .amp-motif {
  position: absolute; top: -28px; right: 2px; z-index: 0;
  font-family: 'Spectral', Georgia, serif; font-style: italic; font-weight: 700;
  font-size: clamp(8rem, 11vw, 10rem); line-height: 1; color: var(--signal);
  opacity: .10; pointer-events: none; user-select: none; transition: opacity .25s ease;
}
.guide-card-category { position: relative; z-index: 1; color: var(--signal-deep); font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; display: block; margin-bottom: 14px; }
.guide-card-title { position: relative; z-index: 1; font-family: 'Spectral', Georgia, serif; font-size: 1.24rem; font-weight: 500; margin-bottom: 12px; color: var(--ink); letter-spacing: -0.01em; line-height: 1.22; }
.guide-card-desc { position: relative; z-index: 1; flex: 1; color: var(--graphite); font-size: 15px; line-height: 1.6; margin-bottom: 20px; }
.guide-card-link { position: relative; z-index: 1; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; font-family: 'IBM Plex Sans', sans-serif; display: inline-flex; align-items: center; gap: 7px; }
.guide-card-link .arr { transition: transform .2s ease; }
.guide-card:hover { border-color: var(--signal); }
.guide-card:hover .guide-card-link .arr { transform: translateX(4px); }

/* Dark-glow treatment (mode-dark default for the hub) */
.mode-dark .guide-card { background: var(--bg-surface); border-color: rgba(var(--signal-lift-rgb), .18); }
.mode-dark .guide-card .amp-motif { color: var(--signal-lift); opacity: .13; text-shadow: 0 0 60px rgba(var(--signal-lift-rgb), .4); }
.mode-dark .guide-card-category { color: var(--signal-lift); }
.mode-dark .guide-card-title { color: var(--text-primary); }
.mode-dark .guide-card-desc { color: var(--text-secondary); }
.mode-dark .guide-card-link { color: var(--signal-lift); }
.mode-dark .guide-card:hover {
  border-color: var(--signal-lift); transform: translateY(-2px);
  box-shadow: inset var(--glow-rim), var(--glow-soft);
}
.mode-dark .guide-card:hover .amp-motif { opacity: .22; }

.filter-pill--disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ─────────────────────────────────────────────────────────────
   DARK MODE — guide reading pages adopt the Revetti glow default.
   The base rules above are the light-mode fallback; .mode-dark on
   <html> flips surfaces + text to INK/BONE per Design Brief v4.1.
   guides.css originally hard-coded raw tokens (--bone/--ink/
   --graphite), so it could not respond to .mode-dark — these
   overrides map each guide element onto the dark-safe semantic
   tokens. NOTE: GRAPHITE text on INK is prohibited by the brief,
   so dark body copy uses --text-secondary (ASH), never graphite.
   ───────────────────────────────────────────────────────────── */
.mode-dark .guide-header { background: var(--bg-page); border-bottom-color: var(--border-mid); }
.mode-dark .guide-stats { border-top-color: var(--border-mid); border-bottom-color: var(--border-mid); }
.mode-dark .guide-stat-value { color: var(--text-primary); }
.mode-dark .guide-stat-label { color: var(--text-muted); }
.mode-dark .guide-body h2,
.mode-dark .guide-body h3 { color: var(--text-primary); }
.mode-dark .guide-body p { color: var(--text-secondary); }
.mode-dark .guide-body strong { color: var(--text-primary); }
.mode-dark .guide-table th { background: var(--bg-surface); color: var(--text-primary); }
.mode-dark .guide-table td { color: var(--text-secondary); border-bottom-color: var(--border-mid); }
.mode-dark .guide-list li { color: var(--text-secondary); border-bottom-color: var(--border-mid); }
.mode-dark .guide-callout { background: var(--bg-surface); }
.mode-dark .guide-callout p { color: var(--text-secondary); }
/* bottom CTA is INK in light mode; lift it off the now-INK page so it reads as a distinct band */
.mode-dark .guide-bottom-cta { background: var(--bg-alt); border-top: 1px solid var(--border-mid); }

/* ─────────────────────────────────────────────────────────────
   CLOSING CTA BLOCK — single consolidated end-of-guide offer.
   Guide Revision sprint (W2): replaces the scattered mid-guide
   Stripe callouts. Visual hierarchy per spec: PDF download (most
   prominent) → Stripe buy button → discovery link (footnote).
   ───────────────────────────────────────────────────────────── */
.guide-cta-eyebrow { display:block; font-family:'IBM Plex Sans',sans-serif; font-size:12px; font-weight:600; letter-spacing:0.08em; text-transform:uppercase; color: var(--signal-lift); margin-bottom:16px; }
.guide-cta-desc { color: rgba(237,239,234,0.82); font-size:1rem; line-height:1.7; max-width:640px; margin:0 0 28px; }
.guide-cta-actions { display:flex; gap:20px; align-items:center; flex-wrap:wrap; }
.btn-guide-pdf { display:inline-flex; align-items:center; gap:8px; background: var(--signal); color: var(--bone); font-family:'IBM Plex Sans',sans-serif; font-weight:600; font-size:15px; padding:15px 28px; border-radius:5px; text-decoration:none; border:0; cursor:pointer; transition: background 150ms ease; }
.btn-guide-pdf:hover { background: var(--signal-deep); }
a.btn-guide-pdf { box-shadow: var(--glow-cta); }

/* PDF gate — inline capture-first email form (injected by site.js initPdfGate) */
.pdf-gate { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:0; }
.pdf-gate__email { font-family:'IBM Plex Sans',sans-serif; font-size:15px; padding:14px 16px; min-width:240px; border-radius:5px; border:1px solid var(--border-visible); background: var(--bg-input); color: var(--text-primary); }
.pdf-gate__email::placeholder { color: var(--text-muted); }
.pdf-gate__email.invalid { border-color: var(--alert, #c0563b); }
.pdf-gate__msg { flex-basis:100%; margin:6px 0 0; color: var(--text-secondary); font-size:0.92rem; display:none; }
.pdf-gate__msg.show { display:block; }
.pdf-gate__msg a { color: var(--text-accent); }

/* ─────────────────────────────────────────────────────────────
   PRINT — used to generate the downloadable guide PDFs.
   Browsers drop background colors in print, so the dark theme would
   render invisible (ash text on white). Force readable dark-on-white,
   hide interactive/navigation chrome, keep the content + closing copy.
   ───────────────────────────────────────────────────────────── */
@media print {
  .site-head, .site-foot, .guide-hero, .guide-toc, .pdf-gate,
  .btn-guide-pdf, stripe-buy-button, .guide-inline-cta, .guide-related { display: none !important; }
  html.mode-dark, html.mode-dark body { background: #fff !important; }
  .guide-header { background: #fff !important; border: 0 !important; padding-top: 0 !important; }
  .guide-bottom-cta { background: #fff !important; border-top: 1px solid #ccc !important; padding: 32px 0 0 !important; }
  .guide-header *, .guide-body, .guide-body *, .guide-bottom-cta * { color: #20292e !important; }
  .guide-stat-value, .guide-body h1, .guide-body h2, .guide-body h3, .guide-body strong, .guide-bottom-cta h2 { color: #0E1A1E !important; }
  .guide-cta-eyebrow, .guide-bottom-cta .cta-footnote a, .guide-body a { color: #0A4A45 !important; }
  .guide-table th { background: #0E1A1E !important; color: #EDEFEA !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .guide-table, .guide-callout, .guide-fitcheck { break-inside: avoid; }
  .guide-body h2, .guide-body h3 { break-after: avoid; }
}
.guide-bottom-cta .cta-footnote a { color: var(--bone); text-decoration: underline; text-underline-offset: 2px; }

/* quiet mid-guide inline CTA — one per guide, matches the site's "when you're ready"
   prose-link pattern. Not a button, not a box (Guide Revision W2 step 3). */
.guide-body .guide-inline-cta { color: var(--text-muted); font-style: italic; margin: 40px 0; }
.guide-body .guide-inline-cta a { color: var(--text-accent); font-style: normal; }

/* ─────────────────────────────────────────────────────────────
   OPTIONAL HERO BANNER (Guide Revision W4 — image wiring)
   Full-bleed art above the header text. The <img> self-removes via
   onerror when the per-guide asset is absent, so there's no blank
   band or broken-image icon until images/guides/<slug>-hero.{webp,png}
   is added. Drop the file → it appears, no markup change needed.
   ───────────────────────────────────────────────────────────── */
.guide-hero { width:100%; background: var(--bg-page); line-height:0; }
.guide-hero img { display:block; width:100%; height:auto; aspect-ratio:2.4/1; max-height:420px; object-fit:cover; object-position:center; }

/* ─────────────────────────────────────────────────────────────
   GUIDE STRUCTURE ADDITIONS (Guide Revision W5)
   Jump-link TOC · "Is this for you?" fit-check · related guides.
   All use semantic tokens, so they ride the .mode-dark default.
   ───────────────────────────────────────────────────────────── */
/* Table of contents */
.guide-toc { margin: 0 0 40px; }
.guide-toc__label { font-family:'IBM Plex Sans',sans-serif; font-size:11px; font-weight:600; letter-spacing:0.08em; text-transform:uppercase; color: var(--text-muted); margin-bottom:14px; }
.guide-toc__list { list-style:none; margin:0; padding:0; display:grid; gap:2px; }
.guide-toc__list a { display:block; padding:9px 0 9px 18px; border-left:2px solid var(--border-mid); color: var(--text-secondary); text-decoration:none; font-size:0.96rem; transition: border-color 150ms ease, color 150ms ease; }
.guide-toc__list a:hover { border-left-color: var(--signal); color: var(--text-primary); }

/* "Is this for you?" fit-check */
.guide-fitcheck { border:1px solid var(--border-mid); border-left:3px solid var(--signal); padding:24px 28px; margin:8px 0 44px; border-radius:5px; }
.guide-fitcheck__title { font-family:'Spectral',Georgia,serif; font-size:1.15rem; font-weight:500; color: var(--text-primary); margin:0 0 14px; }
.guide-fitcheck ul { list-style:none; margin:0; padding:0; }
.guide-fitcheck li { position:relative; padding:7px 0 7px 24px; color: var(--text-secondary); font-size:0.97rem; line-height:1.6; }
.guide-fitcheck li::before { content:'✓'; position:absolute; left:0; color: var(--signal-lift); font-weight:600; }

/* Related guides (internal linking) */
.guide-related { margin:56px 0 0; padding-top:32px; border-top:1px solid var(--border-mid); }
.guide-related__label { font-family:'IBM Plex Sans',sans-serif; font-size:11px; font-weight:600; letter-spacing:0.08em; text-transform:uppercase; color: var(--text-muted); margin-bottom:16px; }
.guide-related__list { display:grid; gap:12px; }
.guide-related__list a { color: var(--text-accent); text-decoration:none; font-weight:600; font-size:1rem; line-height:1.4; display:inline-block; }
.guide-related__list a:hover { text-decoration:underline; }
