/* ═══════════════════════════════════════════════════════════
   Moses in America's History — Shared Stylesheet
   Mid-century modern palette
   ═══════════════════════════════════════════════════════════ */

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  --cream:       #f2ede4;
  --cream-dk:    #e8e0d0;
  --charcoal:    #2b2b2b;
  --charcoal-lt: #3d3d3d;
  --mustard:     #d4a017;
  --mustard-lt:  #e8b830;
  --mustard-dim: rgba(212,160,23,0.15);
  --terracotta:  #c4502a;
  --terra-lt:    #d4623c;
  --sage:        #6b8f71;
  --sage-lt:     #7da385;
  --mid:         #8a7e6e;
  --white:       #ffffff;
  --border:      rgba(43,43,43,0.1);
  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;
}

body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── NAV ──────────────────────────────────────────────────── */
nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: #616161;
  box-shadow: 0 2px 0 rgba(0,0,0,0.18);
}
.nav-logo {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 2px; list-style: none; flex-wrap: wrap; }
.nav-links a {
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(242,237,228,0.58);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 2px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--mustard); background: rgba(212,160,23,0.1); }

/* ── PAGE HERO ────────────────────────────────────────────── */
.page-hero {
  background: var(--charcoal);
  padding: 130px 64px 60px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--mustard);
}
.page-hero-shape {
  position: absolute;
  right: -80px; top: -80px;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: var(--terracotta);
  opacity: 0.07;
  pointer-events: none;
}
.page-hero-eyebrow {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-hero-eyebrow span { display: block; width: 28px; height: 2px; background: var(--mustard); }
.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--cream);
  line-height: 1.05;
  max-width: 700px;
}
.page-hero h1 em { font-style: italic; font-weight: 400; color: var(--mustard); }
.page-hero-sub {
  font-size: 1rem;
  color: rgba(242,237,228,0.52);
  margin-top: 16px;
  max-width: 560px;
  line-height: 1.7;
}

/* ── LAYOUT ───────────────────────────────────────────────── */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 72px 48px; }

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
.label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 12px;
  display: block;
}
.label-m { color: var(--mustard); }
.label-s { color: var(--sage); }

.section-h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--charcoal);
  margin-bottom: 28px;
}
.section-h2 em { font-style: italic; font-weight: 400; color: var(--mid); }

.person-h2 {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--mustard);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.person-h2 .badge {
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--mustard);
  color: var(--charcoal);
  padding: 4px 10px;
}
.person-h2 .badge-t { background: var(--terracotta); color: var(--white); }
.person-h2 .badge-s { background: var(--sage); color: var(--white); }

.rule { width: 48px; height: 3px; background: var(--mustard); margin: 32px 0; }
.rule-t { background: var(--terracotta); }
.rule-s { background: var(--sage); }

/* ── PROSE ────────────────────────────────────────────────── */
.prose p {
  font-size: 0.95rem;
  color: #5a5045;
  line-height: 1.85;
  margin-bottom: 18px;
}
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--terracotta); }

/* ── BLOCKQUOTE ───────────────────────────────────────────── */
.bq {
  border-left: 4px solid var(--mustard);
  padding: 6px 0 6px 28px;
  margin: 32px 0;
}
.bq.t { border-color: var(--terracotta); }
.bq.s { border-color: var(--sage); }
.bq p {
  font-family: var(--serif);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-style: italic;
  color: var(--charcoal);
  line-height: 1.55;
  margin-bottom: 10px;
}
.bq cite {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  font-style: normal;
}
.bq cite strong { color: var(--mustard); }
.bq.t cite strong { color: var(--terracotta); }
.bq.s cite strong { color: var(--sage); }

/* ── CONTENT GRIDS ────────────────────────────────────────── */
.cg { display: grid; gap: 52px; align-items: start; margin-bottom: 60px; }
.cg-il { grid-template-columns: 300px 1fr; }
.cg-ir { grid-template-columns: 1fr 300px; }
.cg-il-lg { grid-template-columns: 380px 1fr; }
.cg-ir-lg { grid-template-columns: 1fr 380px; }

/* ── IMAGE FRAME ──────────────────────────────────────────── */
.if { position: relative; display: inline-block; width: 100%; }
.if img { width: 100%; display: block; filter: saturate(0.75) brightness(0.9); }
.if::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--mustard);
  transform: translate(8px, 8px);
  pointer-events: none;
  z-index: -1;
}
.if.t::after { border-color: var(--terracotta); }
.if.s::after { border-color: var(--sage); }
.if-cap {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  color: var(--mid);
  margin-top: 14px;
  font-style: italic;
  line-height: 1.4;
}

