/* Font ospitato in locale: nessuna richiesta verso servizi esterni */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/shared/fonts/atkinson-next-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/shared/fonts/atkinson-next-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Palette: "carta" di giorno, "blu notte" in sala buia.
 * Il giallo è il segnale della diretta (omaggio ai sottotitoli di Televideo, pagina 777).
 */
:root {
  --paper: #fafaf7;
  --ink: #1b2433;
  --ink-soft: #5b6577;
  --rule: #d9dde4;
  --live: #ffe14d;
  --live-ink: #1b2433;
  --signal-on: #1f9d55;
  --signal-off: #c2410c;
  --focus: #2563eb;
  --surface: #ffffff;
  --brand: #00379e;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12213a;
    --ink: #eef1f6;
    --ink-soft: #9aa6ba;
    --rule: #2b3d5c;
    --live: #ffd93d;
    --live-ink: #12213a;
    --signal-on: #4ade80;
    --signal-off: #fb923c;
    --focus: #93c5fd;
    --surface: #182a47;
    --brand: #a8c0ff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #12213a;
  --ink: #eef1f6;
  --ink-soft: #9aa6ba;
  --rule: #2b3d5c;
  --live: #ffd93d;
  --live-ink: #12213a;
  --signal-on: #4ade80;
  --signal-off: #fb923c;
  --focus: #93c5fd;
  --surface: #182a47;
  --brand: #a8c0ff;
  color-scheme: dark;
}

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

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

/* l'attributo hidden deve vincere anche sugli elementi a cui il CSS assegna un display */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

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

/* logo RD: il PNG fa da maschera, così il colore segue il tema (blu Maggioli o tinta chiara) */
.brand-mark {
  display: inline-block;
  flex: none;
  height: 1.5rem;
  aspect-ratio: 512 / 284;
  background-color: var(--brand);
  -webkit-mask: url(/shared/logo.png) center / contain no-repeat;
  mask: url(/shared/logo.png) center / contain no-repeat;
}

/* gruppo di pulsanti affiancati (lingue, dimensione del testo, tema) */
.segmented {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  overflow: hidden;
}

.segmented button {
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 650;
}

.segmented button + button {
  border-left: 1px solid var(--rule);
}

.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
