/* ═══════════════════════════════════════════════════════════════════════
   resource-guide.css — editorial reading-guide shell for /resources/*-guide/
   (BEP guide, EIR guide). Article reading column + sticky sidebar
   (on-this-page TOC + template-download card), in the locked V5 visual
   language. Brand tokens come from page.css :root — no hardcoded palette here.
   Closing band reuses .cta-pathways from service-bim-delivery.css.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────────────────── */
.rg-hero { background: var(--paper); padding: clamp(64px, 7vw, 104px) var(--sp-section-h) clamp(34px, 4vw, 52px); border-bottom: 1px solid var(--paper-rule); }
.rg-hero-in { max-width: 1280px; margin: 0 auto; }
.rg-eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 700; margin-bottom: 18px; }
.rg-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 60px); line-height: 1.04; letter-spacing: -.015em; color: var(--ink); margin: 0 0 20px; max-width: 18em; text-wrap: balance; }
.rg-hero h1 br { display: inline; }
.rg-hero h1 em { font-style: italic; color: var(--red); }
.rg-lead { font-size: clamp(18px, 2.1vw, 21px); line-height: 1.58; color: var(--ink-soft); margin: 0; max-width: 60ch; }
/* meta line — legible: bigger, darker ink, tighter tracking (was 11px washed-grey) */
.rg-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: 26px; }
.rg-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-light); }

/* ── Layout: article + sticky sidebar ────────────────────────────────── */
.rg-wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--sp-section-h); display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; align-items: start; }
.rg-read { max-width: 760px; padding: 48px 0 24px; }
.rg-side { position: sticky; top: 84px; padding: 44px 0 24px; }

/* ── Reading column typography ───────────────────────────────────────── */
.rg-read p { font-size: 17px; line-height: 1.62; color: var(--ink-soft); margin: 0 0 16px; }
.rg-read h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 34px); color: var(--ink); margin: 48px 0 16px; line-height: 1.12; scroll-margin-top: 96px; }
.rg-read h2 em { font-style: italic; color: var(--red); }
.rg-read h3 { font-family: var(--sans); font-weight: 700; font-size: 18px; color: var(--ink); margin: 28px 0 8px; scroll-margin-top: 96px; }
.rg-read strong { color: var(--ink); font-weight: 700; }
.rg-read em { font-style: italic; }
.rg-read a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.rg-read a:hover { color: var(--red-deep); }
.rg-read ul { margin: 14px 0 18px; padding: 0; list-style: none; }
.rg-read ul li { position: relative; padding-inline-start: 20px; margin: 0 0 11px; font-size: 16px; line-height: 1.56; color: var(--ink-soft); }
.rg-read ul li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 9px; width: 6px; height: 6px; background: var(--red); }
.rg-read ul li strong { color: var(--ink); }
.rg-read ol { margin: 14px 0 18px; padding-inline-start: 22px; }
.rg-read ol li { margin: 0 0 10px; font-size: 16px; line-height: 1.56; color: var(--ink-soft); }
.rg-read ol li::marker { color: var(--red); font-weight: 700; }

/* ── Numbered section walk ───────────────────────────────────────────── */
.rg-secs { margin: 20px 0 8px; border-top: 1px solid var(--paper-rule); }
.rg-sec { display: grid; grid-template-columns: 56px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--paper-rule); }
.rg-sec .n { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .02em; color: var(--red); padding-top: 2px; font-variant-numeric: tabular-nums; }
.rg-sec h4 { font-family: var(--sans); font-weight: 700; font-size: 16px; color: var(--ink); margin: 0 0 5px; }
.rg-sec p { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 0; }

/* ── Spec table — clean spec sheet: ink top rule, mono code column, room to breathe ── */
.rg-tbl { margin: 24px 0 28px; border-top: 2px solid var(--ink); }
.rg-read table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.rg-read thead th { text-align: start; font-family: var(--sans); font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--paper-rule); padding: 14px 18px 12px; font-size: 13.5px; vertical-align: bottom; }
.rg-read tbody td { border-bottom: 1px solid var(--paper-rule); padding: 15px 18px; color: var(--ink-soft); vertical-align: top; }
.rg-read tbody tr:last-child td { border-bottom: none; }
.rg-read tbody td:first-child { color: var(--ink); font-weight: 700; }
.rg-read td strong { color: var(--ink); }
/* code column + fixed widths apply ONLY to the 4-col states table (.rg-tbl--codes).
   Other guide tables (e.g. the EIR 2-col text table) keep natural wrapping. */
