/* Huntingburg Memorial Gym — Revitalization Campaign
   Colors are taken from the campaign banner and the 75th Anniversary logo. */

:root {
  /* Brand */
  --maroon-deep: #650005;   /* 75th logo field: footer and scoreboard band */
  --maroon: #7a1a1f;        /* headings */
  --crimson: #9b111e;       /* 75th logo crimson */
  --red: #b3121b;           /* campaign red: Give buttons */
  --red-hover: #8f0e16;
  --silver: #b3b3b3;        /* logo outlines and dividers */
  --charcoal: #3f3d38;      /* body text, logo plaque */
  --wood: #c8955e;          /* hardwood accent rule */
  --white: #ffffff;         /* must stay pure white so the light logo JPG blends in */
  --mist: #f3f4f5;          /* quiet alternate section */

  /* Scoreboard digits */
  --amber: #ffb000;

  /* Type */
  --font-display: "Teko", "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* Scale (1.25 ratio, body 18px) */
  --step--1: 0.889rem;
  --step-0: 1.125rem;
  --step-1: 1.406rem;
  --step-2: 1.758rem;
  --step-3: 2.197rem;
  --step-4: 2.747rem;
  --step-5: clamp(2.75rem, 6vw, 4.3rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --measure: 66ch;
  --wrap: 72rem;
  --radius: 4px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 0.95;
  color: var(--maroon);
  margin: 0 0 var(--space-2);
  letter-spacing: 0.005em;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }

p { margin: 0 0 var(--space-2); max-width: var(--measure); }

a { color: var(--crimson); text-underline-offset: 0.18em; }
a:hover { color: var(--red-hover); }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

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

.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;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  background: var(--charcoal);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--white); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1;
  padding: 0.7rem 1.4rem 0.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-give { background: var(--red); color: var(--white); }
.btn-give:hover { background: var(--red-hover); color: var(--white); }
.btn-ghost { border-color: var(--maroon); color: var(--maroon); }
.btn-ghost:hover { background: var(--maroon); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid #e4e4e4;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 4.5rem;
}

/* Wordmark echoing the campaign logo: roofline over a charcoal plaque */
.wordmark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}
.wordmark svg { width: 9.5rem; height: auto; margin-bottom: -2px; }
.wordmark .plaque {
  background: var(--charcoal);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.6rem 0.2rem;
  font-stretch: condensed;
}
.wordmark .town {
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--charcoal);
  margin-bottom: 1px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--charcoal);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--charcoal);
  padding: 0.35rem 0.8rem 0.15rem;
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a:not(.btn) {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--charcoal);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 3px solid transparent;
}
.site-nav a:not(.btn):hover { color: var(--crimson); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--wood); color: var(--maroon); }

@media (max-width: 47.99rem) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid #e4e4e4;
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: var(--space-1) 1.25rem var(--space-2); }
  .site-nav li a:not(.btn) { display: block; padding: 0.7rem 0 0.5rem; }
  .site-nav .nav-give { display: none; } /* the sticky bar handles Give on phones */
}

/* Sticky give bar on phones */
.give-bar { display: none; }
@media (max-width: 47.99rem) {
  .give-bar {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: var(--maroon-deep);
    padding: 0.6rem 1.25rem calc(0.6rem + env(safe-area-inset-bottom));
  }
  .give-bar .btn { display: block; text-align: center; }
  body { padding-bottom: 4.5rem; }
}

/* ---------- Hero (home) ---------- */
.hero { background: var(--white); }
.hero-media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #dfe8f1 0%, #f4f7fa 60%, #e9e3d8 100%);
}
.hero-media img { width: 100%; }
.hero-title { padding-top: var(--space-4); }

