/* =============================================================
   Nathan v. Alamo Heights ISD — Case site
   Shared stylesheet
   ============================================================= */

:root {
  --navy: #0f2748;
  --navy-deep: #081a35;
  --navy-light: #1a3668;
  --gold: #c9a24f;
  --gold-bright: #d4b36b;
  --gold-pale: #f3e9cc;
  --cream: #faf6ec;
  --cream-dark: #f3ecd8;
  --paper: #fefcf7;
  --blue-pale: #e3eaf5;
  --crimson: #9b2f2f;
  --crimson-pale: #f5e3e3;
  --ink: #1a2332;
  --ink-soft: #3b4658;
  --muted: #6b7280;
  --rule: #dfd5b7;
  --shadow-sm: 0 2px 8px rgba(15, 39, 72, 0.06);
  --shadow-md: 0 6px 24px rgba(15, 39, 72, 0.10);
  --shadow-lg: 0 20px 50px rgba(15, 39, 72, 0.15);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 { font-size: 2.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold); }

blockquote {
  border-left: 4px solid var(--gold);
  margin: 1.5em 0;
  padding: 0.5em 1.2em;
  background: var(--paper);
  color: var(--ink-soft);
  font-style: italic;
  border-radius: 0 4px 4px 0;
}

code, pre { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.9em; }

hr { border: none; border-top: 1px solid var(--rule); margin: 2.5em 0; }

ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.4em; }

/* =============================================================
   Top banner and navigation
   ============================================================= */

.site-banner {
  background: var(--navy);
  color: var(--cream);
  padding: 0.6em 0;
  font-size: 0.88rem;
  text-align: center;
  border-bottom: 2px solid var(--gold);
}
.site-banner strong { color: var(--gold-bright); }

.site-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-nav .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7em 1.5em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5em;
  flex-wrap: wrap;
}
.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 0.65em;
  text-decoration: none;
  color: var(--navy);
}
.site-nav .brand .seal {
  width: 38px; height: 38px;
  background: var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.site-nav .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.site-nav .brand-main { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.05rem; color: var(--navy); }
.site-nav .brand-sub { font-size: 0.75rem; color: var(--muted); }
.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 1.4em;
  flex-wrap: wrap;
}
.site-nav a.nav-link {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding: 0.3em 0;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}
.site-nav a.nav-link:hover { color: var(--navy); border-bottom-color: var(--gold); }
.site-nav a.nav-link.active { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }

/* =============================================================
   Layout containers
   ============================================================= */

.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--cream);
  padding: 5em 1.5em 4em;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(201, 162, 79, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero .wrap { max-width: var(--maxw); margin: 0 auto; position: relative; z-index: 1; }
.hero .eyebrow {
  display: inline-block;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1em;
}
.hero h1 { color: var(--cream); font-size: clamp(2.2rem, 4.5vw, 3.8rem); margin-bottom: 0.4em; }
.hero .subtitle { color: var(--gold-bright); font-size: 1.3rem; font-style: italic; margin-bottom: 1.5em; font-family: 'Playfair Display', serif; }
.hero .lede { font-size: 1.15rem; max-width: 780px; color: rgba(250, 246, 236, 0.9); line-height: 1.7; }

.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3em 1.5em;
}

.main.narrow { max-width: 820px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 1.6rem;
  margin: 2.2em 0 1em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--gold);
}
.section-title .num {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--navy);
  color: var(--gold);
  border-radius: 50%;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2em;
  margin: 1.5em 0;
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.4em;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card h3 { margin-top: 0; color: var(--navy); font-size: 1.15rem; }
.card.navy { background: var(--navy); color: var(--cream); border-color: var(--navy-deep); }
.card.navy h3 { color: var(--gold-bright); }
.card.gold { background: var(--gold-pale); border-color: var(--gold); }

