/* ==========================================================================
   Ups N Downtown — shared design tokens + base elements
   Mid-century Christmas: forest green, tomato red, gold, warm cream, orange.
   Colours are sampled from the event graphic (assets/ups-n-downtown-original.png).

   This file is self-contained: fonts, custom properties and base element
   styles only. No page layout lives here. See DESIGN.md for usage notes.
   ========================================================================== */

/* ---- Fonts (self-hosted, open licensed) -------------------------------- */
@font-face {
  font-family: "Abril Fatface";            /* SIL OFL 1.1 */
  src: url("/assets/fonts/abril-fatface-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Yellowtail";               /* Apache 2.0 */
  src: url("/assets/fonts/yellowtail-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";                     /* SIL OFL 1.1 — variable 400–700 */
  src: url("/assets/fonts/jost-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---- Palette: sampled from the graphic ------------------------------- */
  --cream:        #fffefa;  /* the graphic's own paper colour — page background */
  --cream-warm:   #f8edcb;  /* ornament cream — cards, panels */
  --blush:        #f4e2c7;  /* skater's skin tone — alternate section tint */
  --pine:         #1e361e;  /* banner/ink green — text, darkest surfaces */
  --emerald:      #026036;  /* headline green — primary brand colour */
  --sage:         #5d7552;  /* dress green — muted accents */
  --sage-ink:     #4a5f44;  /* sage darkened for small text on cream */
  --red:          #dd4125;  /* tomato red — DECORATION and large type only */
  --red-ink:      #b52e16;  /* tomato darkened: AA for text + button fills */
  --gold:         #c39a45;  /* starburst gold — DECORATION only on light bg */
  --gold-light:   #e3c275;  /* gold for text/lines on pine + emerald */
  --gold-ink:     #7a5c16;  /* gold darkened: AA for small text on cream */
  --orange:       #fd8829;  /* orange-slice — highlights, "today" */

  /* ---- Semantic roles --------------------------------------------------- */
  --bg:           var(--cream);
  --surface:      var(--cream-warm);
  --text:         var(--pine);
  --text-muted:   var(--sage-ink);
  --link:         var(--emerald);
  --link-hover:   var(--red-ink);
  --accent:       var(--red-ink);
  --border:       #d9cba4;            /* hairline on cream */
  --border-strong: var(--pine);
  --focus:        var(--orange);

  /* Status colours for the volunteer app (text on tint, all AA) */
  --status-need-bg:    #fbdcd2;  --status-need-fg:    #8f2410;
  --status-covered-bg: #d5e8d8;  --status-covered-fg: #025430;
  --status-full-bg:    #e7e2d0;  --status-full-fg:    #3f4a3a;

  /* ---- Typography -------------------------------------------------------- */
  --font-display: "Abril Fatface", "Bodoni 72", "Didot", "Playfair Display", Georgia, serif;
  --font-script:  "Yellowtail", "Brush Script MT", "Segoe Script", cursive;
  --font-body:    "Jost", "Futura", "Century Gothic", "Avenir Next", "Trebuchet MS", sans-serif;

  --text-xs:   0.8125rem;                         /* 13px */
  --text-sm:   0.9375rem;                         /* 15px */
  --text-base: 1.0625rem;                         /* 17px */
  --text-lg:   clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  --text-xl:   clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --text-2xl:  clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --text-3xl:  clamp(2.125rem, 1.5rem + 3vw, 3.5rem);
  --text-4xl:  clamp(2.5rem, 1.6rem + 4.6vw, 4.75rem);

  --leading-tight: 1.08;
  --leading-snug:  1.3;
  --leading-body:  1.55;
  --tracking-caps: 0.14em;

  /* ---- Spacing (4px base) ------------------------------------------------ */
  --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;
  --space-9: 6rem;

  /* ---- Shape ------------------------------------------------------------- */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   22px;
  --radius-pill: 999px;

  /* Flat, offset "print" shadows — no blur — plus one soft lift */
  --shadow-hard-sm: 2px 2px 0 var(--pine);
  --shadow-hard:    4px 4px 0 var(--pine);
  --shadow-hard-lg: 7px 7px 0 var(--pine);
  --shadow-soft:    0 10px 30px -12px rgb(30 54 30 / 0.35);

  --border-width: 2px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--space-4);
  color: var(--heading, var(--emerald));
  line-height: var(--leading-tight);
  text-wrap: balance;
}
h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;              /* Abril Fatface is a single, already-fat weight */
  letter-spacing: 0.005em;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: var(--leading-snug);
}
h4 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
}

p { margin: 0 0 var(--space-4); text-wrap: pretty; }
strong, b { font-weight: 700; }
small { font-size: var(--text-sm); }

a {
  color: var(--link);
  font-weight: 600;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--gold);
  text-underline-offset: 0.18em;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

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

img, svg { max-width: 100%; height: auto; }

hr {
  border: 0;
  border-top: var(--border-width) solid var(--border);
  margin: var(--space-6) 0;
}

::selection { background: var(--emerald); color: var(--cream); }

/* ---- Buttons --------------------------------------------------------------
   .btn            neutral cream button with pine ink
   .btn--primary   tomato fill — the one main action per view
   .btn--ghost     outline only; inherits currentColor so it works on dark too
   .btn--cream     cream fill for use on red / green bands
   ------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--cream-warm);
  --btn-fg: var(--pine);
  --btn-border: var(--pine);
  --btn-shadow: var(--pine);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 3rem;                       /* comfortable touch target */
  padding: 0.7em 1.5em;
  border: var(--border-width) solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: 0 4px 0 var(--btn-shadow);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out),
              background-color 0.15s, color 0.15s;
}
.btn:hover {
  color: var(--btn-fg);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--btn-shadow);
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--btn-shadow);
}
.btn:focus-visible { border-radius: var(--radius-pill); }
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 0 var(--btn-shadow);
}

.btn--primary {
  --btn-bg: var(--red-ink);
  --btn-fg: var(--cream);
}
.btn--primary:hover { --btn-bg: #a22812; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: currentColor;
  --btn-border: currentColor;
  box-shadow: none;
  color: inherit;
}
.btn--ghost:hover {
  box-shadow: none;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.btn--ghost:active { box-shadow: none; transform: translateY(1px); }

.btn--cream {
  --btn-bg: var(--cream);
  --btn-fg: var(--pine);
}

.btn--sm {
  min-height: 2.5rem;
  padding: 0.5em 1.1em;
  font-size: var(--text-sm);
}

/* ---- Dark surfaces ---------------------------------------------------------
   Put .on-dark on any pine / emerald / red-ink container: text, headings and
   links flip to cream, and the script accent to light gold.
   ------------------------------------------------------------------------- */
.on-dark {
  color: var(--cream);
  --text: var(--cream);
  --text-muted: #d9e3d2;
  --heading: var(--cream);
  --link: var(--cream);
  --link-hover: var(--gold-light);
  --border: rgb(255 254 250 / 0.28);
}
.on-dark .script { color: var(--gold-light); }

/* ---- Small shared type helpers -------------------------------------------- */
.script {                                   /* brush-script accent line */
  font-family: var(--font-script);
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--red-ink);
}
.overline {                                 /* spaced small caps label */
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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