/* Assembly Atlanta — Living Document Portal v3
   Architectural base, editorial moments.
   Off-white paper, near-black ink, oxblood accent.
   Privileged & Confidential — Property of Gray Media (NYSE: GTN) */

:root {
  /* Architectural palette — bright paper, near-black ink, one accent */
  --paper:        #FAFAF7;   /* near-white, monograph stock */
  --paper-2:      #F2F1ED;   /* surface slightly recessed */
  --paper-3:      #E8E6DF;   /* deeper recess for sidebar */
  --rule:         #D6D3CA;   /* hairline rules */
  --rule-soft:    #E4E1D8;
  --rule-strong:  #14110D;   /* full-strength architectural rules */

  --ink:          #14110D;   /* near-black, warm */
  --ink-2:        #2A251D;
  --ink-muted:    #6E6759;
  --ink-faint:    #A39B89;

  /* Single accent — deep oxblood. Used sparingly for emphasis. */
  --accent:       #6B2230;
  --accent-2:     #4D1822;
  --accent-tint:  #F4E6E9;

  /* Status — desaturated, architectural */
  --status-live:    #6B2230;
  --status-draft:   #8C6A1F;
  --status-blocked: #7D3A1A;
  --status-clear:   #4A6536;

  /* Layout */
  --rail-w: 280px;
  --max-prose: 68ch;
  --max-display: 78rem;

  /* Type families */
  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-italic: 'Instrument Serif', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}

/* Texture removed — pure paper for the brighter architectural pass */

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 0.5px;
  text-decoration-color: rgba(107, 34, 48, 0.4);
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
}

.skip {
  position: absolute; left: -9999px;
}
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 1000; }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---------- Left rail navigation ---------- */
.rail-nav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 36px 28px 48px;
  background: var(--paper-3);
  border-right: 1px solid var(--rule);
  font-size: 13.5px;
  line-height: 1.5;
}

.rail-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.rail-brand:hover { color: var(--accent); }
.rail-mark {
  font-family: var(--font-display);
  font-size: 30px;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}
.rail-text { display: flex; flex-direction: column; gap: 2px; }
.rail-text-line2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.rail-text-line1 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.rail-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin: 0 0 4px;
}
.rail-version {
  font-size: 11px;
  color: var(--ink-faint);
  margin: 0 0 28px;
  font-feature-settings: 'tnum' 1;
}

.rail-group { margin-bottom: 26px; }
.rail-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-soft);
}
.rail-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-link {
  display: block;
  padding: 6px 10px;
  margin: 0 -10px;
  text-decoration: none;
  color: var(--ink-2);
  border-radius: 2px;
  font-size: 13.5px;
  line-height: 1.4;
  transition: background 0.12s, color 0.12s;
}
.rail-link:hover {
  background: rgba(107, 34, 48, 0.06);
  color: var(--accent);
}
.rail-link.active {
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
}

.rail-toggle {
  display: none;
}

/* ---------- Main content ---------- */
.content {
  padding: 0;
  max-width: 100%;
  position: relative;
}

/* ============================================
   ARCHITECTURAL CHAPTER OPENERS
   ============================================ */

.page {
  max-width: var(--max-display);
  margin: 0 auto;
  padding: 0;
}

.page-header {
  /* This is the architectural moment — chapter page */
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 80px 80px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.page-header::before {
  content: "";
  position: absolute;
  top: 100px;
  left: 80px;
  width: 80px;
  height: 1px;
  background: var(--accent);
}

.page-header .eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 24px;
  padding-top: 24px;
  font-feature-settings: 'tnum' 1;
}

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 32px;
  max-width: 22ch;
}

/* When the page-header has a subtitle/lede */
.page-header .page-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink-muted);
  max-width: 50ch;
  margin: 0;
}

/* ============================================
   PROSE — body content
   ============================================ */

.prose {
  padding: 80px 80px 120px;
  max-width: calc(var(--max-prose) + 160px);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}

/* Suppress duplicate H3 that appears at top of prose (the markdown rebuilds the section title) */
.prose > h3:first-child { display: none; }

.prose h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 80px 0 24px;
  max-width: 28ch;
}
.prose h2:first-child { margin-top: 0; }

.prose h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 64px 0 18px;
  max-width: 32ch;
}

.prose h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 48px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-soft);
  letter-spacing: 0.08em;
}