/* Link-style cards */
.link-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 1.3em 1.4em;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.link-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--navy);
  color: var(--ink);
}
.link-card .kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.5em;
}
.link-card h3 { margin: 0 0 0.4em; color: var(--navy); }
.link-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
.link-card .arrow { color: var(--gold); font-size: 1.2rem; float: right; transition: transform 0.2s; }
.link-card:hover .arrow { transform: translateX(4px); }

/* =============================================================
   Infographic-style panels
   ============================================================= */

.info-panel {
  background: var(--paper);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin: 2em 0;
  border: 1px solid var(--rule);
}

.info-header {
  background: var(--navy);
  color: var(--cream);
  padding: 1.5em 1.8em;
  border-bottom: 3px solid var(--gold);
  position: relative;
}
.info-header .title-row { display: flex; align-items: center; gap: 0.8em; }
.info-header .title-row .seal {
  width: 42px; height: 42px;
  background: var(--gold);
  color: var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.info-header h2 { color: var(--cream); margin: 0; font-size: 1.7rem; }
.info-header .subtitle { color: var(--gold-bright); font-style: italic; font-size: 1rem; margin-top: 0.3em; font-family: 'Playfair Display', serif; }
.info-header .ribbon {
  position: absolute;
  top: 0; right: 1.5em;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.5em 1em 1em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
  text-align: center;
  line-height: 1.3;
}

.info-body { padding: 1.8em; display: grid; gap: 1.2em; }
.info-body.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.info-block {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.2em 1.3em;
  position: relative;
}
.info-block.navy { background: var(--navy); color: var(--cream); border-color: var(--navy-deep); }
.info-block.gold { background: var(--gold-pale); border-color: var(--gold); }
.info-block.cream { background: var(--cream-dark); border-color: var(--rule); }
.info-block .block-header {
  display: flex; align-items: center; gap: 0.6em;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 0.5em;
  margin-bottom: 0.7em;
  border-bottom: 1px solid var(--rule);
}
.info-block.navy .block-header { color: var(--gold-bright); border-bottom-color: var(--navy-light); }
.info-block .block-header .icon {
  width: 30px; height: 30px;
  background: var(--navy);
  color: var(--gold);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.info-block.navy .block-header .icon { background: var(--gold); color: var(--navy); }
.info-block .block-header .num-badge {
  background: var(--navy);
  color: var(--gold);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 0.2em;
  flex-shrink: 0;
}
.info-block ul { padding-left: 1.2em; margin: 0.5em 0; }
.info-block li { font-size: 0.95rem; margin-bottom: 0.4em; }

.stat-big {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 4rem;
  color: var(--gold);
  line-height: 1;
  text-align: center;
  margin: 0.2em 0;
}
.stat-label {
  text-align: center;
  color: var(--cream);
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.info-footer {
  background: var(--navy-deep);
  color: var(--cream);
  padding: 0.9em 1.8em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}
.info-footer .series { color: var(--gold-bright); font-family: 'Playfair Display', serif; font-style: italic; }
.info-footer .pageno { color: var(--gold); font-weight: 700; letter-spacing: 0.1em; }

/* Six-hallmark grid */
.hallmarks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8em;
  margin: 1em 0;
}
.hallmarks .hallmark {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1em 0.8em;
  text-align: center;
  border-radius: 6px;
  position: relative;
}
.hallmarks .hallmark .num {
  position: absolute;
  top: 0.5em; left: 0.5em;
  background: var(--gold);
  color: var(--navy);
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.hallmarks .hallmark .icon {
  width: 42px; height: 42px;
  margin: 0.3em auto 0.5em;
  background: var(--navy);
  color: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.hallmarks .hallmark .label { font-size: 0.85rem; color: var(--ink); line-height: 1.3; }

/* Timeline */
.timeline { position: relative; padding: 1em 0; }
.timeline::before {
  content: '';
  position: absolute;
  left: 22px; top: 0; bottom: 0;
  width: 2px;
  background: var(--gold);
}
.timeline-step {
  display: flex; align-items: flex-start; gap: 1em;
  margin-bottom: 1.4em;
  position: relative;
}
.timeline-step .marker {
  background: var(--navy);
  color: var(--gold);
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
  position: relative; z-index: 1;
  border: 3px solid var(--cream);
}
.timeline-step .content {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.85em 1.1em;
  border-radius: 6px;
  flex: 1;
  font-size: 0.95rem;
}
.timeline-step .content .date { font-weight: 700; color: var(--gold); }

/* Quote boxes */
.quote-card {
  background: var(--paper);
  border-left: 4px solid var(--gold);
  padding: 1em 1.3em;
  margin: 1em 0;
  border-radius: 0 4px 4px 0;
  box-shadow: var(--shadow-sm);
}
.quote-card .source { color: var(--navy); font-weight: 700; font-size: 0.9rem; margin-bottom: 0.4em; }
.quote-card .text { font-style: italic; color: var(--ink-soft); }

/* Vote badge */
.vote-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2em;
  background: var(--navy);
  color: var(--gold-bright);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  padding: 0.4em 0.9em;
  border-radius: 6px;
  font-size: 1.4rem;
}

/* =============================================================
   Precedent cards
   ============================================================= */

.precedent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2em;
}
.precedent-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--gold);
  border-radius: 6px;
  padding: 1.3em;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  transition: all 0.2s ease;
  position: relative;
}
.precedent-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-top-color: var(--navy);
}
.precedent-card.status-alive { border-top-color: #2e7d4f; }
.precedent-card.status-abrogated { border-top-color: var(--crimson); }
.precedent-card.status-pivotal { border-top-color: var(--gold); }
.precedent-card .status-pill {
  position: absolute;
  top: 1em; right: 1em;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2em 0.6em;
  border-radius: 20px;
}
.precedent-card.status-alive .status-pill { background: #e0f0e4; color: #2e7d4f; }
.precedent-card.status-abrogated .status-pill { background: var(--crimson-pale); color: var(--crimson); }
.precedent-card.status-pivotal .status-pill { background: var(--gold-pale); color: var(--navy); }
.precedent-card h3 { margin: 0; font-size: 1.1rem; color: var(--navy); padding-right: 6em; }
.precedent-card .cite { font-size: 0.85rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.precedent-card .holding { font-size: 0.95rem; color: var(--ink); margin-top: 0.3em; }
.precedent-card .nathan-role {
  margin-top: auto;
  padding-top: 0.8em;
  border-top: 1px dashed var(--rule);
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}
.precedent-card .nathan-role strong { color: var(--navy); font-style: normal; }

/* =============================================================
   Brief and essay typography
   ============================================================= */

.document-wrap {
  background: var(--paper);
  box-shadow: var(--shadow-md);
  border-radius: 8px;
  padding: 3em clamp(1.5em, 5vw, 4em);
  margin: 2em auto;
  max-width: 860px;
}
.document-wrap h1 { font-size: 2.3rem; margin-bottom: 0.3em; }
.document-wrap h2 {
  color: var(--navy);
  font-size: 1.55rem;
  margin-top: 2em;
  padding-bottom: 0.3em;
  border-bottom: 2px solid var(--gold);
}
.document-wrap h3 { font-size: 1.2rem; margin-top: 1.5em; color: var(--navy-light); }
.document-wrap h4 { font-size: 1.05rem; margin-top: 1.2em; color: var(--navy-light); text-transform: uppercase; letter-spacing: 0.06em; }
.document-wrap .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--rule);
}
.document-wrap .meta strong { color: var(--navy); }

.document-wrap table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-size: 0.9rem;
}
.document-wrap th, .document-wrap td {
  border: 1px solid var(--rule);
  padding: 0.5em 0.7em;
  text-align: left;
}
.document-wrap th { background: var(--navy); color: var(--cream); font-weight: 700; }
.document-wrap tbody tr:nth-child(even) { background: var(--cream-dark); }
.document-wrap td.check { text-align: center; font-weight: 700; color: var(--gold); }