.rg-tbl--codes table td:nth-child(2) { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--red); white-space: nowrap; }
.rg-tbl--codes table th:nth-child(1), .rg-tbl--codes table td:nth-child(1) { width: 19%; }
.rg-tbl--codes table th:nth-child(2), .rg-tbl--codes table td:nth-child(2) { width: 11%; }
.rg-tbl--codes table th:nth-child(3), .rg-tbl--codes table td:nth-child(3) { width: 38%; }
.rg-tbl--codes table th:nth-child(4), .rg-tbl--codes table td:nth-child(4) { width: 32%; }

/* ── Dark slide moment ───────────────────────────────────────────────── */
.rg-slide { background: var(--ink); padding: clamp(40px, 5vw, 60px) 48px; margin: 44px 0; }
.rg-slide .in { max-width: 660px; margin: 0 auto; text-align: center; }
/* quote text forced white — .rg-read p sets a dark colour directly on <p>, which
   beats the colour the slide would otherwise pass down by inheritance. */
.rg-slide .in p { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3.2vw, 31px); line-height: 1.36; color: #fff; margin: 0; }
.rg-slide .in .src { font-family: var(--mono); font-style: normal; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #B9B5AC; margin-top: 22px; }

/* ── Inline note ─────────────────────────────────────────────────────── */
.rg-note { border-inline-start: 3px solid var(--red); background: var(--paper-warm); padding: 16px 20px; margin: 22px 0; }
.rg-note p { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 0; }
.rg-note strong { color: var(--ink); }

/* ── Inline CTA band — light, so the page end isn't a stack of dark boxes
   (the dark closing band + sidebar card already carry the weight) ─────── */
.rg-cta { background: var(--paper-warm); border: 1px solid var(--paper-rule); border-inline-start: 3px solid var(--red); padding: 28px 32px; margin: 40px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.rg-cta .t h4 { font-family: var(--sans); font-size: 18px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.rg-cta .t p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.5; }
.rg-btn { flex: none; display: inline-flex; align-items: center; gap: 9px; background: #fff; color: var(--ink); font-family: var(--sans); font-weight: 700; font-size: 14px; padding: 14px 22px; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.rg-btn:hover { background: var(--paper-warm); color: var(--red-deep); }
.rg-btn .cta-ar { width: 18px; height: 9px; }
/* the inline CTA button lives INSIDE .rg-read, so the generic `.rg-read a`
   (red + underline) would otherwise repaint it. Scope it back to a button. */
.rg-read a.rg-btn { color: var(--ink); text-decoration: none; }
.rg-read a.rg-btn:hover { color: var(--red-deep); }
/* inline CTA sits on a light card now, so its button is ink-filled */
.rg-read .rg-cta a.rg-btn { background: var(--ink); color: #fff; }
.rg-read .rg-cta a.rg-btn:hover { background: var(--red-deep); color: #fff; }

/* ── Sidebar: TOC + download card ────────────────────────────────────── */
.rg-toc { border: 1px solid var(--paper-rule); padding: 22px 22px 10px; margin-bottom: 20px; }
.rg-toc h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 14px; }
.rg-toc nav { display: flex; flex-direction: column; }
.rg-toc a { font-size: 14px; line-height: 1.34; color: var(--muted); text-decoration: none; padding: 7px 0 7px 12px; border-inline-start: 2px solid transparent; transition: color .15s, border-color .15s; }
.rg-toc a:hover { color: var(--red); }
.rg-toc a.on { color: var(--ink); font-weight: 700; border-inline-start-color: var(--red); }
.rg-dl { background: var(--ink); padding: 28px 26px; color: #fff; }
.rg-dl .k { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #B9B5AC; font-weight: 700; margin-bottom: 10px; }
.rg-dl h4 { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.18; color: #fff; margin: 0 0 12px; }
.rg-dl p { font-size: 13px; line-height: 1.55; color: rgba(255,255,255,.66); margin: 0 0 20px; }
.rg-dl .rg-btn { width: 100%; justify-content: center; }

/* ── Tablet: collapse to single column, sidebar below ────────────────── */
@media (max-width: 1040px) {
  .rg-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; } /* minmax(0,..) lets the table scroll-box shrink instead of widening the page */
  .rg-side { position: static; padding: 0; order: 2; margin-top: 28px; }
  .rg-toc { display: none; }                 /* TOC redundant once stacked */
  .rg-dl { margin-top: 4px; max-width: 520px; }
}

/* ── Phone ───────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .rg-read { padding-top: 32px; }
  .rg-read p { font-size: 16px; }
  .rg-sec { grid-template-columns: 46px 1fr; gap: 14px; }
  .rg-slide { padding: 38px 24px; }
  .rg-cta { flex-direction: column; align-items: flex-start; }
  .rg-tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rg-tbl--codes table { min-width: 480px; } /* only the spec table scrolls; text tables wrap */
}
