/* ==========================================================================
   Mr. Lake Ontario Leather — shared stylesheet
   --------------------------------------------------------------------------
   Why it's built this way:
   - One file, no framework, no build step: anyone with a text editor can
     maintain it, and Cloudflare Pages serves it as-is.
   - Fonts are self-hosted (see /fonts) so visitors' browsers never contact
     a third party. That keeps the site private and lets the security
     headers in /_headers stay strict.
   - Colours live in custom properties ("tokens"). Every text/background
     pair below was checked against WCAG 2.2 AA (4.5:1 body, 3:1 large text
     and UI). If you change a colour, re-check it with a contrast checker.

   Verified contrast (approximate):
     bone  #F1EBE2 on saddle #17140F  15.5:1   body text
     muted #C9BFB2 on saddle          10.1:1   secondary text
     lake-light #A3B8FF on saddle      9.5:1   links, focus ring
     bone on lake #1F44B8              6.9:1   primary buttons
     heart #D4213D on saddle           3.6:1   DECORATION ONLY — never text
   ========================================================================== */

/* ---------- Fonts (SIL Open Font License; licences in /fonts) ---------- */
/* Atkinson Hyperlegible was designed by the Braille Institute for readers
   with low vision: distinct letterforms (Il1, O0) improve legibility. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap; /* show fallback text immediately; never invisible text */
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* Barlow Condensed: tall, sturdy signage letterforms that echo club patches
   and title sashes. Used for headings only, never for body text. */
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --saddle: #17140f;      /* page background: warm, leather-dark, not pure black */
  --hide: #231e18;        /* raised surfaces */
  --bone: #f1ebe2;        /* body text: off-white reduces halation on dark */
  --muted: #c9bfb2;       /* secondary text */
  --lake: #1f44b8;        /* brand blue (leather-flag royal blue) — fills only */
  --lake-light: #a3b8ff;  /* links + focus on dark backgrounds */
  --heart: #d4213d;       /* accent graphics only */
  --rule: #4a4238;        /* decorative dividers */

  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;

  --measure: 68ch;        /* comfortable line length */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --space: 1.5rem;
  --tap: 48px;            /* exceeds WCAG 2.2 target size (24px) */
}

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

html {
  /* Respect the visitor's own font-size setting: rem units scale with it. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--saddle);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.125rem;   /* 18px at default browser settings */
  line-height: 1.6;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.75rem, 8vw, 4.75rem); }
h2 { font-size: clamp(2rem, 5vw, 2.75rem); margin-top: 0; }
address { font-style: normal; margin-bottom: 1em; }
h3 { font-size: 1.6rem; margin-top: 2rem; }

p, ul, ol, dl { margin: 0 0 1em; max-width: var(--measure); }
li + li { margin-top: 0.35em; }

/* Links are always underlined so they never rely on colour alone (WCAG 1.4.1). */
a {
  color: var(--lake-light);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 0.16em; }

/* One strong, consistent focus indicator for every interactive element. */
:focus-visible {
  outline: 3px solid var(--lake-light);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Skip link (keyboard + screen reader users) ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--bone);
  color: var(--saddle);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3rem, 8vw, 5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section--raised { background: var(--hide); }

/* ---------- Header + navigation ----------
   No hamburger menu and no JavaScript: five links simply wrap on small
   screens. That is more robust for screen readers and keyboard users and
   leaves nothing to break. */
.site-header { padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--bone);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
}
.wordmark svg { width: 1.6rem; height: 1.6rem; flex: none; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  max-width: none;
}
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--bone);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--rule); }
/* The current page is marked with aria-current in the HTML; the style
   follows the attribute so the visual and the accessible state never drift. */
.site-nav a[aria-current="page"] { border-bottom-color: var(--lake-light); font-weight: 700; }

/* ---------- Hero: the lake horizon ----------
   The one bold visual moment. Horizontal bands echo both the surface of
   Lake Ontario and the stripes of the leather pride flag; a single red
   heart sits above the waterline. Purely decorative (aria-hidden). */
.hero { padding-block: clamp(3rem, 9vw, 6rem) 0; }

