/* Accessibility features that work with any colour scheme */

/* Text sizes scale with the "Larger text" (A+) button */
body { font-size: 1rem; }
html.big { font-size: 120%; }

/* Text for screen readers only (e.g. "A+ Larger text" is read out, "A+" is shown) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header buttons: A+ and Cymraeg */
.hdr-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.hdr-actions .lang-btn { margin-left: 0; }
.lang-btn[aria-pressed="true"] { background: var(--on-pine); color: var(--pine); }
@media (max-width: 420px) {
  .mark { display: none; }
  .bar h1 { font-size: 1.15rem; }
}

/* Outlines of controls must stand out at least 3:1 from the background.
   The pale "line" colour (about 1.3:1) is fine for dividers but not for buttons and boxes. */
.tab { border-color: var(--muted); }                       /* route buttons (unselected) */
.btn.secondary { border-color: var(--muted); }             /* "Clear Santa from the map" */
.field input, .field select { border-color: var(--muted); } /* driver sign-in and route boxes */
.leaflet-touch .leaflet-bar, .leaflet-container .leaflet-bar { border: 2px solid rgba(0, 0, 0, 0.6); } /* zoom buttons */
/* In dark mode the selected route button's dark fill would melt into the dark card,
   so it gets a white edge there */
@media (prefers-color-scheme: dark) {
  .tab[aria-pressed="true"] { border-color: var(--on-pine); }
}

/* Stops already passed are crossed out, not just greyed, so it doesn't rely on colour */
.stops li.past span { text-decoration: line-through; }

/* "Skip to Santa's status and timetable": hidden until a keyboard user presses Tab,
   then it appears at the top so they can jump past the map */
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 2000;
  background: var(--surface); color: var(--ink);
  padding: 10px 14px; border-radius: 10px; font-weight: 800;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.skip-link:focus { top: max(12px, env(safe-area-inset-top, 0px)); }

/* One clear, high-contrast focus ring for everything you can Tab to */
.btn:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible,
.linkbtn:focus-visible, .skip-link:focus-visible, .foot a:focus-visible,
.leaflet-container .leaflet-bar a:focus-visible,
.leaflet-container .leaflet-control-attribution a:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px;
}
.bar .lang-btn:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
/* The map itself can be focused and moved with the arrow keys */
.leaflet-container:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
/* Places focus is sent to by the page (skip link, status card) don't need a ring */
#panel:focus, #status:focus { outline: none; }
