/* ============================================================
   JurySheet — shared foundation
   Ported from the audition app's apu.css (APU brand tokens per
   docs/style-guide/APU-Web-Style-Guide.md), behind institution-
   agnostic --brand-* tokens. Per planning/DIRECTION.md: "Branding
   behind tokens from day one" — colours and fonts live only in
   this :root block, so re-skinning for another institution later
   is a settings change, not a rewrite. Every rule below references
   var(--brand-*) only; no raw hex/named colors appear outside
   this block.
   ============================================================ */

:root {
  color-scheme: light;

  /* ------------------------------------------------------------
     Brand tokens (current skin: APU). Each is commented with the
     v1 apu.css name it replaces.
     ------------------------------------------------------------ */

  /* ← v1 --brick: accent, CTAs, links, focus ring */
  --brand-primary:      #A8353A;
  /* ← v1 --brick-dim: primary hover/active state */
  --brand-primary-dim:  #8C2C30;
  /* ← v1 --brick-wash: light tint for selected/notice backgrounds */
  --brand-primary-wash: #F6EBEB;

  /* ← v1 --ink: screen-softened body text. Pure black is print-only. */
  --brand-ink:    #1A1718;
  /* ← v1 --black: reserved for print */
  --brand-black:  #000000;

  /* ← v1 --bone: page background */
  --brand-paper:   #F5F5F5;
  /* ← v1 --white: card/input/surface background */
  --brand-surface: #FFFFFF;

  /* ← v1 --taupe: muted accent (quiet-notice border) */
  --brand-muted:  #C5B8A8;
  /* ← v1 --gray-light: hairline borders */
  --brand-line:   #D3D3D3;
  /* ← v1 --gray-dark: secondary/eyebrow text, quiet borders on hover */
  --brand-subtle: #666666;

  /* ← v1 --serif / --sans / --mono, unchanged */
  --brand-serif: "Minion Pro", "Times New Roman", Georgia, serif;
  --brand-sans:  "Helvetica Neue LT Pro", "Helvetica Neue", "Proxima Nova", Arial, sans-serif;
  --brand-mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* ------------------------------------------------------------
     Legacy v1 names, aliased to the brand tokens above. Kept so
     that any page markup/CSS ported from the audition app (which
     references --brick, --bone, --ink, --s2, etc. directly) keeps
     working unmodified. Not referenced by the component rules
     below — those use --brand-* directly.
     ------------------------------------------------------------ */
  --brick:      var(--brand-primary);
  --brick-dim:  var(--brand-primary-dim);
  --brick-wash: var(--brand-primary-wash);
  --ink:        var(--brand-ink);
  --black:      var(--brand-black);
  --bone:       var(--brand-paper);
  --white:      var(--brand-surface);
  --taupe:      var(--brand-muted);
  --gray-light: var(--brand-line);
  --gray-dark:  var(--brand-subtle);
  --serif: var(--brand-serif);
  --sans:  var(--brand-sans);
  --mono:  var(--brand-mono);

  --s1: 0.25rem; --s2: 0.5rem;  --s3: 0.75rem; --s4: 1rem;
  --s5: 1.5rem;  --s6: 2rem;    --s7: 3rem;    --s8: 4rem;

  --radius: 6px;
  --line: 1px solid var(--brand-line);
  --focus: 3px solid var(--brand-primary);
}

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

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

body {
  margin: 0;
  font-family: var(--brand-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--brand-ink);
  background: var(--brand-paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--brand-serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--brand-ink);
}

h1 { font-size: 1.875rem; letter-spacing: -0.01em; }
h2 { font-size: 1.3125rem; }
h3 { font-size: 1.0625rem; }

p { margin: 0 0 var(--s4); }

a { color: var(--brand-primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }

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

/* --- eyebrow: small caps label above a heading ------------- */
.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--brand-subtle);
  margin: 0 0 var(--s2);
}

