/* Mantic — the theme's side of the accessibility panel (cd-accessibilita 1.0, LEGGIMI.md «Il patto con il tema»; model:
   La Fraschetta and UniHouse). The theme declares cd-a11y-testo, cd-a11y-contrasto, cd-a11y-semplice and cd-a11y-lettura
   (functions.php) and styles them here; every choice changes something you can see. Colours of the button and panel, and of
   the cookie banner, are in base.css («Common modules»). The scroll effects (movimento.js) write inline styles: the rules
   that stop them use !important on purpose. */

/* ── text size: the type tokens grow (they are in px), and with them the root size, so the titles in rem grow too.
      The few sizes written in px in base.css and in cd-recensioni follow the same factor. ── */
html.cd-a11y-testo-grande { --a11y-k: 1.15; }
html.cd-a11y-testo-molto { --a11y-k: 1.3; }
html.cd-a11y-testo {
  --t-base: calc(16px * var(--a11y-k)); --t-piccolo: calc(14px * var(--a11y-k)); --t-grande: calc(18px * var(--a11y-k));
  --t-piede: calc(20px * var(--a11y-k)); --t-titolo-scheda: calc(24px * var(--a11y-k));
}
html.cd-a11y-testo .barra :is(a, button) { font-size: calc(12px * var(--a11y-k)); }
html.cd-a11y-testo .piede-telefono { font-size: calc(13px * var(--a11y-k)); }
html.cd-a11y-testo .riquadro__link { font-size: calc(16px * var(--a11y-k)); }
html.cd-a11y-testo :is(.menu-sito__menu a, .carta__nav) { font-size: calc(20px * var(--a11y-k)); }
html.cd-a11y-testo .cd-rec__nome { font-size: calc(22px * var(--a11y-k)); }
html.cd-a11y-testo .cd-rec__testo { font-size: calc(15px * var(--a11y-k)); }
html.cd-a11y-testo :is(.cd-rec__data, .cd-rec__avviso, .cd-rec__tradotta) { font-size: calc(13px * var(--a11y-k)); }
@media (max-width: 959.98px) {   /* from 960 px these titles are in rem and already grow with the root */
  html.cd-a11y-testo :is(.copertina__titolo, .fascia-titolo h1) { font-size: calc(25.5px * var(--a11y-k)); }
}
@media (min-width: 960px) {
  html.cd-a11y-testo .pagina-semplice h1 { font-size: calc(40px * var(--a11y-k)); }
  html.cd-a11y-testo .menu-sito__info { font-size: calc(15px * var(--a11y-k)); }
}
/* Bigger text on a narrow phone: long words and addresses wrap instead of pushing the page sideways */
html:is(.cd-a11y-testo, .cd-a11y-spazi) body { overflow-wrap: anywhere; }

