/* =========================================================================
   Sarauta — accessibility layer (WCAG 2.2 AA). Loads last.
   1. Colour tokens: text-safe accents and fill colours that hold 4.5:1
   2. Brand fills in dark mode keep white text readable
   3. Target size (2.5.8), focus visibility (2.4.7, 2.4.11), reduced motion
   ========================================================================= */

/* 1. Tokens ---------------------------------------------------------------
   The old gold #C77A1E only reached 3.4:1 on white, so light mode uses a deeper ochre
   (#9A5B12, 5.4:1) for text and fills. Crown plum, red and green already pass.
   Fill tokens are the colours used behind white text in both modes. */
:root{
  --gold:#9A5B12;
  --crown-fill:#9B3A97; --red-fill:#B8312A; --green-fill:#2C6A56; --gold-fill:#9A5B12;
  --on-fill:#FFFFFF;
  --focus:#9B3A97;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--gold:#EBA955;--focus:#F0B8EC}}
:root[data-theme="dark"]{--gold:#EBA955;--focus:#F0B8EC}

/* 2. Brand fills behind white text: always the deep tone, in light and dark */
.btn.crown,.wire .lbl,.chip,.status.now,.letter,.evcta,.wletter,.tm-av{background-color:var(--crown-fill);color:var(--on-fill)}
.btn.crown{border-color:var(--crown-fill)}
.btn.crown:hover{background-color:#82307E;border-color:#82307E}
.tm-card:nth-child(4n+2) .tm-av{background-color:var(--green-fill)}
.tm-card:nth-child(4n+3) .tm-av{background-color:var(--gold-fill)}
.tm-card:nth-child(4n+4) .tm-av{background-color:var(--red-fill)}
.tm-av.photo{background:none}
.opt.right .k{background-color:var(--green-fill);color:#fff}
.opt.wrong .k{background-color:var(--red-fill);color:#fff}
.wire .lbl small{color:#fff;opacity:1}

/* Series and pillar accents used as small text: mix toward the text colour so
   any accent the editor picks stays readable in both modes. */
.sday{color:color-mix(in srgb,var(--gc,var(--crown)) 62%,var(--fg))}

/* 3a. Target size: menu arrows grow to 24px without moving the menu */
.ddb{width:24px;height:24px;margin:-3px}
.ddb svg{width:12px;height:12px}

/* 3b. Focus: one visible ring everywhere (3px, offset), never removed */
:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.ddb:focus-visible{outline:3px solid var(--focus);outline-offset:1px}
.letter :focus-visible,.evcta :focus-visible,.wletter :focus-visible,footer.sf :focus-visible,.slider :focus-visible{outline-color:#fff}
/* Sticky header must not hide the focused element (2.4.11) */
html{scroll-padding-top:88px}

/* Skip link (theme and prototype) */
.skip-link{position:absolute;left:12px;top:-60px;z-index:10000;background:var(--fg);color:var(--bg);padding:10px 16px;border-radius:8px;font-weight:700;text-decoration:none}
.skip-link:focus{top:12px}

/* 3c. Reduced motion: stop looping and decorative animation */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
  .kb,.pan{animation:none!important;transform:none!important}
}

/* Colour tiles (film and story placeholders): a slightly deeper shade of the
   chosen colour so white captions hold 4.5:1; captions at full opacity. */
.tile{background:color-mix(in srgb,var(--tc,#2C6A56) 78%,#000)}
.tile .ts{opacity:1;font-size:11px}

/* Small labels: an 11px floor so tracked capitals and credits stay legible */
.credit,.slide .fmt,.wire .lbl small,.track a b,.lab .f,.lab .c,.status,.day h3 .chip,.slot .soon,dl dt,.sday,.tab .k,.tile .ts{font-size:11px!important}
@media (min-width:641px){.slide .fmt,.lab .f,.lab .c{font-size:11.5px!important}}
@media (max-width:640px){.daypick .t{font-size:11px!important}}
