/* Cedar Dale design tokens and element defaults.
   Components in site.css and admin.css use only these tokens. */

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-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-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  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;
}

:root {
  /* Colour: drawn from the place (design pass, 2026-09-24).
     Pond: the deep blue-green of the upper dam in shade. Stone: the grey of
     the Reed Run creek bed, for the page and quiet bands. Wood: the brown of
     the clubhouse siding and porch, for rules, dates and small labels.

     Accent: brook-trout red, the one colour for primary buttons and the
     Support button in the menu. Chosen against the real photos: the 1988
     sunset dams, the porch group and the binder covers sit at hue 24 to 35
     degrees (amber, tan, brown; sampled from the originals), so a trout
     orange would sink into them. The red lettering on the club's own binder
     measures #ca472f at hue 9 degrees; the accent is that red, deepened until
     white text on it passes AA (6.6:1). It reads as the club's red, not as
     a warning, and stands apart from every photo it sits beside. */
  --color-bg: #f3f5f2;          /* creek stone, pale */
  --color-stone: #e5e9e5;       /* creek stone, a shade deeper: quiet bands */
  --color-surface: #ffffff;
  --color-text: #16201d;
  --color-muted: #4e5753;
  --color-border: #c8cfca;
  --color-pond: #1d4640;
  --color-pond-text: #f3f5f2;
  --color-wood: #7a4a28;
  --color-link: #1a5a52;
  --color-accent: #a8321e;
  --color-accent-hover: #86260f;
  --color-on-accent: #ffffff;
  /* Focus: a deep amber ring on light pages, a pale gold ring on the dark
     bands (header, hero, closing band), each at least 3:1 against what it
     sits on. */
  --color-focus: #a85600;
  --color-focus-on-dark: #ffc857;
  --color-notice-bg: #e3efe9;
  --color-error: #9e2a1c;
  --color-error-bg: #fbeae6;
  /* Archive prints sit on a paper mount: off-white card, a soft edge. */
  --color-paper: #fbf9f4;
  --color-paper-edge: #d9d3c4;

  /* Type. Source Serif 4 for headings (a book face with a hint of the
     typescript history); Atkinson Hyperlegible for everything read. Scale:
     a major third (1.25) from 18px on phones and 19px on desktop. */
  --font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --text-sm: 1rem;
  --text-base: 1.125rem;   /* 18px on phones */
  --text-lg: 1.3125rem;
  --text-xl: 1.625rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --text-4xl: 2.75rem;     /* the club's name over the hero photo */
  --leading-body: 1.6;
  --leading-heading: 1.2;
  --measure: 66ch;

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --gutter: 16px;
  --max-width: 72rem;
  --tap-target: 44px;

  /* Shape: real corners, small. Buttons and cards share one radius; nothing
     is a pill. */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --border-width: 1px;
  --shadow-card: 0 1px 2px rgb(22 32 29 / 0.10), 0 3px 10px rgb(22 32 29 / 0.05);
}

@media (min-width: 768px) {
  :root {
    --text-base: 1.1875rem;  /* 19px on desktop */
    --text-2xl: 2.25rem;
    --text-3xl: 3rem;
    --text-4xl: 4rem;
    --gutter: 24px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #111a18;
    --color-stone: #16211e;
    --color-surface: #1a2623;
    --color-text: #e8ede9;
    --color-muted: #aab5af;
    --color-border: #34443f;
    --color-pond: #0d2b27;
    --color-pond-text: #e8ede9;
    --color-wood: #d6a57c;
    --color-link: #8fd0c4;
    --color-accent: #eb8468;
    --color-accent-hover: #f39d85;
    --color-on-accent: #111a18;
    --color-focus: #ffc857;
    --color-focus-on-dark: #ffc857;
    --color-notice-bg: #1f3a33;
    --color-error: #f19a86;
    --color-error-bg: #3a1f1a;
    --color-paper: #262c28;
    --color-paper-edge: #454d47;
    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  overflow-wrap: break-word;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--leading-heading);
  color: var(--color-text);
  margin: 0 0 var(--space-4);
}
h1 { font-size: var(--text-3xl); letter-spacing: -0.01em; line-height: 1.1; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.005em; }
h3 { font-size: var(--text-xl); }

p, ul, ol, address { margin: 0 0 var(--space-4); }
address { font-style: normal; white-space: pre-line; }

/* Heading rhythm in running text: more space above a heading than below,
   so each heading belongs to what follows it. */