/* =============================================================
   Chart containers
   ============================================================= */

.viz-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 2em;
  margin: 2em 0;
  box-shadow: var(--shadow-sm);
}
.viz-card h3 { margin-top: 0; color: var(--navy); }
.viz-card .subtitle { color: var(--muted); font-size: 0.95rem; margin-top: -0.5em; margin-bottom: 1em; }
.viz-container { position: relative; height: 360px; }
.viz-container.tall { height: 500px; }

.legend-note {
  margin-top: 1em;
  padding: 1em;
  background: var(--cream-dark);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Judge matrix */
.judge-matrix {
  overflow-x: auto;
  margin: 1.5em 0;
}
.judge-matrix table {
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 720px;
  width: 100%;
}
.judge-matrix th, .judge-matrix td {
  border: 1px solid var(--rule);
  padding: 0.35em 0.5em;
  text-align: center;
}
.judge-matrix th { background: var(--navy); color: var(--cream); font-size: 0.75rem; }
.judge-matrix th:first-child, .judge-matrix td:first-child { text-align: left; font-weight: 600; }
.judge-matrix td.vote-majority { background: #dfebd8; color: #2e7d4f; font-weight: 700; }
.judge-matrix td.vote-dissent { background: var(--crimson-pale); color: var(--crimson); font-weight: 700; }
.judge-matrix td.vote-author { background: var(--gold); color: var(--navy); font-weight: 700; }
.judge-matrix td.vote-partial { background: var(--gold-pale); color: var(--navy); font-weight: 600; }
.judge-matrix td.vote-none { color: #ccc; }

/* =============================================================
   PDF viewer
   ============================================================= */

.pdf-wrap {
  max-width: var(--maxw);
  margin: 2em auto;
  padding: 0 1.5em;
}
.pdf-frame {
  width: 100%;
  height: 85vh;
  min-height: 600px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  background: var(--paper);
}
.pdf-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1em;
  margin-bottom: 1em;
}
.pdf-tools a.btn {
  background: var(--navy);
  color: var(--cream);
  padding: 0.55em 1.2em;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
  display: inline-block;
}
.pdf-tools a.btn:hover { background: var(--gold); color: var(--navy); }

/* =============================================================
   Footer
   ============================================================= */

.site-footer {
  background: var(--navy-deep);
  color: rgba(250, 246, 236, 0.85);
  padding: 3em 1.5em 2em;
  margin-top: 4em;
  border-top: 3px solid var(--gold);
}
.site-footer .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2em;
}
.site-footer h4 { color: var(--gold-bright); margin: 0 0 0.6em; font-family: 'Playfair Display', serif; font-size: 1.05rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4em; }
.site-footer a { color: rgba(250, 246, 236, 0.85); text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: var(--gold-bright); }
.site-footer .disclaimer {
  grid-column: 1 / -1;
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid rgba(250, 246, 236, 0.15);
  font-size: 0.82rem;
  color: rgba(250, 246, 236, 0.65);
  text-align: center;
}

/* =============================================================
   Small responsive tweaks
   ============================================================= */
@media (max-width: 720px) {
  .hero { padding: 3em 1.2em 2.5em; }
  h1 { font-size: 2rem; }
  .section-title { font-size: 1.3rem; }
  .info-header h2 { font-size: 1.3rem; }
  .info-header .ribbon { font-size: 0.65rem; padding: 0.4em 0.7em 0.9em; }
  .document-wrap { padding: 1.8em 1.3em; }
  .stat-big { font-size: 3rem; }
}

/* Skip to content (accessibility) */
.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--navy);
  color: var(--gold-bright);
  padding: 0.5em 1em;
  z-index: 999;
  text-decoration: none;
}
.skip-link:focus { top: 0; }