.prose h5, .prose h6 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  margin: 32px 0 8px;
  color: var(--ink);
}

.prose p {
  margin: 0 0 1.2em;
  max-width: var(--max-prose);
}

/* Editorial moment — drop cap on the first paragraph of any section after the page-header */
.prose > p:first-of-type::first-letter,
.prose > h2:first-child + p::first-letter,
.prose > h3:first-child + p::first-letter,
.prose > h3 + p::first-letter {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  font-size: 5.2em;
  line-height: 0.9;
  float: left;
  padding: 0.08em 0.12em 0 0;
  color: var(--accent);
  letter-spacing: -0.04em;
}

/* But not for paragraphs inside blockquotes */
.prose blockquote p::first-letter { all: unset; }

/* ============================================
   BLOCKQUOTES — editorial pull-quote treatment
   ============================================ */

.prose blockquote {
  margin: 40px 0;
  padding: 28px 0 28px 36px;
  border-left: 2px solid var(--accent);
  background: transparent;
  position: relative;
}

.prose blockquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  max-width: 56ch;
  margin: 0 0 0.8em;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose blockquote p strong {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
  margin-right: 8px;
}

.prose blockquote em {
  font-style: normal;
  color: var(--ink-muted);
}

/* ============================================
   LISTS
   ============================================ */

.prose ul, .prose ol {
  margin: 0 0 1.5em;
  padding-left: 1.2em;
  max-width: var(--max-prose);
}
.prose li {
  margin-bottom: 0.6em;
  padding-left: 0.4em;
}
.prose ul li::marker { color: var(--accent); }
.prose ol li::marker { color: var(--accent); font-feature-settings: 'tnum' 1; }

/* ============================================
   TABLES — architectural, no decorations
   ============================================ */

.table-wrap {
  margin: 32px 0 40px;
  overflow-x: auto;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.prose thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: bottom;
}

.prose tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
  color: var(--ink-2);
}

.prose tbody tr:last-child td { border-bottom: none; }

.prose tbody tr:hover td { background: rgba(107, 34, 48, 0.025); }

.prose td strong, .prose th strong {
  color: var(--ink);
  font-weight: 600;
}

/* ============================================
   CODE
   ============================================ */

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--rule-soft);
  color: var(--ink-2);
}

.prose pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ============================================
   STATUS CHIPS
   ============================================ */

.chip {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  vertical-align: 1px;
  white-space: nowrap;
}
.chip-locked    { background: var(--ink); color: var(--paper); }
.chip-draft     { background: var(--paper-2); color: var(--status-draft); border: 1px solid var(--status-draft); }
.chip-proposed  { background: var(--paper-2); color: var(--accent); border: 1px solid var(--accent); }
.chip-tbd       { background: var(--paper-2); color: var(--ink-muted); border: 1px solid var(--rule); }
.chip-flag      { background: var(--accent); color: var(--paper); }
.chip-confirm   { background: var(--paper-2); color: var(--status-blocked); border: 1px solid var(--status-blocked); }
.chip-confirmed { background: var(--status-clear); color: var(--paper); }
.chip-ask       { background: var(--accent-tint); color: var(--accent); }

/* ============================================
   PREV / NEXT
   ============================================ */

.prev-next {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 48px 80px 80px;
  border-top: 1px solid var(--rule);
  margin-top: 40px;
}
.prev-next a {
  flex: 1;
  text-decoration: none;
  padding: 24px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  transition: background 0.15s, border-color 0.15s;
  color: var(--ink);
}
.prev-next a:hover {
  background: var(--paper);
  border-color: var(--accent);
}
.prev-next .pn-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 6px;
}
.prev-next .pn-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}
.prev-next .pn-next { text-align: right; }

/* ============================================
   INDEX (LANDING) PAGE
   ============================================ */

.index-page .hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 80px 60px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.index-page .hero::before {
  content: "";
  position: absolute;
  top: 100px;
  left: 80px;
  width: 80px;
  height: 1px;
  background: var(--accent);
}

.index-page .eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 24px;
  margin: 0 0 32px;
}

.index-page h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(64px, 9vw, 132px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 28px;
  max-width: 14ch;
}

.hero-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 26px;
  line-height: 1.35;
  color: var(--ink-muted);
  max-width: 38ch;
  margin: 0 0 36px;
  letter-spacing: -0.005em;
}

.index-page .lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0 0 48px;
}

