/* ═══════════════════════════════════════════════════════════════════
   Bowie History Atlas — Shared Stylesheet
   Developed by Claude AI (Anthropic) · Conceived by Kevin Fine · 2026
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,400&display=swap');

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Color tokens ─── */
:root {
  --gold:          #b8860b;
  --gold-dark:     #8a6408;
  --gold-light:    #f8f0e0;
  --gold-border:   #dfc990;
  --navy:          #1a3a6b;
  --blue:          #1655a0;
  --blue-light:    #eaf0f8;
  --blue-border:   #b0c8e4;
  --red:           #c0101e;
  --text:          #1a1818;
  --text-sec:      #52504c;
  --text-muted:    #8a837c;
  --border:        #e0dbd4;
  --border-strong: #c4bdb4;
  --bg:            #fafaf8;
  --bg-sec:        #f3f0eb;
  --bg-ter:        #ebe7e0;
  --white:         #ffffff;
}

/* ─── Base ─── */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--blue); }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; }

/* ─── Utilities ─── */
.page-container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.sans { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.section-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ══════════════════════════════════════════════════════════════
   SITE HEADER
   ══════════════════════════════════════════════════════════════ */
.site-header {
  display: grid;
  grid-template-columns: auto 1fr;
  border-bottom: 3px solid var(--gold);
  background: var(--white);
}

.flag-panel {
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.flag-panel img {
  width: auto;
  height: 100%;
  display: block;
}

.header-content {
  padding: 18px 28px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.header-text .site-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.header-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 3px;
}

.header-text .site-subtitle {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: var(--text-sec);
}

.header-map { flex-shrink: 0; }
.header-map svg { display: block; }
.header-map figcaption {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 3px;
}

/* ══════════════════════════════════════════════════════════════
   AUTHOR BIO STRIP
   ══════════════════════════════════════════════════════════════ */
.author-bio {
  background: var(--bg-sec);
  border-bottom: 1px solid var(--border);
  padding: 13px 0;
}

.author-bio p {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-sec);
  max-width: 900px;
}

/* ══════════════════════════════════════════════════════════════
   CHAPTER NAVIGATION BAR
   ══════════════════════════════════════════════════════════════ */
.chapter-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow-x: auto;
}

.chapter-nav ul {
  list-style: none;
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px;
}

.chapter-nav ul li a {
  display: block;
  padding: 9px 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-sec);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.12s;
}

.chapter-nav ul li a:hover { color: var(--text); text-decoration: none; }
.chapter-nav ul li.nav-home a { color: var(--gold-dark); font-weight: 600; }
.chapter-nav ul li.nav-home a:hover { color: var(--gold); }
.chapter-nav ul li.nav-active a {
  color: var(--text);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   HOMEPAGE
   ══════════════════════════════════════════════════════════════ */
.home-section { padding: 24px 0; }
.home-section + .home-section { padding-top: 0; }

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.chapter-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  padding: 13px 15px;
  text-decoration: none;
  display: block;
  transition: background 0.12s, border-left-color 0.12s;
}
.chapter-card:hover { background: var(--gold-light); border-left-color: var(--gold-dark); text-decoration: none; }
.chapter-card .card-date {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.chapter-card .card-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.chapter-card .card-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: var(--text-sec);
  line-height: 1.4;
}

.viz-section-wrap {
  background: var(--bg-sec);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 22px 0 20px;
  margin-bottom: 0;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.viz-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-left: 3px solid var(--blue);
  border-radius: 0 6px 6px 0;
  padding: 10px 13px;
  text-decoration: none;
  display: block;
  transition: background 0.12s;
}
.viz-card:hover { background: var(--blue-light); text-decoration: none; }
.viz-card .viz-category {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}
.viz-card .viz-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.viz-note {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════
   CHAPTER PAGE HEADER
   ══════════════════════════════════════════════════════════════ */
.chapter-header {
  background: var(--white);
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--border);
}

.chapter-header .ch-eyebrow {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.chapter-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 8px;
}

.chapter-header .ch-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.55;
  max-width: 700px;
}

/* ══════════════════════════════════════════════════════════════
   CHAPTER TWO-COLUMN LAYOUT
   ══════════════════════════════════════════════════════════════ */
.chapter-layout {
  display: grid;
  grid-template-columns: 185px 1fr;
  align-items: start;
}

