/* ==========================================================================
   Mia Jennings Memorial Fund
   Single stylesheet. No preprocessor, no build step.
   Edit this file directly; the browser loads it as-is.
   ========================================================================== */

/* --- 1. Design tokens ---------------------------------------------------- */

:root {
  /* Colour. All text/background pairs below meet WCAG 2.2 AA (4.5:1+). */
  --ink:          #16242c; /* body text on cream/white — 13.8:1 */
  --ink-soft:     #4a5c66; /* secondary text on cream — 5.9:1  */
  --sea:          #1d4557; /* headings, header bar — 10.2:1 on white */
  --sea-dark:     #143240; /* hover state for --sea */
  --clay:         #a8503f; /* primary action — white text on it is 7.5:1 */
  --clay-dark:    #8b402f; /* hover state for --clay */
  --cream:        #fbf8f4; /* page background */
  --paper:        #ffffff; /* cards */
  --line:         #e2dbd2; /* hairlines */
  --line-strong:  #c9bfb3;
  --focus:        #b8541c; /* focus ring — visible on cream and on --sea */

  /* Type. System fonts only: zero font bytes downloaded. */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Iowan Old Style", "Times New Roman", serif;

  /* Spacing scale */
  --s1: 0.25rem; --s2: 0.5rem;  --s3: 0.75rem; --s4: 1rem;
  --s5: 1.5rem;  --s6: 2rem;    --s7: 3rem;    --s8: 4.5rem;

  --radius: 6px;
  --measure: 34rem;      /* comfortable reading width */
  --wrap: 68rem;         /* page max width */
  --shadow: 0 1px 2px rgba(22,36,44,.06), 0 4px 14px rgba(22,36,44,.06);
}

/* --- 2. Reset ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

/* --- 3. Typography ------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--sea);
  line-height: 1.2;
  margin: 0 0 var(--s4);
  font-weight: 600;
}
h1 { font-size: clamp(1.9rem, 5.5vw, 2.9rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.9rem); margin-top: var(--s7); }
h3 { font-size: 1.2rem; margin-top: var(--s5); }
h4 { font-size: 1.05rem; font-family: var(--font-body); margin-top: var(--s5); }

p, ul, ol, dl { margin: 0 0 var(--s4); }
p, li { max-width: var(--measure); }

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink);
}

small, .small { font-size: .9rem; line-height: 1.55; }

a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--sea-dark); }

/* Visible focus everywhere, on every interactive element. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- 4. Layout ----------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s5);
}

main { display: block; }

.section { padding-block: var(--s7); }
.section--tight { padding-block: var(--s6); }
.section--paper { background: var(--paper); border-block: 1px solid var(--line); }

.section > .wrap > h2:first-child { margin-top: 0; }

.grid {
  display: grid;
  gap: var(--s5);
  grid-template-columns: 1fr;
}
@media (min-width: 46em) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* --- 5. Skip link -------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: var(--s4);
  top: -6rem;
  z-index: 100;
  background: var(--paper);
  color: var(--sea);
  padding: var(--s3) var(--s4);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: var(--s4); }

/* --- 6. Header and navigation -------------------------------------------- */

.site-header {
  background: var(--sea);
  color: #fff;
  border-bottom: 3px solid var(--clay);
}
.site-header a { color: #fff; }

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding-block: var(--s4);
}

.brand { text-decoration: none; display: block; }
.brand strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
}
.brand span {
  display: block;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #cfe0e8;   /* 9.4:1 on --sea */
  margin-top: 2px;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: var(--radius);
  font: inherit;
  font-size: .95rem;
  padding: var(--s3) var(--s4);
  min-height: 44px;
  cursor: pointer;
}
.nav-toggle:hover { background: rgba(255,255,255,.12); }

.nav-toggle-bars { display: block; width: 18px; height: 2px; background: #fff; position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: #fff;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after  { top: 6px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}
.site-nav li { max-width: none; }
.site-nav a {
  display: block;
  padding: var(--s3) var(--s2);
  min-height: 44px;
  text-decoration: none;
  border-radius: var(--radius);
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.site-nav a:hover { background: rgba(255,255,255,.12); text-decoration: underline; }
.site-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; }

/* Collapsed on small screens; JS sets hidden. Without JS the menu stays open. */
.site-nav[hidden] { display: none; }

@media (min-width: 52em) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav[hidden] { display: block; }
  .header-bar { padding-block: var(--s5); }
  .site-nav ul { flex-direction: row; align-items: center; gap: var(--s2); padding: 0; flex-wrap: wrap; }
  .site-nav a { border-bottom: 0; padding: var(--s2) var(--s3); }
}