/* ── high contrast: black text on white, darker bordeaux and green (white on them 9:1 or more), dark veils on the photos ── */
html.cd-a11y-contrasto {
  --testo: #000; --testo-forte: #000; --terra: #4a362d; --terra-testo: #4a362d;
  --bordeaux: #6b3236; --bordeaux-scuro: #4f2427; --verde: #1b5444; --grigio-caldo: #efe9e4;
}
html.cd-a11y-contrasto body { background: #fff; color: #000; }
html.cd-a11y-contrasto main a:not(.pulsante, .riquadro, .wp-block-button__link) { text-decoration-line: underline; }
html.cd-a11y-contrasto .titolo-riga::before, html.cd-a11y-contrasto .titolo-riga::after { border-bottom-color: #000; }
html.cd-a11y-contrasto :is(.cerca, .menu-sito__orari) { border-bottom-color: #000; }
html.cd-a11y-contrasto .carta__indice li + li { border-left-color: #000; }
html.cd-a11y-contrasto .barra { border-top-color: #000; }
html.cd-a11y-contrasto .riquadro__testo { background: rgba(0, 0, 0, .72); }
html.cd-a11y-contrasto .copertina::after { content: ""; background: rgba(0, 0, 0, .62); mix-blend-mode: normal; }
html.cd-a11y-contrasto .fascia-titolo { background: var(--bordeaux); }
html.cd-a11y-contrasto .apertura::after { background: rgba(0, 0, 0, .55); }
html.cd-a11y-contrasto .cd-rec { --cd-rec-verde: #1b5444; --cd-rec-bordeaux: #6b3236; }
html.cd-a11y-contrasto .cd-rec__punto { background-color: #6b6b6b; }
html.cd-a11y-contrasto .cd-rec__punto[aria-current="true"] { background-color: var(--cd-rec-bordeaux); }
html.cd-a11y-contrasto :is(.cd-rec__avviso, .cd-rec__google) { color: #000; }

/* ── less motion and simplified page: the scroll effects of movimento.js stop where they are written (parallax, sticky,
      columns of the menus) and what fades in is simply there; the home video stops (assets/js/tema.js) ── */
html:is(.cd-a11y-fermo, .cd-a11y-semplice) :is([data-parallax], [data-sticky], [data-griglia-parallax] > *) {
  transform: none !important; opacity: 1 !important; filter: none !important;
}
html:is(.cd-a11y-fermo, .cd-a11y-semplice) .comparsa { opacity: 1 !important; }

/* ── simplified page: one column, plain backgrounds instead of video and photos behind titles, no fixed bars ── */
html.cd-a11y-semplice .apertura { height: 60vh; }
html.cd-a11y-semplice .apertura__video { display: none; }
html.cd-a11y-semplice .apertura::after { content: none; }
html.cd-a11y-semplice .riquadri { padding: var(--sezione) var(--margine-pagina); }
html.cd-a11y-semplice .riquadri__titolo { margin-bottom: 40px; }
html.cd-a11y-semplice .riquadri__griglia { grid-template-columns: 1fr !important; gap: 30px; max-width: var(--larghezza-stretta); padding-bottom: 0; }
html.cd-a11y-semplice .riquadro { aspect-ratio: 3 / 2; }
html.cd-a11y-semplice .noi__griglia { grid-template-columns: 1fr; max-width: var(--larghezza-stretta); }
html.cd-a11y-semplice .noi__testo { max-width: none; }
html.cd-a11y-semplice :is(.copertina picture, .copertina__foto, .carta__foto, .menu-sito__foto) { display: none !important; }
html.cd-a11y-semplice .copertina::after { content: none; }
html.cd-a11y-semplice .fascia-titolo { background: var(--bordeaux); }
html.cd-a11y-semplice .pagina-semplice--sfondo { background-image: none !important; }
@media (min-width: 960px) {
  html.cd-a11y-semplice .copertina { padding: 70px var(--margine-pagina); }
  html.cd-a11y-semplice .carta__corpo { grid-template-columns: minmax(0, 1fr) !important; max-width: var(--larghezza-stretta); margin: 0 auto; }
  html.cd-a11y-semplice .carta__lato { display: none; }
  html.cd-a11y-semplice .carta__indice { display: block; }
  html.cd-a11y-semplice .piede__dentro, html.cd-a11y-semplice .piede__colonne { grid-template-columns: 1fr; gap: 30px; }
  html.cd-a11y-semplice .piede__basso { flex-direction: column; }
  html.cd-a11y-semplice .piede__legale { flex: none; text-align: left; }
  /* The header does not come back fixed while scrolling up: it stays at the top of the page */
  html.cd-a11y-semplice .testata.testata--fissa { position: absolute; top: 3px; transform: none; }
}
/* Phone: the green bar is the navigation, so it moves to the top of the page and scrolls with it (not fixed at the bottom) */
@media (max-width: 959.98px) {
  html.cd-a11y-semplice body { padding-top: var(--barra-telefono); padding-bottom: 0; }
  html.cd-a11y-semplice .barra { position: absolute; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid #888; }
  html.cd-a11y-semplice { --cd-a11y-basso: 12px; --cd-cookie-basso: 0px; }
}

/* ── reading mode: buttons made of links, the «back to the top» link and the dotted leaders of the menus are not text ── */
html.cd-a11y-lettura-pronta .cd-lettura-radice :is(.pulsante, .wp-block-buttons, .carta__su, .voce__puntini) { display: none !important; }
html.cd-a11y-lettura-pronta .cd-lettura-radice .voce__prezzo { margin-left: 1em; }
