/* ============================================================
   LAS · Servant of Justice Awards Dinner — RFP response, web edition
   Tokens follow the CCL palette used in the PDF.
   ============================================================ */

@font-face { font-family: "Didot";  src: url("fonts/Didot-400.otf") format("opentype");        font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Didot";  src: url("fonts/Didot-400-italic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Didot";  src: url("fonts/Didot-700.otf") format("opentype");        font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Avenir"; src: url("fonts/Avenir-300.woff2") format("woff2"), url("fonts/Avenir-300.woff") format("woff"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Avenir"; src: url("fonts/Avenir-400.otf") format("opentype");       font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Avenir"; src: url("fonts/Avenir-500.otf") format("opentype");       font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --olive: #626835;
  --gold: #BFA67A;
  --ink: #494949;
  --ink-strong: #2f2f2f;
  --sand: #E3DFD8;
  --line: #D9D3CB;
  --paper: #FFFFFF;
  --paper-tint: #F7F5F1;

  --font-display: "Didot", Georgia, "Times New Roman", serif;
  --font-body: "Avenir", Helvetica, Arial, sans-serif;

  --wide: 62rem;         /* the one content column: header, prose, tables, photos */
  --measure: var(--wide);/* prose spans the full column (set narrower to re-center a reading column) */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-h: 72px;
  /* the wide column's actual width at any viewport; header and panel share it */
  --wide-actual: min(var(--wide), calc(100% - 2 * var(--gutter)));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--olive); text-decoration: none; border-bottom: 1px solid var(--line); transition: color .15s, border-color .15s; }
a:hover { color: var(--gold); border-color: var(--gold); }

/* ---- Type ---- */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--olive);
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 6.2vw, 4.2rem); line-height: 1.06; letter-spacing: -0.005em; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.35rem); line-height: 1.18; margin: 0 0 1rem; }
h3 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ink-strong);
  margin: 1.9rem 0 0.55rem;
}
h2 + h3 { margin-top: 0.4rem; }
p { margin: 0 0 1.05rem; text-wrap: pretty; }
p:last-child, ul:last-child { margin-bottom: 0; }
p.small { font-size: 0.95rem; line-height: 1.6; }
p.lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
}
.eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--olive);
  margin: 0 0 0.8rem;
}
ul { margin: 0 0 1.2rem; padding-left: 1.2rem; }
li { margin: 0 0 0.45rem; padding-left: 0.15rem; }
li::marker { color: var(--gold); }
.role { display: block; font-size: 0.85rem; color: var(--olive); margin-top: 2px; }

