/* Historia Vault
   Design carried over exactly from the existing site: global.css, index.astro,
   BlogPost.astro and blog/index.astro. Georgia serif, warm ivory, navy text,
   muted gold labels, thin rules, Arial for metadata. Do not restyle. */

:root {
  --accent: #8b6f3d;
  --accent-dark: #6f562d;
  --black: 20, 33, 50;
  --gray: 90, 98, 110;
  --gray-dark: 45, 52, 64;
  --page-bg: #f8f5ef;
  --surface: #fcfaf6;
  --footer-bg: #f3efe7;
  --line: rgba(20, 33, 50, 0.12);
  --rule-2: rgba(20, 33, 50, 0.14);
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--page-bg); }

body {
  margin: 0;
  padding: 0;
  text-align: left;
  background: var(--page-bg);
  color: rgb(var(--gray-dark));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.75;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.75rem 0;
  color: rgb(var(--black));
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.2rem 0; max-width: 38em; }

a { color: #233046; text-decoration-thickness: 1px; text-underline-offset: 0.14em; }
a:hover { color: var(--accent-dark); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

strong, b { font-weight: 700; }

blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--accent);
  font-size: 1.15em;
}

hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }
img { max-width: 100%; height: auto; }

table { width: 100%; border-collapse: collapse; margin: 2rem 0; }
th, td { text-align: left; padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------- header */
header.site {
  margin: 0;
  padding: 0 1.25em;
  background: white;
  box-shadow: 0 2px 8px rgba(var(--black), 0.05);
}

header.site nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
}

header.site h2 { margin: 0; font-size: 1.1em; letter-spacing: 0.02em; }
header.site h2 a { text-decoration: none; color: rgb(var(--black)); padding: 1em 0; display: inline-block; }

header.site nav a {
  padding: 1em 0.65em;
  color: rgb(var(--black));
  border-bottom: 4px solid transparent;
  text-decoration: none;
}

header.site .internal-links { display: flex; align-items: center; gap: 0.25rem; }
header.site nav a.active { font-weight: bolder; border-bottom-color: var(--accent); }

@media (max-width: 720px) {
  header.site nav { flex-direction: column; align-items: flex-start; }
  header.site .internal-links { width: 100%; flex-wrap: wrap; gap: 0; }
  header.site h2 a { padding-bottom: 0.35em; }
}

/* ---------------------------------------------------------------- shared */
.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--sans);
}

.meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #8a8f98;
  font-family: var(--sans);
}

/* ---------------------------------------------------------------- home */
.home { width: min(1100px, calc(100% - 3rem)); margin: 0 auto; padding: 2.5rem 0 5rem; }

.hero { padding: 0 0 2.25rem; border-bottom: 1px solid var(--line); }

.hero h1 {
  margin: 0;
  max-width: 13ch;
  /* the vh term keeps the whole hero inside one screen on short windows */
  font-size: clamp(2.1rem, min(5.4vw, 8vh), 4.4rem);
  line-height: 1.02;
  font-weight: 600;
  color: #162334;
}