.data { font-family: var(--brand-mono); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

/* --- page shell -------------------------------------------- */
.shell { max-width: 34rem; margin: 0 auto; padding: var(--s5) var(--s4) var(--s8); }
.shell--wide { max-width: 72rem; }

.masthead { border-bottom: 3px solid var(--brand-primary); padding-bottom: var(--s3); margin-bottom: var(--s6); }
.masthead h1 { margin-bottom: var(--s1); }
.masthead p { color: var(--brand-subtle); margin: 0; font-size: 0.9375rem; }

/* --- card --------------------------------------------------- */
.card {
  background: var(--brand-surface);
  border: var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
}

/* --- buttons ------------------------------------------------ */
.btn {
  font-family: var(--brand-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--brand-subtle);
  border-radius: var(--radius);
  background: var(--brand-surface);
  color: var(--brand-ink);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--brand-paper); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-surface); }
.btn--primary:hover { background: var(--brand-primary-dim); border-color: var(--brand-primary-dim); }
.btn--primary:disabled:hover { background: var(--brand-primary); }

.btn--quiet { border-color: transparent; background: transparent; color: var(--brand-subtle); padding: 0.5rem; }
.btn--quiet:hover { background: var(--brand-paper); color: var(--brand-ink); }

.btn--danger { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn--danger:hover { background: var(--brand-primary-wash); }

/* --- form fields -------------------------------------------- */
.field { margin-bottom: var(--s5); }

.field__label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--s2);
}
.field__hint { display: block; font-weight: 400; color: var(--brand-subtle); font-size: 0.8125rem; margin-top: 2px; }

.field__input {
  width: 100%;
  font-family: var(--brand-sans);
  font-size: 1rem;
  padding: 0.6875rem 0.75rem;
  border: 1px solid var(--brand-subtle);
  border-radius: var(--radius);
  background: var(--brand-surface);
  color: var(--brand-ink);
}
.field__input:focus-visible { outline: var(--focus); outline-offset: 1px; }
.field__input--mono { font-family: var(--brand-mono); font-variant-numeric: tabular-nums; }

textarea.field__input { line-height: 1.5; resize: vertical; min-height: 6rem; }

.field__error {
  display: block;
  color: var(--brand-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: var(--s2);
}
.field--invalid .field__input { border-color: var(--brand-primary); border-width: 2px; }

/* --- choice list (radio / checkbox rows) -------------------- */
.choices { display: grid; gap: var(--s2); }

.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: 0.6875rem 0.875rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  background: var(--brand-surface);
  cursor: pointer;
}
.choice:hover { border-color: var(--brand-subtle); }
.choice input { margin: 0.2rem 0 0; accent-color: var(--brand-primary); flex: none; }
.choice__label { font-size: 0.9375rem; font-weight: 600; }
.choice__blurb { display: block; font-weight: 400; color: var(--brand-subtle); font-size: 0.8125rem; }
.choice:has(input:checked) { border-color: var(--brand-primary); background: var(--brand-primary-wash); }
.choice:has(input:focus-visible) { outline: var(--focus); outline-offset: 2px; }

/* --- grouped-choice grid (e.g. instrument picker) ------------ *
 * Generic 2-up tile grid for a `choice` field rendered as icon
 * tiles rather than a list — used wherever an intake field's
 * options come with glyphs (see shared/glyphs.js). Tile order is
 * whatever order the event's intake definition lists the options
 * in; this module fixes no order of its own.
 * ------------------------------------------------------------ */
.chairs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }

.chair {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  padding: var(--s4) var(--s2);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  background: var(--brand-surface);
  cursor: pointer;
  text-align: center;
  color: var(--brand-subtle);
}
.chair:hover { border-color: var(--brand-subtle); color: var(--brand-ink); }
.chair input { position: absolute; opacity: 0; pointer-events: none; }
.chair__glyph { width: 32px; height: 32px; }
.chair__name { font-size: 0.9375rem; font-weight: 600; color: var(--brand-ink); }
.chair:has(input:checked) { border-color: var(--brand-primary); border-width: 2px; background: var(--brand-primary-wash); color: var(--brand-primary); }
.chair:has(input:focus-visible) { outline: var(--focus); outline-offset: 2px; }

/* --- status / notice ---------------------------------------- */
.notice {
  border-left: 3px solid var(--brand-primary);
  background: var(--brand-primary-wash);
  padding: var(--s3) var(--s4);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9375rem;
}
.notice--quiet { border-left-color: var(--brand-muted); background: var(--brand-surface); color: var(--brand-subtle); }

.empty { color: var(--brand-subtle); font-style: italic; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

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