/* gold rule above every chapter heading */
.rule { width: 48px; height: 1px; background: var(--gold); margin: 0 0 1.1rem; }
.rule + .rule { display: none; }
p + .rule, ul + .rule, .table + .rule { margin-top: 2.6rem; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar {
  width: var(--wide-actual); margin: 0 auto; padding: 0;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { border: 0; display: block; line-height: 0; }
.brand img { height: 52px; width: auto; }
.btn .label-long { margin-right: 0.35em; }
.actions { display: flex; align-items: center; gap: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  font-family: var(--font-body); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  border: 1px solid var(--olive); color: var(--olive); background: var(--paper);
  cursor: pointer; line-height: 1; white-space: nowrap; transition: background .15s, color .15s;
}
.btn:hover { background: var(--olive); color: #fff; border-color: var(--olive); }
.btn svg { width: 12px; height: 12px; flex: none; }
.btn-pdf { background: var(--olive); color: #fff; }
.btn-pdf:hover { background: var(--gold); border-color: var(--gold); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .1s linear; }

/* contents panel */
.contents {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--paper); border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0,0,0,0.08);
  max-height: calc(100vh - var(--header-h)); overflow: auto;
}
.contents[hidden] { display: none; }
.contents ol {
  list-style: none; margin: 0 auto; padding: 1.25rem 0 1.5rem;
  width: var(--wide-actual);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.15rem 2.5rem;
  counter-reset: toc;
}
.contents li { margin: 0; padding: 0; display: flex; }
.contents a {
  flex: 1; display: flex; gap: 0.8rem; align-items: baseline;
  padding: 0.5rem 0; border: 0; border-bottom: 1px solid var(--sand);
  color: var(--ink); font-size: 0.95rem; line-height: 1.35;
}
.contents a::before {
  counter-increment: toc; content: counter(toc, decimal-leading-zero);
  font-size: 0.7rem; letter-spacing: 0.18em; color: var(--gold); min-width: 1.6rem; font-weight: 500;
}
.contents a:hover, .contents a.is-active { color: var(--olive); }
.contents a.is-active { font-weight: 500; }

/* ---- Layout: centered editorial grid ----
   Every chapter is a grid with three named spans. Prose sits in the centered
   reading column; photos, tables and figure pairs break out to the wide
   column, symmetrically on both sides; banners go full-bleed on phones.   */
main { display: block; }
.chapter {
  padding: clamp(2.75rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--sand);
  scroll-margin-top: calc(var(--header-h) + 8px);
}
.chapter:first-of-type { border-top: 0; }
.wrap {
  display: grid;
  grid-template-columns:
    [full-start]    minmax(var(--gutter), 1fr)
    [wide-start]    minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [content-start] min(var(--measure), calc(100% - 2 * var(--gutter)))
    [content-end]   minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [wide-end]      minmax(var(--gutter), 1fr)
    [full-end];
}
.wrap > * { grid-column: content; min-width: 0; }
.wrap > .table, .wrap > .figures, .wrap > .banner, .wrap > .meta { grid-column: wide; }
.wrap > .table:has(> .kv) { grid-column: content; }

/* ---- Cover ---- */
.cover { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.cover h1 { margin: 0 0 1.3rem; }
.cover .lede { margin-bottom: 1.6rem; }
.cover .date { margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.meta {
  display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 1.5rem 2rem;
  border-top: 1px solid var(--line); padding-top: 1.4rem;
}
.meta .eyebrow { margin-bottom: 0.4rem; font-size: 0.66rem; }
.meta p { margin: 0; font-size: 0.98rem; line-height: 1.6; }

/* ---- Banners & figures ---- */
.banner {
  position: relative; margin: 0 0 2rem; overflow: hidden;
  aspect-ratio: 16 / 7; background: var(--sand);
}
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.4rem 1.2rem 0.9rem;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
  color: #fff; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 500;
}
.banner.is-closing { margin: 2rem 0 0; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.25rem 0 0.75rem; }
.figures figure { margin: 0; }
.figures img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.figures figcaption { margin-top: 0.6rem; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 500; color: var(--olive); }

/* ---- Tables ---- */
.table { width: 100%; overflow-x: auto; margin: 0.6rem 0 1.6rem; }
.table:last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.55; }
th {
  text-align: left; vertical-align: bottom;
  font-weight: 500; font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--olive);
  padding: 0 1rem 0.6rem 0; border-bottom: 1px solid var(--olive);
}
td { vertical-align: top; padding: 0.85rem 1rem 0.85rem 0; border-bottom: 1px solid var(--sand); }
td:last-child, th:last-child { padding-right: 0; }
tr:last-child td { border-bottom: 1px solid var(--line); }
td ul { margin: 0; padding-left: 1rem; }
td li { margin: 0 0 0.3rem; }
td:first-child { font-weight: 500; color: var(--ink-strong); }
table.kv td:first-child { width: 28%; }
table:not(.kv) th:first-child, table:not(.kv) td:first-child { min-width: 10.5rem; }
table + table { margin-top: 2rem; }
.table + .table { margin-top: -0.4rem; }

/* stacked tables on narrow screens: each row becomes a card */
@media (max-width: 720px) {
  .table { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr { padding: 0.9rem 0 0.4rem; border-bottom: 1px solid var(--line); }
  tr:first-child { border-top: 1px solid var(--olive); }
  td { padding: 0 0 0.75rem; border: 0; }
  tr:last-child td { border: 0; }
  td::before {
    content: attr(data-label);
    display: block; margin-bottom: 0.2rem;
    font-weight: 500; font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--olive);
  }
  td:first-child { font-size: 1.02rem; }
  table.kv td:first-child { width: auto; }
}

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 2.2rem 0 3rem; text-align: center; }
.site-footer .address { font-weight: 300; font-size: 0.85rem; letter-spacing: 0.08em; color: var(--ink); margin: 0 0 1.2rem; }
.site-footer .btn { justify-self: center; }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  body { font-size: 1rem; }
  :root { --header-h: 60px; }
  .brand img { height: 30px; }
  .btn { height: 34px; padding: 0 13px; font-size: 0.64rem; letter-spacing: 0.16em; }
  .btn .label-long { display: none; }
  .meta { grid-template-columns: 1fr; gap: 1.1rem; }
  .figures { grid-template-columns: 1fr; }
  .wrap > .banner { grid-column: full; aspect-ratio: 4 / 3; }
}
@media (max-width: 480px) { h1 br { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; }
}

@media print {
  .site-header, .site-footer .btn { display: none; }
  .chapter { padding: 1.5rem 0; break-inside: auto; }
  .banner { aspect-ratio: auto; max-height: 3in; }
  a { color: inherit; border: 0; }
}

/* ---- Cover letter signature ---- */
.signature { display: block; width: 190px; height: auto; margin: 0.2rem 0 0.8rem; }