/* --- 7. Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  padding: var(--s3) var(--s5);
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--clay); color: #fff; }
.btn--primary:hover { background: var(--clay-dark); color: #fff; }

.btn--secondary { background: var(--sea); color: #fff; }
.btn--secondary:hover { background: var(--sea-dark); color: #fff; }

.btn--ghost { background: transparent; color: var(--sea); border-color: var(--line-strong); }
.btn--ghost:hover { background: #fff; border-color: var(--sea); color: var(--sea-dark); }

.btn--small { min-height: 44px; padding: var(--s2) var(--s4); font-size: .95rem; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.btn-row .btn { flex: 1 1 15rem; }
@media (min-width: 40em) { .btn-row .btn { flex: 0 1 auto; } }

/* --- 8. Hero ------------------------------------------------------------- */

.hero { background: var(--paper); border-bottom: 1px solid var(--line); }
.hero-inner { padding-block: var(--s7); }

@media (min-width: 52em) {
  .hero-inner {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: var(--s7);
    align-items: center;
    padding-block: var(--s8);
  }
}

.hero h1 { margin-bottom: var(--s4); }
.hero .lede { margin-bottom: var(--s5); }

/* --- 9. Photograph placeholders ------------------------------------------ */
/* Replace the <div class="photo-placeholder"> with a real <img> — see README. */

.photo,
.photo-placeholder {
  border-radius: var(--radius);
  overflow: hidden;
  background: #efe9e1;
}
.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s5);
  border: 2px dashed var(--line-strong);
  color: var(--ink-soft);
  font-size: .9rem;
  min-height: 14rem;
  aspect-ratio: 4 / 3;
}
.photo-placeholder p { max-width: 22rem; margin: 0; }
.photo figcaption,
figure figcaption {
  font-size: .9rem;
  color: var(--ink-soft);
  margin-top: var(--s2);
}
figure { margin: 0 0 var(--s5); }

/* --- 10. Cards ----------------------------------------------------------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; }

/* --- 11. Counter / key figures ------------------------------------------- */

.figures { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 40em) { .figures { grid-template-columns: repeat(3, 1fr); } }

.figure-stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--clay);
  border-radius: var(--radius);
  padding: var(--s5);
}
.figure-stat .num {
  display: block;
  font-family: var(--font-head);
  font-size: 2.3rem;
  line-height: 1.1;
  color: var(--sea);
  margin-bottom: var(--s2);
}
.figure-stat p { margin: 0; color: var(--ink-soft); font-size: .98rem; }

/* --- 12. Screening list -------------------------------------------------- */

.screening-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.screening-list > li { max-width: none; }

.screening {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: var(--shadow);
}
.screening h3 { margin: 0 0 var(--s2); font-size: 1.25rem; }
.screening .venue { font-weight: 600; margin-bottom: var(--s1); }
.screening address {
  font-style: normal;
  color: var(--ink-soft);
  margin-bottom: var(--s3);
  font-size: .98rem;
}
.screening .meta {
  margin: 0 0 var(--s4);
  color: var(--ink-soft);
  font-size: .95rem;
}
.screening .btn-row { margin-bottom: 0; }

.screening--past { opacity: .95; background: transparent; box-shadow: none; }

.tag {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: var(--s3);
  border: 1px solid;
}
.tag--open { color: #1f5136; background: #e6f4ec; border-color: #9cc9b1; }
.tag--full { color: #7a4310; background: #fbeee0; border-color: #ddb98c; }
.tag--past { color: #4a5c66; background: #eef1f3; border-color: #c3ccd1; }

/* Past-dates disclosure */
.past-dates { margin-top: var(--s7); }
.past-dates summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--sea);
  padding: var(--s3) 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* --- 13. Empty / status states ------------------------------------------- */

.empty-state {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sea);
  border-radius: var(--radius);
  padding: var(--s5);
}
.empty-state h3 { margin-top: 0; }
.empty-state > :last-child { margin-bottom: 0; }

.loading { color: var(--ink-soft); font-style: italic; }

/* --- 14. Testimony cards ------------------------------------------------- */

.testimony-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s5); }
.testimony-list > li { max-width: none; }
@media (min-width: 52em) { .testimony-list { grid-template-columns: repeat(2, 1fr); } }

.testimony {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: var(--shadow);
  height: 100%;
}
.testimony blockquote {
  margin: 0 0 var(--s4);
  font-family: var(--font-head);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--ink);
  border-left: 3px solid var(--clay);
  padding-left: var(--s4);
}
.testimony blockquote p:last-child { margin-bottom: 0; }
.testimony .attribution { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.testimony .attribution strong { color: var(--ink); display: block; }

/* --- 15. Callout --------------------------------------------------------- */

.callout {
  background: #eef3f5;
  border: 1px solid #cfdde3;
  border-radius: var(--radius);
  padding: var(--s5);
  margin-bottom: var(--s5);
}
.callout > :last-child { margin-bottom: 0; }
.callout h2, .callout h3 { margin-top: 0; }

/* Editor-only marker for facts awaiting confirmation. */
.verify {
  background: #fff3cd;
  border-bottom: 2px dotted #a8790a;
  padding: 0 3px;
  font-weight: 600;
  color: #5c4405;
}

/* --- 16. Steps / numbered lists ------------------------------------------ */

.steps { list-style: none; counter-reset: step; margin: 0 0 var(--s5); padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: var(--s4);
  max-width: var(--measure);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--sea);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}

