/* ============================================================
   Urban Special Education: The Navigation of Tensions
   Shared stylesheet — phase one
   ============================================================ */

:root {
  /* Palette */
  --paper:        #F8F7F4;  /* warm off-white background */
  --paper-panel:  #F1EFE9;  /* slightly deeper panel fill */
  --ink:          #1E2A38;  /* deep slate — primary text */
  --ink-soft:     #46525F;  /* secondary text */
  --muted:        #54606C;  /* captions, held/placeholder notes (AA on paper) */
  --accent:       #2C5545;  /* deep pine green */
  --accent-deep:  #1E3E32;  /* hover / pressed */
  --rule:         #E2DED4;  /* hairline dividers, borders */

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Measure */
  --measure: 68ch;
  --page-max: 72rem;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
main { padding-block: clamp(2.5rem, 6vw, 5rem); }
section { margin-block-end: clamp(2.5rem, 6vw, 4.5rem); }
section:last-child { margin-block-end: 0; }

/* A single readable column for text-heavy content */
.measure { max-width: var(--measure); }

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.6em;
  font-optical-sizing: auto;
}
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 560; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin-top: 0; }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); }

p { margin: 0 0 1.1em; }
p.lead {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 400;
}
a { color: var(--accent); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-deep); }

.subtle { color: var(--muted); }
.held {
  color: var(--muted);
  font-style: italic;
  border-inline-start: 3px solid var(--rule);
  padding-inline-start: 1rem;
}

/* ---------- Header / Nav ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1rem;
}
.brand {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.98rem;
}
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 3.5rem); }
.hero .wrap { position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: 1.35fr 0.9fr; }
}
.hero h1 { margin-bottom: 0.25em; font-size: clamp(2.1rem, 5vw, 3.4rem); }
.hero .title-main { display: block; }
.hero .title-sub {
  display: block;   /* identical to the main title line */
}
.hero .lead { margin-top: 1.2rem; max-width: 44ch; }

/* Nested ecological rings figure */
.rings { width: 100%; max-width: 360px; margin-inline: auto; }
.rings circle { fill: none; stroke: var(--accent); }
.rings .ring-fill { fill: var(--accent); opacity: 0.06; stroke: none; }
.rings text {
  fill: var(--ink-soft);
  font-family: var(--sans);
  font-size: 11px;
}
.rings .core { fill: var(--accent); }

/* ---------- Email capture ---------- */
.capture {
  background: var(--paper-panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.capture h2 { margin-bottom: 0.3em; }
.capture .lead { margin-bottom: 1.2rem; font-size: 1.1rem; }
.ml-embedded { margin-top: 0.5rem; }

/* ---------- Table of contents ---------- */
.toc { list-style: none; margin: 0; padding: 0; }
.toc li {
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}
.toc li:last-child { border-bottom: none; }
.toc .num {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 0.95rem;
  min-width: 5.5rem;
  flex-shrink: 0;
}
.toc .chap-title { color: var(--ink); }

/* ---------- Authors ---------- */
.authors { margin-top: 1.75rem; }
.author { margin-block-end: 3rem; }
.author:last-child { margin-block-end: 0; }
.author h3 { margin-top: 0; margin-bottom: 0.3em; }
.author .role { color: var(--muted); font-size: 0.98rem; margin-bottom: 0.8em; }
.author-text { max-width: 60ch; }

/* Author portrait: squared, hairline rule — no card, no drop shadow */
.author-photo {
  width: 200px;
  max-width: 60%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 2px;
  margin: 0 0 1.25rem;
}

/* Side-by-side on wider screens; stacks below 40rem */
@media (min-width: 40rem) {
  /* Reserve the portrait column for every author so bios align;
     Larry's photo drops into the same slot when it's ready. */
  .author {
    display: grid;
    grid-template-columns: 200px minmax(0, 60ch);
    gap: 2rem;
    align-items: start;
  }
  .author .author-photo { margin: 0; grid-column: 1; grid-row: 1; }
  .author .author-text  { max-width: none; grid-column: 2; grid-row: 1; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: clamp(3rem, 8vw, 6rem);
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }
.site-footer a { color: var(--ink-soft); }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
.skip {
  position: absolute; left: -999px;
}
.skip:focus {
  left: 1rem; top: 0.5rem; background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.9rem; border-radius: 4px; z-index: 20;
}


/* ---------- Book page hero ---------- */
.book-hero { margin-block-end: clamp(2rem, 5vw, 3.5rem); }
.book-cover {
  width: 260px;
  max-width: 72%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(30, 42, 56, 0.14);
  margin: 0 0 1.5rem;
}
.book-hero-text { max-width: 54ch; }
.book-hero-text h1 { margin-top: 0; }

@media (min-width: 46rem) {
  .book-hero {
    display: grid;
    grid-template-columns: 260px minmax(0, 54ch);
    gap: clamp(2rem, 4vw, 3rem);
    align-items: start;
  }
  .book-cover { margin: 0; }
}

/* ---------- Launch announcement banner (home) ---------- */
.launch-banner {
  display: block;
  background: var(--accent);
  color: var(--paper);
  text-decoration: none;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.98rem;
  line-height: 1.4;
  padding: 0.7rem 1.25rem;
  transition: background 0.15s ease;
}
.launch-banner strong { font-weight: 600; }
.launch-banner:hover { background: var(--accent-deep); color: var(--paper); }