.version-strip {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 56px;
  margin: 32px 0 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  max-width: max-content;
}
.version-cell { display: flex; flex-direction: column; gap: 4px; }
.cell-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.cell-value {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  font-feature-settings: 'tnum' 1;
}
.cell-value.status-live { color: var(--accent); font-style: italic; font-family: var(--font-display); font-size: 22px; font-weight: 400; }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 0;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

.reading-orders {
  padding: 80px 80px 60px;
  border-bottom: 1px solid var(--rule);
}
.reading-orders h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 40px;
}
.ro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.ro-card {
  padding: 28px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
}
.ro-time {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  color: var(--accent);
  margin: 0 0 4px;
}
.ro-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 16px;
}
.ro-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}
.ro-list li { padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.ro-list li:last-child { border-bottom: none; }
.ro-list a { color: var(--ink); text-decoration: none; }
.ro-list a:hover { color: var(--accent); }
.ro-body { font-size: 14px; color: var(--ink-2); margin: 0 0 16px; }
.ro-link { font-size: 14px; color: var(--accent); }

.toc-section { padding: 80px; border-bottom: 1px solid var(--rule); }
.toc-section h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 12px;
}
.toc-lede { font-size: 16px; color: var(--ink-muted); margin: 0 0 40px; max-width: 56ch; }

.toc-group { margin-bottom: 40px; }
.toc-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.toc-list a {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  text-decoration: none;
  color: var(--ink);
  align-items: baseline;
}
.toc-list a:hover { color: var(--accent); }
.toc-num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-size: 17px;
  flex-shrink: 0;
  min-width: 60px;
}
.toc-title {
  font-size: 16px;
  flex: 1;
}

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

.site-footer {
  padding: 48px 80px;
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--paper-3);
  border-top: 1px solid var(--rule);
}
.site-footer p { margin: 0 0 6px; }

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

@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .rail-nav {
    position: fixed;
    top: 0; left: 0;
    width: 320px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s;
  }
  body.rail-open .rail-nav { transform: translateX(0); }
  .rail-toggle {
    display: block;
    position: fixed;
    top: 16px; right: 16px;
    z-index: 101;
    background: var(--ink);
    color: var(--paper);
    border: none;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 2px;
    cursor: pointer;
  }
  .page-header,
  .index-page .hero,
  .reading-orders,
  .toc-section,
  .prose,
  .prev-next,
  .site-footer { padding-left: 32px; padding-right: 32px; }
  .page-header::before,
  .index-page .hero::before { left: 32px; }
  .ro-grid { grid-template-columns: 1fr; }
  .version-strip { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .prose { font-size: 16px; padding-left: 24px; padding-right: 24px; }
  .page-header { padding-left: 24px; padding-right: 24px; min-height: 50vh; }
  .page-header::before { left: 24px; }
  .index-page .hero { padding-left: 24px; padding-right: 24px; }
  .index-page .hero::before { left: 24px; }
  .prose blockquote { padding-left: 20px; }
  .prose blockquote p { font-size: 18px; }
  .prose > p:first-of-type::first-letter { font-size: 4em; }
}

/* Print */
@media print {
  .rail-nav, .rail-toggle, .prev-next, .site-footer { display: none; }
  .layout { grid-template-columns: 1fr; }
  body { background: white; color: black; }
  .page-header { min-height: auto; padding: 40px; }
  .prose { padding: 40px; }
}

/* ============================================================
   Diagrams — architectural figures
   ============================================================ */
.diagram {
  margin: 3rem 0 2.5rem;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--rule-strong);
}
.diagram-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 1.25rem;
  font-weight: 600;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: var(--paper);
}
.diagram-caption {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 60ch;
}

/* KPI tiles */
.diagram-kpi .kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
@media (max-width: 760px) {
  .diagram-kpi .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
.kpi-tile {
  padding: 1.5rem 1.25rem;
  border-right: 1px solid var(--rule);
}
.kpi-tile:last-child { border-right: 0; }
@media (max-width: 760px) {
  .kpi-tile:nth-child(2n) { border-right: 0; }
  .kpi-tile:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 3.25rem;
  line-height: 1;
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.kpi-unit {
  font-size: 1.5rem;
  color: var(--ink-muted);
  margin-left: 0.15em;
}
.kpi-label {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 0.4rem;
  font-weight: 600;
}
.kpi-note {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.4;
}