/* ── Sidebar ── */
.chapter-sidebar {
  background: var(--bg-sec);
  border-right: 1px solid var(--border);
  padding: 20px 10px 32px;
  position: sticky;
  top: 40px;
  min-height: calc(100vh - 40px);
}

.sidebar-heading {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 8px;
}

.sidebar-link {
  display: block;
  padding: 6px 8px 6px 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-sec);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  margin-bottom: 1px;
  line-height: 1.4;
  transition: background 0.1s, color 0.1s;
}
.sidebar-link:hover { background: var(--bg-ter); color: var(--text); text-decoration: none; }
.sidebar-link.active {
  background: var(--white);
  color: var(--text);
  border-left-color: var(--gold);
  font-weight: 600;
}

/* ── Main reading pane ── */
.chapter-main {
  background: var(--white);
  padding: 32px 40px 48px;
  min-width: 0;
}

/* ══════════════════════════════════════════════════════════════
   CONTENT SECTIONS (within chapter pages)
   ══════════════════════════════════════════════════════════════ */
.section-block {
  max-width: 680px;
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border);
}
.section-block:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.section-kicker {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.section-block h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 12px;
}

.section-block h4 {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin: 24px 0 8px;
}

.content-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
}

.tag {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--gold-light);
  color: #7a4f1e;
  border: 1px solid var(--gold-border);
}
.tag.blue {
  background: var(--blue-light);
  color: #1a3a6b;
  border-color: var(--blue-border);
}

.section-block p {
  margin-bottom: 1em;
  color: var(--text);
}
.section-block p:last-of-type { margin-bottom: 0; }

.section-block em { font-style: italic; }

.section-img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 18px 0 6px;
}

.img-caption {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.footnote {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.blockquote {
  border-left: 3px solid var(--gold);
  padding: 10px 18px;
  margin: 20px 0;
  background: var(--gold-light);
  border-radius: 0 4px 4px 0;
}
.blockquote p {
  font-style: italic;
  color: var(--text-sec);
  margin: 0 0 5px;
  font-size: 15px;
}
.blockquote cite {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  font-style: normal;
}

.source-links {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.8;
}
.source-links a { color: var(--blue); text-decoration: none; }
.source-links a:hover { text-decoration: underline; }

/* ── Timeline ── */
.timeline {
  border-left: 2px solid var(--gold-border);
  padding-left: 22px;
  margin: 22px 0;
}
.timeline-item {
  position: relative;
  margin-bottom: 22px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--gold);
}
.timeline-year {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1px;
  letter-spacing: 0.04em;
}
.timeline-event {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.3;
}
.timeline-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.5;
}
.timeline-desc a { color: var(--blue); font-size: 12px; }

/* ── Archive / newspaper images ── */
.archive-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
}
.archive-item h4 {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-style: italic;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.35;
}
.archive-item .archive-byline {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════════
   CHAPTER FOOTER (prev / next nav)
   ══════════════════════════════════════════════════════════════ */
.chapter-footer {
  background: var(--bg-sec);
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.chapter-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.chapter-footer a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-dark);
  text-decoration: none;
}
.chapter-footer a:hover { color: var(--gold); text-decoration: underline; }
.chapter-footer .footer-home {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.chapter-footer .footer-home a { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   SITE FOOTER
   ══════════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--bg-ter);
  border-top: 2px solid var(--gold);
  padding: 14px 0;
}
.site-footer p {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 840px) {
  .site-header { grid-template-columns: auto 1fr; }
  .header-text h1 { font-size: 24px; }
  .chapter-layout { grid-template-columns: 1fr; }
  .chapter-sidebar { position: static; min-height: unset; border-right: none; border-bottom: 1px solid var(--border); padding: 14px 16px; }
  .chapter-sidebar .sidebar-link { display: inline-block; margin-right: 4px; border-left: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 4px 8px; }
  .chapter-sidebar .sidebar-link.active { border-bottom-color: var(--gold); background: none; }
  .chapter-grid { grid-template-columns: 1fr 1fr; }
  .viz-grid { grid-template-columns: 1fr 1fr; }
  .chapter-main { padding: 22px 20px 36px; }
  .archive-pair { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .chapter-grid { grid-template-columns: 1fr; }
  .viz-grid { grid-template-columns: 1fr; }
  .header-content { gap: 12px; }
  .header-map { display: none; }
  .chapter-header h2 { font-size: 24px; }
  .section-block h3 { font-size: 19px; }
}
