/* =========================================================
   OPZIONI DI ACCESSIBILITÀ - omaxi.net
   Pannello aperto dal pulsante in basso a sinistra.
   Ogni opzione aggiunge una classe al tag <html>; le scelte
   restano salvate sul dispositivo del visitatore (nessun cookie,
   nessun servizio esterno).
   ========================================================= */

@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-style: italic; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-italic.woff2") format("woff2"); }

/* ---------- Pulsante e pannello ---------- */
.a11y-apri {
  position: fixed; left: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 95;
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid #fff; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: #18434A; color: #fff; box-shadow: 0 8px 22px -8px rgba(12, 35, 40, .6);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.a11y-apri svg { width: 30px; height: 30px; }
.a11y-apri:hover { background: #0C2328; }
.a11y-apri:focus-visible, .a11y-pannello :focus-visible { outline: 3px solid #F9721D; outline-offset: 3px; }
@media (max-width: 600px) {
  .a11y-apri { left: 14px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; }
}

.a11y-pannello {
  position: fixed; left: 18px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); z-index: 96;
  width: min(340px, calc(100vw - 28px)); max-height: calc(100vh - 120px); overflow-y: auto;
  background: #fff; color: #1F1C19; border-radius: 14px; padding: 18px 18px 14px;
  box-shadow: 0 24px 60px -18px rgba(12, 35, 40, .55), 0 0 0 1px rgba(12, 35, 40, .08);
  font-family: "Poppins", system-ui, sans-serif; font-size: 15px; line-height: 1.4;
}
.a11y-pannello[hidden] { display: none; }
.a11y-pannello__testa { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.a11y-pannello__titolo { margin: 0; font-size: 18px; font-weight: 700; color: #18434A; font-family: inherit; letter-spacing: 0; }
.a11y-chiudi { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #1F1C19; font-size: 26px; line-height: 1; cursor: pointer; }
.a11y-chiudi:hover { background: #EEF2F2; }

.a11y-gruppo { margin: 0 0 12px; padding: 0; border: 0; }
.a11y-gruppo legend { padding: 0; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #4A4540; }
.a11y-misure { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.a11y-voce, .a11y-misura {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px;
  margin: 0 0 6px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid #D5DCDC; background: #F6F8F8; color: #1F1C19;
  font: inherit; font-size: 15px; font-weight: 500; text-align: left;
}
.a11y-misura { justify-content: center; margin: 0; font-weight: 700; }
.a11y-misura[data-livello="1"] { font-size: 17px; }
.a11y-misura[data-livello="2"] { font-size: 19px; }
.a11y-voce:hover, .a11y-misura:hover { border-color: #18434A; }
.a11y-voce[aria-pressed="true"], .a11y-misura[aria-pressed="true"] { background: #18434A; border-color: #18434A; color: #fff; }
.a11y-voce__segno { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; font-size: 13px; line-height: 1; }
.a11y-voce[aria-pressed="true"] .a11y-voce__segno::after { content: "✓"; }

.a11y-ripristina {
  width: 100%; min-height: 44px; margin: 6px 0 8px; border-radius: 999px; cursor: pointer;
  border: 0; background: #F9721D; color: #0C2328; font: inherit; font-weight: 700; font-size: 15px;
}
.a11y-ripristina:hover { background: #E8630F; }
.a11y-nota { margin: 0; font-size: 12.5px; color: #5E5852; }

/* Telefono: 100vh comprende anche lo spazio sotto le barre di Safari e Chrome,
   quindi uso svh (l'altezza visibile davvero) e un pannello più compatto:
   titolo e pulsante di chiusura restano sempre dentro lo schermo. */
@media (max-width: 600px) {
  .a11y-pannello {
    left: 10px; right: 10px; width: auto;
    bottom: calc(146px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100vh - 230px);
    max-height: calc(100svh - 170px);
    padding: 14px 14px 10px; font-size: 14px;
    overscroll-behavior: contain;
  }
  .a11y-pannello__testa { margin-bottom: 8px; }
  .a11y-pannello__titolo { font-size: 17px; }
  .a11y-gruppo { margin-bottom: 8px; }
  .a11y-voce, .a11y-misura { min-height: 42px; padding: 6px 10px; font-size: 14px; margin-bottom: 5px; }
  .a11y-misura { margin-bottom: 0; }
  .a11y-misura[data-livello="1"] { font-size: 16px; }
  .a11y-misura[data-livello="2"] { font-size: 18px; }
  .a11y-voce__segno { width: 20px; height: 20px; }
  .a11y-ripristina { min-height: 42px; margin: 4px 0 6px; font-size: 14px; }
}
/* telefono con schermo basso: il pannello parte dall'alto e scorre */
@media (max-width: 600px) and (max-height: 640px) {
  .a11y-pannello { top: 10px; bottom: auto; max-height: calc(100svh - 20px); }
}

/* =========================================================
   LE OPZIONI
   ========================================================= */

/* Testo più grande: ingrandisce il contenuto della pagina, che si ridispone da solo
   (la hero in cima resta com'è: è un'immagine composta e ingrandita uscirebbe dallo schermo) */
html.a11y-testo-1 :is(.com-content-article__body > :not(.ox-hero):not(.ox-ego):not(.ox-recensioni):not(.ox-chat), .ox-recensioni > :not(.ox-chat), .omx-loghi, .piede) { zoom: 1.15; }
html.a11y-testo-2 :is(.com-content-article__body > :not(.ox-hero):not(.ox-ego):not(.ox-recensioni):not(.ox-chat), .ox-recensioni > :not(.ox-chat), .omx-loghi, .piede) { zoom: 1.3; }
/* le recensioni sono impaginate in colonne, che con l'ingrandimento si rompono:
   lì cresce solo la dimensione delle lettere */
html.a11y-testo-1 .ox-chat__text { font-size: 1.1rem; }
html.a11y-testo-1 .ox-chat__who { font-size: 1.15rem; }
html.a11y-testo-1 .ox-chat__time { font-size: .88rem; }
html.a11y-testo-2 .ox-chat__text { font-size: 1.25rem; }
html.a11y-testo-2 .ox-chat__who { font-size: 1.3rem; }
html.a11y-testo-2 .ox-chat__time { font-size: 1rem; }

/* Contrasto più forte: testo quasi nero su fondo bianco, link marcati.
   Le fasce verdi scure, le hero e i pulsanti restano come sono (hanno già testo chiaro su fondo scuro). */
html.a11y-contrasto #sp-main-body :is(p, li, h1, h2, h3, h4, h5, h6, span, em, strong, b, i, mark, blockquote, figcaption, small, summary, td, th, div):not(.ox-fascia *):not(.ox-hero *):not(.ox-ego *):not(.ox-btn-libri):not(.ox-btn-libri *):not([class*="etichetta"]):not([class*="badge"]):not([class*="stato"]):not([class*="novita"]):not(.ox-card--psico *) {
  color: #111 !important;
}
html.a11y-contrasto #sp-main-body a:not(.ox-btn-libri):not(.ox-fascia a):not(.ox-hero a) { color: #7A2E00 !important; text-decoration: underline !important; }
html.a11y-contrasto .omx-loghi :is(h2, h3) { color: #111 !important; }
html.a11y-contrasto .piede { color: #fff; }
html.a11y-contrasto :is(.ox-test, .ox-card, .ox-chat__msg, .ox-programma, .ox-dettagli > *) { border-color: #111 !important; }

/* Carattere ad alta leggibilità (Atkinson Hyperlegible, disegnato per chi vede poco) */
html.a11y-font body,
html.a11y-font body *:not(svg):not(svg *):not(.a11y-apri) { font-family: "Atkinson Hyperlegible", Verdana, sans-serif !important; }

/* Più spazio tra righe, lettere e parole (valori delle linee guida WCAG 1.4.12) */
html.a11y-spazio #sp-main-body :is(p, li, blockquote, dd, summary) {
  line-height: 1.8 !important; letter-spacing: .06em !important; word-spacing: .16em !important;
}
html.a11y-spazio #sp-main-body p { margin-bottom: 1.4em !important; }

/* Righe più corte: il testo si raccoglie in una colonna centrata di circa 70 caratteri */
html.a11y-righe .com-content-article__body > :is(p, h1, h2, h3, h4, h5, h6, ul, ol) {
  max-width: 70ch; margin-left: auto !important; margin-right: auto !important;
}
html.a11y-righe .com-content-article__body > p.ox-libri-cta { max-width: none; text-align: center; }

/* Ferma le animazioni: tutto si ferma nella posizione finale, il nastro dei loghi resta fermo */
html.a11y-fermo *, html.a11y-fermo *::before, html.a11y-fermo *::after {
  animation-duration: .001ms !important; animation-delay: 0s !important;
  animation-iteration-count: 1 !important; transition-duration: 0s !important; transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
/* blocchi che compaiono man mano che scorri: visibili subito */
html.a11y-fermo :is(.ox-chat.is-ready .ox-chat__msg, .ox-mattoni.is-ready .ox-mattone, .ox-ancl.is-ready .ox-ancl__d1, .ox-ancl.is-ready .ox-ancl__d2, .ox-ancl.is-ready .ox-ancl__logo img, .ox-ancl.is-ready .ox-ancl__month, .ox-ancl.is-ready .ox-ancl__photo) {
  opacity: 1 !important; translate: none !important;
}
html.a11y-fermo .omx-loghi__nastro { flex-wrap: wrap; justify-content: center; width: auto !important; row-gap: 1.2rem; }
html.a11y-fermo .omx-loghi__nastro li[aria-hidden="true"] { display: none; }

/* Evidenzia i link: sottolineati e con un fondo leggero, così si riconoscono a colpo d'occhio */
html.a11y-link #sp-main-body a:not(.ox-btn-libri),
html.a11y-link .piede a {
  text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: .2em !important;
}
html.a11y-link #sp-main-body a:not(.ox-btn-libri):not(.ox-fascia a) { background: #FFF2C6 !important; color: #1F1C19 !important; }

/* Quando il pannello è aperto, su telefono il pulsante "torna su" non ci finisce sopra */
html.a11y-aperto .torna-su { opacity: 0 !important; pointer-events: none !important; }