:is(p, ul, ol, blockquote, figure, address) + h2 { margin-top: var(--space-7); }
:is(p, ul, ol, blockquote, figure, address) + h3 { margin-top: var(--space-6); }
:is(.era__years, .eyebrow, .kicker, .hero__eyebrow) + :is(h1, h2, h3) { margin-top: 0; }

a { color: var(--color-link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

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

/* Focus: one visible ring everywhere, never the browser default. On the dark
   bands the ring turns pale gold (see --color-focus-on-dark). */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}
.site-header :focus-visible, .admin-header :focus-visible, .hero :focus-visible, .on-dark :focus-visible {
  outline-color: var(--color-focus-on-dark);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip-link:focus { top: var(--space-2); }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.prose { max-width: calc(var(--measure) + 2 * var(--gutter)); margin-left: 0; }
/* A page that is all prose (Contact, Membership, Privacy, thank-you and error
   pages) lines up with the header and footer; its text keeps the measure. */
.container.prose { max-width: var(--max-width); margin-left: auto; }
.container.prose > * { max-width: var(--measure); }
.lead { font-size: var(--text-lg); }

/* Club name in the header band (public and admin) */
.site-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-lg);
  color: inherit;
  text-decoration: none;
  line-height: var(--leading-heading);
  max-width: 14em;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-5);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
/* Primary: the one accent. Secondary: an outline in the link colour. */
.button--primary { background: var(--color-accent); color: var(--color-on-accent); }
.button--primary:hover { background: var(--color-accent-hover); }
.button--secondary { background: transparent; color: var(--color-link); border-color: currentColor; }
.button--secondary:hover { background: var(--color-surface); }
.button--wide { width: 100%; }

/* Menu that collapses on phones without JavaScript: a checkbox and label. */
.nav-toggle {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.nav-toggle-label {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-4);
  border: 2px solid currentColor;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}
.nav-toggle:focus-visible + .nav-toggle-label { outline: 3px solid var(--color-focus-on-dark); outline-offset: 3px; }
.nav-list { display: none; list-style: none; margin: 0; padding: 0; }
.nav-toggle:checked ~ .nav-list { display: block; }
.nav-link {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: var(--space-2) var(--space-2);
  color: inherit;
  font-size: var(--text-lg);
  text-decoration: none;
}
.nav-link[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; }

@media (min-width: 768px) {
  .nav-toggle-label { display: none; }
  .nav-list, .nav-toggle:checked ~ .nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
  }
  .nav-link { min-height: var(--tap-target); font-size: var(--text-base); }
}

/* Notices and forms (shared by public forms and the admin) */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-notice-bg);
  border-left: 4px solid var(--color-pond);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-5);
}
.form { max-width: 40rem; }
.field { margin: 0 0 var(--space-5); }
.field label { display: block; font-weight: 700; line-height: 1.35; margin-bottom: var(--space-1); }
.field input[type="text"], .field input[type="password"], .field input[type="email"],
.field input[type="tel"], .field input[type="url"], .field textarea {
  display: block;
  width: 100%;
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-3);
  font: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { border-color: var(--color-link); }
.field input[readonly] { background: var(--color-bg); color: var(--color-muted); }
.field--check { display: flex; align-items: center; gap: var(--space-3); }
.field--check input { width: 28px; height: 28px; margin: 0; flex: none; }
.field--check label { margin: 0; font-weight: 400; }
.help { color: var(--color-muted); font-size: var(--text-sm); margin: 0 0 var(--space-2); }
.form-error, .field-error {
  color: var(--color-error);
  background: var(--color-error-bg);
  border-left: 4px solid var(--color-error);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-weight: 700;
}
.field-error { margin: 0 0 var(--space-2); }
.field--error input, .field--error textarea { border-color: var(--color-error); }

/* Banner (hero) tokens: the deep-water gradient used when there is no photo,
   and the scrims that keep text readable over a photo. --color-scrim sits
   right behind the words and is strong enough over a white photo
   (tests/test_hero_contrast.py); --color-scrim-soft shades the rest. */
:root {
  --color-hero-deep: #0f2d29;
  --color-hero-mid: #1e4a45;
  --color-hero-shallow: #3a6b61;
  --color-hero-text: #f4f6f3;
  --color-hero-muted: #cfe0d9;
  --color-scrim: rgb(8 20 18 / 0.8);
  --color-scrim-soft: rgb(8 20 18 / 0.25);
  --color-ripple: rgb(244 246 243 / 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-hero-deep: #071715;
    --color-hero-mid: #0f2d29;
    --color-hero-shallow: #24473f;
  }
}

/* The hidden attribute always wins, so a rich-text editor can hide its raw textarea
   on every admin form, not only the ones with their own stylesheet. */
[hidden] { display: none !important; }