.hero h1 {
  font-size: clamp(3.25rem, 12vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.005em;
  max-width: 11ch;
  margin-bottom: 0.35em;
}

.hero-lede {
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  color: var(--bone);
  max-width: 40ch;
}

.horizon {
  position: relative;
  height: 108px;
  /* leaves room above the waterline for the heart (52px tall) */
  margin-top: clamp(4.5rem, 9vw, 6rem);
  /* 9 bands of 12px: blue and dark alternating, a bone band in the middle. */
  background:
    linear-gradient(
      to bottom,
      var(--lake) 0 12px, var(--saddle) 12px 24px,
      var(--lake) 24px 36px, var(--saddle) 36px 48px,
      var(--bone) 48px 60px,
      var(--saddle) 60px 72px, var(--lake) 72px 84px,
      var(--saddle) 84px 96px, var(--lake) 96px 108px
    );
}
.horizon svg {
  position: absolute;
  left: var(--gutter);
  top: -46px;
  width: 52px;
  height: 52px;
}

.event-facts {
  display: grid;
  gap: 0.25rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin: 0;
  max-width: none;
  padding-block: 2rem 0;
}
.event-facts div { margin: 0; }
.event-facts dt { color: var(--muted); font-size: 1rem; }
.event-facts dd {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  line-height: 1.15;
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-block: 1.5rem 0;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.7rem 1.4rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--lake-light); /* boundary meets 3:1 against the page */
  border-radius: 4px;
  color: var(--bone);
  background: var(--lake);
}
.button:hover { background: #2a52cc; }
.button--quiet { background: transparent; border-color: var(--bone); }
.button--quiet:hover { background: var(--hide); }

/* ---------- Ordered timelines (key dates, schedule) ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  border-left: 3px solid var(--lake);
}
.timeline li {
  margin: 0;
  padding: 0 0 1.5rem 1.5rem;
  position: relative;
}
.timeline li::before { /* marker dot on the line */
  content: "";
  position: absolute;
  left: -9px;
  top: 0.45em;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--saddle);
  border: 3px solid var(--lake-light);
}
.timeline time,
.timeline .when {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
}

/* ---------- Steps (a real sequence, so numbered) ---------- */
.steps { padding-left: 1.4em; }
.steps li { padding-left: 0.3em; }
.steps li::marker { font-family: var(--font-display); font-weight: 700; color: var(--lake-light); }

/* ---------- Two-column split on wide screens ---------- */
.split {
  display: grid;
  gap: 2rem 4rem;
  grid-template-columns: 1fr;
}
@media (min-width: 56rem) {
  .split { grid-template-columns: 5fr 7fr; align-items: start; }
}

/* ---------- FAQ disclosures (native <details>: no JavaScript needed) ---------- */
.faq { max-width: var(--measure); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  min-height: var(--tap);
  padding-block: 0.9rem;
  font-weight: 700;
  font-size: 1.2rem;
}
.faq details[open] summary { color: var(--lake-light); }
.faq details > *:not(summary) { margin-left: 1.2rem; }

/* ---------- Sponsors ---------- */
.sponsor-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  max-width: none;
}
.sponsor-list li {
  margin: 0;
  min-height: 7rem;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  background: var(--hide);
  border: 1px dashed var(--rule); /* dashed = placeholder slot */
  color: var(--muted);
}

/* ---------- "On this page" jump menu (long contest page) ----------
   Common on contest sites (rules, scoring, judges...). Lets visitors and
   screen reader users jump straight to the section they need. */
.page-nav { margin-top: 2rem; }
.page-nav-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.page-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  max-width: none;
}
.page-nav li + li { margin-top: 0; }
.page-nav a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* Jumping to a section shouldn't hide its heading under the top edge. */
[id] { scroll-margin-top: 1rem; }

/* ---------- Long-form rules text ---------- */
.prose h3 { font-size: 1.45rem; margin-top: 1.75rem; max-width: var(--measure); }
.prose h3:first-of-type { margin-top: 1rem; }
/* Long URLs (like the watershed map link) must wrap on phones
   instead of pushing the page sideways (WCAG 1.4.10 reflow). */
.prose a, .bio a { overflow-wrap: anywhere; }

/* ---------- Producer bio with photo ---------- */
.bio {
  display: grid;
  gap: 2rem 3rem;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 48rem) {
  .bio { grid-template-columns: minmax(14rem, 20rem) 1fr; }
}
.bio-photo,
.photo-slot {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
}
.photo-slot { /* temporary placeholder until the real photo is added */
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  background: var(--saddle);
  border: 2px dashed var(--rule);
  color: var(--muted);
}
.bio-text h3 { font-size: clamp(1.9rem, 4vw, 2.4rem); margin-top: 0; margin-bottom: 0.15em; }
.bio-meta { color: var(--muted); }

/* ---------- Placeholder text ----------
   Wrap unfinished content in <span class="todo">…</span> so it is easy to
   spot on screen and to search for before launch. Remove the span once the
   real content is in. */
.todo {
  background: rgba(163, 184, 255, 0.14);
  outline: 1px dashed var(--lake-light);
  padding: 0 0.2em;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 0;
  padding-block: 2.5rem 3rem;
  color: var(--muted);
  font-size: 1rem;
  /* a thin reprise of the horizon */
  border-top: 6px solid var(--lake);
  box-shadow: inset 0 6px 0 var(--saddle), inset 0 9px 0 var(--bone);
}
.site-footer ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  max-width: none;
}
.site-footer li + li { margin-top: 0; }
.site-footer a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ---------- Visitor preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Windows High Contrast / forced colours: keep the decorative horizon from
   becoming a solid block, and keep buttons visibly bordered. */
@media (forced-colors: active) {
  .horizon { forced-color-adjust: none; }
  .button { border: 2px solid ButtonText; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-nav, .skip-link, .horizon, .actions { display: none; }
  a { color: #000; }
}