/* Desktop: the banner carries the headline and logo, so the HTML headline is read by screen readers only. */
@media (min-width: 48rem) {
  .hero:not(.no-banner) .hero-title h1 {
    position: absolute !important;
    width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* Phones: crop off the banner's baked-in logo and headline, show the HTML headline instead. */
@media (max-width: 47.99rem) {
  .hero-media { aspect-ratio: 4 / 3; }
  .hero-media img {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: auto;
    height: 128%;
    max-width: none;
    transform: translateX(-52%);
  }
}

/* If the banner image is missing, fall back to a type-only hero. */
.hero.no-banner .hero-media { display: none; }
.hero.no-banner { background: var(--white); }
.hero.no-banner .hero-title { padding-top: var(--space-5); }

.hero h1 .past { color: var(--maroon); display: block; }
.hero h1 .future { color: var(--red); display: block; }
.hero .subhead {
  font-size: var(--step-2);
  line-height: 1.3;
  color: var(--charcoal);
  max-width: 34ch;
  font-style: italic;
}
.hero-intro { padding-bottom: var(--space-5); }

/* ---------- Scoreboard (the one bold moment) ---------- */
.scoreboard-band {
  background: var(--maroon-deep);
  color: var(--white);
  padding-block: var(--space-5);
}
.scoreboard-band .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: center;
}
@media (min-width: 60rem) {
  .scoreboard-band .wrap { grid-template-columns: 15rem 1fr; }
}
.scoreboard-band .badge { width: 12rem; margin-inline: auto; }
@media (min-width: 60rem) { .scoreboard-band .badge { width: 15rem; } }
.scoreboard-band h2 { color: var(--white); }
.scoreboard-band p { color: #f1dede; }

.scoreboard {
  background: #1a1a1a;
  border: 6px solid var(--silver);
  border-radius: 10px;
  padding: var(--space-3);
  box-shadow: inset 0 0 0 2px #000;
}
.scoreboard-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
.panel { text-align: center; }
.panel-label {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--white);
  margin-bottom: 0.25rem;
}
.panel-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.8rem, 9vw, 4.6rem);
  line-height: 1;
  color: var(--amber);
  background: #000;
  border-radius: 6px;
  padding: 0.6rem 0.5rem 0.2rem;
  text-shadow: 0 0 12px rgba(255, 176, 0, 0.45);
  font-variant-numeric: tabular-nums;
}
.meter {
  margin-top: var(--space-3);
}
.meter-track {
  height: 1.4rem;
  background: #000;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid #333;
}
.meter-fill {
  height: 100%;
  width: var(--pct, 50%);
  background: repeating-linear-gradient(90deg, var(--amber) 0 10px, #e09a00 10px 12px);
  border-radius: 999px;
  transition: width 1.4s cubic-bezier(.2,.7,.2,1);
}
.meter-caption {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: #d9d9d9;
}
.phase-flag {
  display: inline-block;
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--white);
  border: 2px solid var(--silver);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem 0.15rem;
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space-6); }
.section-mist { background: var(--mist); }

.lede { font-size: var(--step-1); line-height: 1.55; }

/* Facts beside the white 75th logo */
.facts {
  display: grid;
  gap: var(--space-4);
  align-items: center;
}
@media (min-width: 52rem) { .facts { grid-template-columns: 18rem 1fr; } }
.facts .badge { width: 14rem; margin-inline: auto; }
@media (min-width: 52rem) { .facts .badge { width: 18rem; } }
.fact-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3) var(--space-4);
  margin: var(--space-3) 0 0;
}
.fact-list div { border-top: 3px solid var(--wood); padding-top: var(--space-1); }
.fact-list dt { font-family: var(--font-display); font-size: var(--step-4); line-height: 1; color: var(--maroon); }
.fact-list dd { margin: 0.2rem 0 0; font-size: var(--step--1); line-height: 1.4; }

/* Quote */
.quote {
  margin: 0;
  padding-left: var(--space-3);
  border-left: 6px solid var(--crimson);
}
.quote p {
  font-size: var(--step-2);
  line-height: 1.4;
  font-style: italic;
  color: var(--charcoal);
  max-width: 38ch;
}
.quote footer { font-family: var(--font-display); font-size: var(--step-1); color: var(--maroon); }

.two-col { display: grid; gap: var(--space-5); }
@media (min-width: 56rem) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }

/* What your gift builds */
.builds {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 52rem) { .builds { grid-template-columns: repeat(3, 1fr); } }
.builds li { border-top: 6px solid var(--maroon); padding-top: var(--space-2); }
.builds h3 { margin-bottom: var(--space-1); }
.builds p { font-size: var(--step--1); line-height: 1.55; }