.subhead {
  margin-top: 1.15rem;
  max-width: 38em;
  font-size: 1.08rem;
  line-height: 1.85;
  color: #4b5563;
  font-family: var(--sans);
}

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; padding-top: 3rem; }
.pillar { padding-top: 0.5rem; border-top: 2px solid var(--rule-2); }
.pillar h2 { margin: 0 0 0.9rem; font-size: 1.45rem; line-height: 1.2; color: #162334; }
.pillar h2 a { color: inherit; text-decoration: none; }
.pillar h2 a:hover { color: var(--accent); }
.pillar p { margin: 0; max-width: none; font-size: 0.98rem; line-height: 1.8; color: #5b6470; font-family: var(--sans); }

.recent { margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.8rem); color: #162334; }
.recent-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2rem; }
.recent-item { padding-top: 0.5rem; border-top: 2px solid var(--rule-2); }
.recent-item h3 { margin: 0; font-size: 1.3rem; line-height: 1.35; }
.recent-item h3 a { color: #162334; text-decoration: none; }
.recent-item h3 a:hover { color: var(--accent); }
.recent-item p.blurb { margin: 0.5rem 0 0; font-size: 0.95rem; line-height: 1.7; color: #5b6470; font-family: var(--sans); max-width: none; }

@media (max-width: 900px) {
  .pillars, .recent-list { grid-template-columns: 1fr; gap: 2.25rem; }
}

@media (max-width: 720px) {
  .home { width: min(100% - 2rem, 1100px); padding: 3rem 0 3.5rem; }
  .hero h1 { font-size: clamp(2.4rem, 12vw, 4rem); }
}

/* ---------------------------------------------------------------- archive */
.essay-index { width: min(860px, calc(100% - 3rem)); margin: 0 auto; padding: 4rem 0 5rem; }
.intro { padding-bottom: 2rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.intro h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.05; color: #162334; }
.dek { margin-top: 1rem; max-width: 34em; font-size: 1.05rem; line-height: 1.8; color: #5b6470; font-family: var(--sans); }

.rail { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 1.5rem;
  font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.rail a { color: #5b6470; text-decoration: none; padding-bottom: 0.25rem; border-bottom: 1px solid transparent; }
.rail a:hover { color: var(--accent); }
.rail a.current { color: #162334; border-bottom-color: rgba(20, 33, 50, 0.35); }

.list { display: flex; flex-direction: column; gap: 1.75rem; }
.entry { padding-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.entry .meta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 0.4rem; }
.entry h2 { margin: 0; font-size: 1.6rem; line-height: 1.25; font-weight: 500; }
.entry h2 a { color: #162334; text-decoration: none; }
.entry h2 a:hover { color: var(--accent); }
.entry h2 .pending { color: #8a8f98; }
.entry .note { margin: 0.45rem 0 0; font-size: 0.92rem; line-height: 1.7; color: #8a8f98; font-family: var(--sans); max-width: 40em; }

.terms { display: flex; flex-direction: column; }
.term { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.term:first-child { border-top: 1px solid var(--line); }
.term .name { font-size: 1.35rem; line-height: 1.3; color: #162334; }
.term:hover .name { color: var(--accent); }
.term .count { font-family: var(--sans); font-size: 0.85rem; color: #8a8f98; white-space: nowrap; }

@media (max-width: 720px) {
  .essay-index { width: min(100% - 2rem, 860px); padding: 3rem 0 3.5rem; }
  .entry h2 { font-size: 1.35rem; }
  .term .name { font-size: 1.15rem; }
}

/* ---------------------------------------------------------------- essay */
.essay-page { width: min(1000px, calc(100% - 3rem)); margin: 0 auto; padding: 4rem 0 5rem; }
.essay-header { max-width: 760px; margin: 0 auto 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.essay-header h1 { margin: 0; font-size: clamp(2.7rem, 5vw, 4.5rem); line-height: 1.04; color: #162334; max-width: 12ch; }
.essay-header .meta { margin-top: 1.25rem; margin-bottom: 0; display: flex; flex-wrap: wrap; gap: 1rem;
  font-size: 0.95rem; color: #7b818b; }

.prose { width: min(700px, 100%); margin: 0 auto; }
.prose p { margin-bottom: 1.35rem; }
.prose h2 { margin: 2.75rem 0 1rem; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.prose h2:first-child { margin-top: 0; }

.filed { width: min(700px, 100%); margin: 3.5rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.filed .eyebrow { margin-bottom: 0.7rem; }
.filed-terms { margin: 0; max-width: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem;
  font-family: var(--sans); font-size: 0.92rem; }
.filed-terms a { color: #5b6470; text-decoration: none; border-bottom: 1px solid rgba(20, 33, 50, 0.18); padding-bottom: 0.1rem; }
.filed-terms a:hover { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 720px) {
  .essay-page { width: min(100% - 2rem, 1000px); padding: 3rem 0 3.5rem; }
  .essay-header h1 { font-size: clamp(2.1rem, 11vw, 3.3rem); }
  .essay-header .meta { gap: 0.6rem; font-size: 0.9rem; }
}

/* ------------------------------------------------------- ledger additions */
.scale { display: flex; flex-direction: column; border-top: 1px solid var(--rule-2); margin-bottom: 2rem; }
.verdict { display: grid; grid-template-columns: 170px 1fr; gap: 1.5rem; padding: 1rem 0;
  border-bottom: 1px solid var(--line); align-items: baseline; }
.vname { font-family: var(--sans); font-size: 0.82rem; font-weight: bold; letter-spacing: 0.1em;
  text-transform: uppercase; display: flex; align-items: center; gap: 0.6rem; }
.dot { width: 9px; height: 9px; flex: 0 0 9px; display: inline-block; }
.v-kept .dot { background: #3f6b4f; } .v-kept .vname { color: #3f6b4f; }
.v-mostly .dot { background: #3f6b4f; opacity: 0.55; } .v-mostly .vname { color: #3f6b4f; }
.v-partly .dot { background: var(--accent); } .v-partly .vname { color: var(--accent); }
.v-not .dot { background: #8d3b34; } .v-not .vname { color: #8d3b34; }
.v-early .dot { background: #6b7280; } .v-early .vname { color: #6b7280; }
.verdict p { margin: 0; font-size: 1rem; line-height: 1.7; max-width: none; }

.figures { display: flex; flex-direction: column; border-top: 1px solid var(--rule-2); margin-bottom: 1.5rem; }
.fig { display: grid; grid-template-columns: 130px 1fr 120px; gap: 1.5rem; padding: 1.1rem 0;
  border-bottom: 1px solid var(--line); align-items: baseline; }
.fig .val { font-size: 1.6rem; color: #162334; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fig .what { font-size: 1rem; line-height: 1.65; }
.fig .what span { display: block; font-family: var(--sans); font-size: 0.82rem; color: #8a8f98; margin-top: 0.3rem; }
.status { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  text-align: right; white-space: nowrap; color: #8d3b34; }
.status.verified { color: #2f6b45; }

.pnote { border-left: 3px solid var(--accent); background: rgba(139, 111, 61, 0.055);
  padding: 1.25rem 1.4rem; margin: 2.5rem 0; }
.pnote .eyebrow { margin-bottom: 0.6rem; }
.pnote p { font-size: 1rem; line-height: 1.7; max-width: none; }
.pnote p:last-child { margin-bottom: 0; }
.pnote ul { margin: 0; padding-left: 1.2rem; font-size: 1rem; line-height: 1.7; }
.pnote li { margin-bottom: 0.4rem; }

ul.plain { padding-left: 1.3rem; max-width: 38em; }
ul.plain li { margin-bottom: 0.5rem; }

@media (max-width: 720px) {
  .verdict, .fig { grid-template-columns: 1fr; gap: 0.35rem; }
  .status { text-align: left; }
}

/* ---------------------------------------------------------------- footer */
footer.site { border-top: 1px solid var(--line); background: var(--footer-bg); }
footer.site .footer-inner { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; text-align: center; }
footer.site p { margin: 0; font-size: 0.95rem; color: #5b6470; font-family: var(--sans); max-width: none; }
footer.site p + p { margin-top: 0.5rem; font-size: 0.85rem; color: #8a8f98; }
footer.site a { color: #5b6470; }

/* ---------------------------------------------------------------- imagery */
/* Archival images only, always credited. Never decorative. */
.hero-image {
  width: min(560px, 100%);
  margin: 0 auto 2.75rem;
  padding: 0;
}

.hero-image img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-image figcaption {
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #8a8f98;
  text-align: left;
}

.entry.has-thumb {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1.4rem;
  align-items: start;
}

.entry .thumb {
  display: block;
  border-bottom: 0;
  line-height: 0;
}

.entry .thumb img {
  width: 92px;
  height: 112px;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
}

@media (max-width: 560px) {
  .entry.has-thumb { grid-template-columns: 68px 1fr; gap: 1rem; }
  .entry .thumb img { width: 68px; height: 84px; }
}

/* ------------------------------------------------------- homepage imagery */
.hero {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 3.5rem;
  align-items: stretch;
}

/* the figure fills its column so the headline and the image share one
   clean top edge and one clean bottom edge, with no dead space above it */
.hero-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.hero-fig img {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 300px;
  object-fit: cover;
  object-position: 50% 44%;
}
.hero-fig figcaption { flex: 0 0 auto; }
.hero-fig figcaption,
.band-fig figcaption {
  margin-top: 0.65rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.6;
  color: #8a8f98;
}

.pillar-fig { margin: 0 0 1.1rem; }
.pillar-fig img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 40%;
}

/* the Ledger band, the one place the page changes rhythm */
.ledger-band {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2.75rem;
  align-items: center;
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.band-fig { margin: 0; }
.band-fig img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

.band-text h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: #162334;
}
.band-text h2 a { color: inherit; text-decoration: none; }
.band-text h2 a:hover { color: var(--accent); }
.band-text p {
  max-width: 34em;
  font-size: 1rem;
  line-height: 1.8;
  color: #5b6470;
  font-family: var(--sans);
}
.band-meta { margin-bottom: 0 !important; font-size: 0.92rem !important; }

.img-credits {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.img-credits p {
  max-width: none;
  margin: 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.9;
  color: #8a8f98;
}
.img-credits em { font-style: italic; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2.25rem; }
  .hero-fig { max-width: 460px; display: block; }
  .hero-fig img { height: auto; min-height: 0; object-fit: fill; }
  .ledger-band { grid-template-columns: 1fr; gap: 1.75rem; }
  .band-fig { max-width: 520px; }
}