/* Wide landscape image — full width, fixed height */
.img-wide {
  width: 100%;
  overflow: hidden;
  margin-bottom: 52px;
}
.img-wide img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center center;
  display: block;
  filter: saturate(0.75) brightness(0.88);
}
.img-wide.tall img { height: 420px; }
.img-wide-cap {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  color: var(--mid);
  margin-top: 10px;
  font-style: italic;
  padding: 0 2px;
}

/* Portrait image — constrain width so it doesn't stretch */
.img-portrait { max-width: 260px; }
.img-portrait img { width: 100%; display: block; filter: saturate(0.7) brightness(0.9); }

/* ── SUB-NAV (in-page anchor links) ──────────────────────── */
.sub-nav {
  background: var(--cream-dk);
  border-left: 4px solid var(--mustard);
  padding: 18px 24px;
  margin-bottom: 52px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}
.sub-nav-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  flex-shrink: 0;
}
.sub-nav a {
  font-size: 0.78rem;
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--mustard);
  padding-bottom: 1px;
  transition: color 0.2s;
}
.sub-nav a:hover { color: var(--mustard); }

/* ── TICKER ───────────────────────────────────────────────── */
.ticker {
  background: var(--mustard);
  overflow: hidden;
  padding: 11px 0;
  white-space: nowrap;
}
.ticker-track { display: inline-flex; animation: ticker 30s linear infinite; }
.ticker-item {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--charcoal);
  padding: 0 36px;
}
.ticker-sep { color: var(--charcoal); opacity: 0.35; }
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── COLOUR BLOCKS ────────────────────────────────────────── */
.color-blocks { display: grid; grid-template-columns: repeat(4, 1fr); }
.cb { padding: 40px 32px 32px; position: relative; overflow: hidden; }
.cb::after {
  content: '';
  position: absolute;
  bottom: -28px; right: -28px;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.cb-1 { background: var(--mustard); }
.cb-2 { background: var(--terracotta); }
.cb-3 { background: var(--sage); }
.cb-4 { background: var(--charcoal); }
.cb-num {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  line-height: 1;
  margin-bottom: 8px;
}
.cb-1 .cb-num, .cb-2 .cb-num { color: rgba(43,43,43,0.88); }
.cb-label { font-size: 0.72rem; color: rgba(255,255,255,0.72); line-height: 1.5; }
.cb-1 .cb-label, .cb-2 .cb-label { color: rgba(43,43,43,0.62); }

/* ── REFERENCE LIST ───────────────────────────────────────── */
.ref-list { list-style: none; padding: 0; }
.ref-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
  color: #5a5045;
  line-height: 1.55;
}
.ref-list li:last-child { border-bottom: none; }
.ref-author { font-weight: 600; color: var(--charcoal); }
.ref-title  { font-style: italic; }
.ref-list a { color: var(--terracotta); text-decoration: none; }
.ref-list a:hover { text-decoration: underline; }

/* ── EXT LINKS ────────────────────────────────────────────── */
.ext-links { list-style: none; padding: 0; }
.ext-links li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.ext-links a {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--terracotta);
  text-decoration: none;
  transition: color 0.2s;
}
.ext-links a:hover { color: var(--mustard); }
.ext-desc { font-size: 0.8rem; color: var(--mid); margin-top: 3px; }

/* ── FOOTER ───────────────────────────────────────────────── */
footer.site-footer {
  background: var(--charcoal-lt);
  padding: 56px 48px 28px;
}
.footer-top {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 60px;
  padding-bottom: 36px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(242,237,228,0.1);
  align-items: start;
}
.footer-bar { width: 36px; height: 3px; background: var(--mustard); margin-bottom: 14px; }
.footer-brand { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; color: var(--cream); margin-bottom: 8px; }
.footer-tagline { font-size: 0.8rem; color: var(--mid); line-height: 1.6; }
.footer-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 16px; }
.footer-links a { font-size: 0.72rem; color: var(--mid); text-decoration: none; padding: 3px 0; transition: color 0.2s; }
.footer-links a:hover { color: var(--mustard); }
.footer-bottom { display: flex; justify-content: space-between; font-size: 0.7rem; color: rgba(138,126,110,0.52); }
.footer-bottom a { color: inherit; text-decoration: none; }
.footer-bottom a:hover { color: var(--mustard); }

/* ── SCROLL REVEAL ────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.3s; }
.d4 { transition-delay: 0.4s; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 960px) {
  nav.site-nav { padding: 0 20px; }
  .nav-links { display: none; }
  .page-hero { padding: 90px 28px 48px; }
  .page-wrap { padding: 48px 24px; }
  .cg-il, .cg-ir, .cg-il-lg, .cg-ir-lg { grid-template-columns: 1fr; gap: 32px; }
  .color-blocks { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .img-wide img { height: 220px; }
}
@media (max-width: 600px) {
  .color-blocks { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr; }
}