/* ---------- About ---------- */
.page-head { padding-block: var(--space-5) var(--space-4); border-bottom: 1px solid #e4e4e4; }
.page-head p { font-size: var(--step-1); line-height: 1.5; }

.history-intro {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}
@media (min-width: 56rem) { .history-intro { grid-template-columns: 1fr 16rem; } }
.history-intro .badge { width: 13rem; margin-inline: auto; }

.timeline {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0 0 0 1.5rem;
  border-left: 4px solid var(--wood);
  max-width: 46rem;
}
.timeline li { position: relative; padding: 0 0 var(--space-4) var(--space-2); }
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 12px);
  top: 0.35rem;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--crimson);
}
.timeline time { font-family: var(--font-display); font-size: var(--step-3); line-height: 1; color: var(--maroon); display: block; }
.timeline h3 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; color: var(--charcoal); line-height: 1.3; margin: 0.25rem 0 0.25rem; }
.timeline p { font-size: var(--step--1); }
.timeline .todo { color: #7a7a7a; font-style: italic; }

.rendering { margin: var(--space-4) 0; }
.rendering figcaption { font-size: var(--step--1); color: #666; margin-top: 0.5rem; }

.archival { margin: var(--space-4) 0 0; max-width: 40rem; }
.archival figcaption { font-size: var(--step--1); color: #666; margin-top: 0.5rem; }

.project-layout { display: grid; gap: var(--space-4); align-items: start; }
@media (min-width: 56rem) { .project-layout { grid-template-columns: minmax(0, 26rem) 1fr; } }
.project-layout .rendering { margin: var(--space-4) 0 0; }

.phase-grid { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.phase {
  border: 2px solid var(--silver);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.phase.funded { border-color: var(--maroon); }
.phase-status {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--step-0);
  padding: 0.25rem 0.6rem 0.05rem;
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  background: var(--mist);
  color: var(--charcoal);
}
.phase.funded .phase-status { background: var(--maroon); color: var(--white); }
.phase ul { margin: 0; padding-left: 1.2rem; }
.phase li { margin-bottom: 0.35rem; }

.committee {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: var(--space-2) var(--space-3);
}
.committee li { font-family: var(--font-display); font-size: var(--step-2); color: var(--charcoal); border-bottom: 1px solid #ddd; padding-bottom: 0.25rem; }

/* ---------- Give ---------- */
.levels {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 var(--space-2);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
/* Ticket stubs */
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-2);
  background: var(--white);
  border: 2px solid var(--maroon);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
}
.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px; height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--mist);
  border: 2px solid var(--maroon);
}
.ticket::before { left: -10px; clip-path: inset(0 0 0 50%); }
.ticket::after { right: -10px; clip-path: inset(0 50% 0 0); }
.ticket-name { font-family: var(--font-display); font-size: var(--step-2); line-height: 1; color: var(--maroon); }
.ticket-note { font-size: var(--step--1); line-height: 1.4; margin: 0.3rem 0 0; color: #555; }
.ticket-amount {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1;
  color: var(--red);
  border-left: 2px dashed var(--silver);
  padding-left: var(--space-2);
}

.give-ways { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
@media (min-width: 52rem) { .give-ways { grid-template-columns: 1fr 1fr; } }
.give-way { border-top: 6px solid var(--maroon); padding-top: var(--space-2); }
.give-way .note { font-size: var(--step--1); color: #555; margin-top: var(--space-1); }
.check-address { font-style: normal; line-height: 1.5; margin: var(--space-2) 0; }
.check-address strong { font-weight: 600; }

.map-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: var(--radius);
  background: var(--mist);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--maroon-deep);
  color: #f1dede;
  padding-block: var(--space-5) var(--space-4);
  font-size: var(--step--1);
}
.site-footer .wrap {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 52rem) { .site-footer .wrap { grid-template-columns: 10rem 1fr 1fr; align-items: start; } }
.site-footer .badge { width: 9rem; }
.site-footer h2 { font-size: var(--step-2); color: var(--white); margin-bottom: var(--space-1); }
.site-footer a { color: var(--white); }
.site-footer p { margin-bottom: var(--space-1); }
.footer-base {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(179, 179, 179, 0.4);
  padding-top: var(--space-2);
  color: #d6b8b8;
}

/* Missing-image placeholder for badges */
.badge.missing { display: none; }
.no-badge { grid-template-columns: 1fr !important; }
.site-footer .no-badge { grid-template-columns: 1fr 1fr !important; }
@media (max-width: 51.99rem) { .site-footer .no-badge { grid-template-columns: 1fr !important; } }

.scoreboard { max-width: 40rem; }