/* --- 17. Footer ---------------------------------------------------------- */

.site-footer {
  background: var(--sea);
  color: #e8eff2;   /* 11.2:1 on --sea */
  margin-top: var(--s8);
  padding-block: var(--s7) var(--s6);
}
.site-footer a { color: #fff; }
.site-footer h2, .site-footer h3 {
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 0 0 var(--s3);
}
.footer-grid { display: grid; gap: var(--s6); grid-template-columns: 1fr; }
@media (min-width: 46em) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: var(--s2); max-width: none; }
.footer-grid a { display: inline-block; padding: var(--s1) 0; min-height: 32px; }

.footer-legal {
  margin-top: var(--s6);
  padding-top: var(--s5);
  border-top: 1px solid rgba(255,255,255,.25);
  font-size: .9rem;
  color: #dbe6ea;
}
.footer-legal p { max-width: 46rem; }
.footer-legal p:last-child { margin-bottom: 0; }

/* --- 18. Utilities ------------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.flow > * + * { margin-top: var(--s4); }
.text-center { text-align: center; }
.text-center p, .text-center li { margin-inline: auto; }
.mb-0 { margin-bottom: 0; }

/* External-link marker, applied by js/main.js */
.ext::after {
  content: " ↗";
  font-size: .85em;
  vertical-align: baseline;
}

/* --- 19. Print ----------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .btn, .nav-toggle { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
}

/* --- 19. Single-page layout (v2) ------------------------------------------ */

/* Two in-page links: always visible, no toggle needed. */
.site-nav--simple ul { flex-direction: row; padding: 0; gap: var(--s1); }
.site-nav--simple a { border-bottom: 0; padding: var(--s3) var(--s3); font-size: .95rem; }
.header-bar { flex-wrap: wrap; }

/* Portrait photograph beside the intro on wide screens, below it on phones. */
.portrait { margin: var(--s5) auto 0; max-width: 22rem; }
.portrait .photo { width: 100%; }
@media (min-width: 52em) {
  .hero-inner--portrait { grid-template-columns: 1.4fr 1fr; }
  .portrait { margin: 0; justify-self: end; }
}

.site-footer .footer-legal:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* School screenings: an extra tag beside the status. */
.tag--school { color: #1d4557; background: #e7eff3; border-color: #a9c1cc; margin-left: var(--s2); }

/* The "Anchor" targets sit under nothing sticky, but leave a little air. */
#dates, #donate { scroll-margin-top: var(--s4); }
.tags { margin: 0 0 var(--s3); }
.tags .tag { margin-bottom: 0; }

/* --- 20. Admin page (/admin/) --------------------------------------------- */

.admin-card { max-width: 40rem; margin-bottom: var(--s6); }
.admin h1 { margin-bottom: var(--s4); }
.field { margin: 0 0 var(--s5); border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: var(--s2); color: var(--ink); }
.field .choice { display: flex; align-items: center; gap: var(--s3); font-weight: 400; min-height: 44px; margin: 0; }
.field .choice input { width: 1.25rem; height: 1.25rem; accent-color: var(--sea); }
.field .hint { font-size: .9rem; color: var(--ink-soft); margin: calc(-1 * var(--s1)) 0 var(--s2); }
.field .req { font-weight: 400; color: var(--ink-soft); font-size: .9rem; }
.field input[type="text"], .field input[type="url"], .field input[type="date"],
.field input[type="time"], .field input[type="password"] {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--line-strong); border-radius: var(--radius);
  padding: var(--s3); min-height: 48px;
}
.field input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--sea); }
.field-row { display: grid; gap: 0 var(--s4); grid-template-columns: 1fr; }
@media (min-width: 36em) { .field-row { grid-template-columns: 2fr 1fr 1fr; } }

.admin-msg { padding: var(--s3) var(--s4); border-radius: var(--radius); border: 1px solid; max-width: 40rem; }
.admin-msg--error { color: #7a2418; background: #fbeae6; border-color: #e0a79b; }
.admin-msg--ok { color: #1f5136; background: #e6f4ec; border-color: #9cc9b1; }
.admin-msg:not(.admin-msg--error):not(.admin-msg--ok) { border-color: var(--line); }

.admin-list { list-style: none; padding: 0; margin: 0 0 var(--s5); }
.admin-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); margin-bottom: var(--s3); max-width: none;
}
.admin-row p { margin: 0 0 var(--s1); }
.admin-row-when { font-weight: 700; color: var(--sea); }
.admin-row-actions { display: flex; gap: var(--s2); align-items: flex-start; flex-wrap: wrap; }
.admin-remove { color: #8b2e1f; }
.admin-empty { color: var(--ink-soft); max-width: none; }
button:disabled { opacity: .6; cursor: progress; }
.field input:focus-visible { outline-color: var(--focus); }
[hidden] { display: none !important; }
