/* OpenTenor · stile comune a tutte le pagine del sito (usa tokens.css) */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ot-carta);
  color: var(--ot-inchiostro);
  font-family: var(--ot-font-sans);
  font-size: var(--ot-fs-body);
  line-height: var(--ot-lh-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* grana leggera su tutta la pagina */
body { position: relative; }
body::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--ot-grana); background-size: 180px 180px;
  opacity: 0.05; pointer-events: none; z-index: 200;
}
img, svg, picture { display: block; max-width: 100%; }
p, h1, h2, h3, h4, ul, ol, figure, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: var(--ot-vermiglio-700); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ot-vermiglio-800); }
:focus-visible { outline: 2px solid var(--ot-inchiostro); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--ot-vermiglio-200); color: var(--ot-inchiostro); }
[hidden] { display: none !important; }

.wrap { max-width: var(--ot-max); margin-inline: auto; padding-inline: var(--ot-gutter); }
.nobr { white-space: nowrap; }
.solo-lettori {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.salta {
  position: absolute; left: 16px; top: -80px; z-index: 300;
  background: var(--ot-inchiostro); color: #fff; padding: 10px 16px; border-radius: var(--ot-r-pill);
  font-weight: 600; text-decoration: none; transition: top var(--ot-dur-1);
}
.salta:focus { top: 12px; color: #fff; outline: 2px solid var(--ot-vermiglio-500); outline-offset: 2px; }

/* parola d'accento: Instrument Serif corsivo, solo da 24 px in su */
.accento {
  font-family: var(--ot-font-serif); font-style: italic; font-weight: 400;
  font-size: 1.08em; line-height: 0.8; letter-spacing: -0.01em;
  color: var(--ot-vermiglio-600);
  padding-right: 0.04em;
}

/* ---------- Icone (sprite) ---------------------------------------------- */
.ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Bottoni ------------------------------------------------------ */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 24px;
  border: 0; border-radius: var(--ot-r-pill);
  font: var(--ot-w-semi) 1rem/1.15 var(--ot-font-sans);
  letter-spacing: -0.005em; text-align: center;
  text-decoration: none; cursor: pointer;
  transition: transform var(--ot-dur-1) var(--ot-ease), box-shadow var(--ot-dur-2) var(--ot-ease), background-color var(--ot-dur-1), color var(--ot-dur-1);
}
.btn:active { transform: translateY(1px); }
.btn--piccolo { --h: 40px; padding: 0 16px; font-size: 0.9375rem; gap: 8px; }
.btn--inchiostro { background: var(--ot-inchiostro); color: #fff; }
.btn--inchiostro:hover { background: #2A2830; color: #fff; }
.btn--segnale { background: var(--ot-vermiglio-500); color: var(--ot-inchiostro); box-shadow: var(--ot-ombra-segnale); }
.btn--segnale:hover { color: var(--ot-inchiostro); background: #FF6233; box-shadow: 0 1px 0 rgb(255 255 255 / 0.35) inset, 0 10px 26px -8px rgb(255 79 31 / 0.7); }
.btn--vuoto { background: rgb(255 255 255 / 0.6); color: var(--ot-inchiostro); box-shadow: inset 0 0 0 1px var(--ot-filetto-forte); }
.btn--vuoto:hover { color: var(--ot-inchiostro); background: #fff; box-shadow: inset 0 0 0 1px var(--ot-inchiostro-4); }
.btn__freccia { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--ot-dur-2) var(--ot-ease); flex: none; }
.btn:hover .btn__freccia { transform: translateX(3px); }
.btn .ico { width: 18px; height: 18px; }
.btn:focus-visible { outline: none; box-shadow: var(--ot-fuoco); }

/* ---------- Barra di navigazione ---------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgb(251 249 245 / 0.82);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ot-dur-2), background-color var(--ot-dur-2);
}
.nav.is-scrolled, .no-js .nav, .nav--fisso { border-bottom-color: var(--ot-filetto); background: rgb(251 249 245 / 0.9); }
.nav__in { display: flex; align-items: center; gap: var(--ot-s-5); height: 72px; }
.nav__logo { display: block; flex: none; border-radius: 8px; }
.nav__logo img { height: 30px; width: auto; }
.nav__link { display: flex; gap: 2px; margin-left: auto; }
.nav__link a {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 12px; border-radius: var(--ot-r-pill);
  color: var(--ot-inchiostro-2); text-decoration: none;
  font-size: 0.9375rem; font-weight: var(--ot-w-medium);
  transition: background-color var(--ot-dur-1), color var(--ot-dur-1);
}
.nav__num { font: var(--ot-w-medium) 0.75rem/1 var(--ot-font-mono); color: var(--ot-vermiglio-700); letter-spacing: 0.02em; }
.nav__link a:hover { color: var(--ot-inchiostro); background: rgb(17 16 21 / 0.05); }
.nav__link a[aria-current="true"] { color: var(--ot-inchiostro); background: rgb(17 16 21 / 0.06); }
.nav__azioni { display: flex; align-items: center; gap: 10px; }

/* selettore della lingua: details/summary con un link per lingua (?lang=xx). Senza JavaScript si apre lo
   stesso e i link funzionano; con JavaScript la lingua cambia senza ricaricare (js/lingua.js).
   Sempre in vista nella barra, anche sui telefoni: il codice (EN, IT…) e i nomi nella loro lingua. */
.lingue { position: relative; flex: none; }
.lingue > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 10px 0 11px; border-radius: var(--ot-r-pill);
  background: #fff; box-shadow: inset 0 0 0 1px var(--ot-filetto-forte); color: var(--ot-inchiostro);
  font: var(--ot-w-medium) 0.8125rem/1 var(--ot-font-mono); letter-spacing: 0.06em;
  transition: box-shadow var(--ot-dur-1), background-color var(--ot-dur-1);
}
.lingue > summary::-webkit-details-marker { display: none; }
.lingue > summary:hover, .lingue[open] > summary { box-shadow: inset 0 0 0 1px var(--ot-inchiostro-4); }
.lingue > summary:focus-visible { outline: 2px solid var(--ot-inchiostro); outline-offset: 2px; border-radius: var(--ot-r-pill); }
.lingue__globo { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; }
.lingue__codice { min-width: 2ch; }
.lingue__freccia { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--ot-inchiostro-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--ot-dur-2) var(--ot-ease); }
.lingue[open] .lingue__freccia { transform: rotate(180deg); }
.lingue__lista {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 120;
  width: max-content; min-width: 200px; padding: 6px; border-radius: var(--ot-r-lg);
  background: #fff; box-shadow: var(--ot-alone), var(--ot-ombra-3);
}
.lingue__lista a {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 42px; padding: 0 12px; border-radius: var(--ot-r-sm);
  color: var(--ot-inchiostro); text-decoration: none; font-size: 0.9375rem; font-weight: var(--ot-w-medium);
}
.lingue__lista a:hover { background: var(--ot-carta-2); color: var(--ot-inchiostro); }
.lingue__lista a:focus-visible { outline-offset: -2px; border-radius: var(--ot-r-sm); }
.lingue__nome { display: inline-flex; align-items: center; gap: 10px; }
.lingue__nome::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: transparent; }
.lingue__sigla { font: var(--ot-w-medium) 0.75rem/1 var(--ot-font-mono); letter-spacing: 0.06em; color: var(--ot-inchiostro-3); }
.lingue__lista a[aria-current="true"] { background: var(--ot-vermiglio-50); }
.lingue__lista a[aria-current="true"] .lingue__nome::before { background: var(--ot-vermiglio-500); }
.lingue__lista a[aria-current="true"] .lingue__sigla { color: var(--ot-vermiglio-700); }

/* un'altra lingua scelta: la pagina resta nascosta finché i suoi testi non sono pronti (js/lingua.js, max 2,5 s) */
.lingua-attesa body { visibility: hidden; }

/* menu per i telefoni: details/summary, funziona anche senza JavaScript */
.menu { position: relative; display: none; }
.menu > summary {
  list-style: none; cursor: pointer;
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 0 0 1px var(--ot-filetto-forte); color: var(--ot-inchiostro);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .ico { width: 20px; height: 20px; }
.menu > summary:focus-visible { outline: 2px solid var(--ot-inchiostro); outline-offset: 2px; border-radius: 50%; }
.menu__chiudi { display: none; }
.menu[open] .menu__apri { display: none; }
.menu[open] .menu__chiudi { display: block; }
.menu__pannello {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 110;
  width: min(300px, calc(100vw - 32px));
  padding: 8px; border-radius: var(--ot-r-lg);
  background: #fff; box-shadow: var(--ot-alone), var(--ot-ombra-3);
}
.menu__pannello a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 14px; border-radius: var(--ot-r-sm);
  color: var(--ot-inchiostro); text-decoration: none; font-weight: var(--ot-w-medium);
}
.menu__pannello a:hover { background: var(--ot-carta-2); color: var(--ot-inchiostro); }
.accedi-btn { white-space: nowrap; }
.accedi-btn .accedi-btn__ico { display: none; width: 18px; height: 18px; }

@media (max-width: 1099px) {
  .nav__link a { padding: 8px 9px; }
  .nav__num { display: none; }
}
@media (max-width: 959px) {
  .nav__link { display: none; }
  .nav__azioni { margin-left: auto; }
  .menu { display: block; }
  .nav .btn__freccia { display: none; }
}
@media (max-width: 480px) {
  .nav__in { height: 64px; gap: 8px; }
  .nav__logo img { height: 25px; }
  .nav__azioni { gap: 8px; }
  .btn--piccolo { --h: 40px; padding: 0 14px; }
}
/* telefoni: «Accedi» diventa il solo lucchetto (il testo resta per i lettori di schermo), così la barra ha
   posto per logo, lingua e menu in tutte le lingue */
@media (max-width: 520px) {
  .accedi-btn { width: 40px; padding: 0; }
  .accedi-btn .accedi-btn__testo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .accedi-btn .accedi-btn__ico { display: block; }
}
@media (max-width: 374px) {
  .nav__logo img { height: 23px; }
  .lingue > summary { padding: 0 8px 0 9px; gap: 5px; }
  .lingue__freccia { display: none; }
}

/* ---------- Occhiello: numero + rigo + etichetta ------------------------- */
.occhiello {
  display: flex; align-items: center; gap: 12px;
  font: var(--ot-w-medium) 0.75rem/1.2 var(--ot-font-mono); letter-spacing: var(--ot-track-label); text-transform: uppercase;
  color: var(--ot-inchiostro-2);
}
.occhiello__num { color: var(--ot-vermiglio-700); }
.occhiello__rigo {
  width: 48px; height: 13px; flex: none;
  background:
    linear-gradient(to bottom, transparent 6px, var(--ot-vermiglio-500) 6px, var(--ot-vermiglio-500) 7px, transparent 7px),
    repeating-linear-gradient(to bottom, rgb(17 16 21 / 0.3) 0 1px, transparent 1px 3px);
}

/* ---------- LED di stato ------------------------------------------------ */
.led { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ot-inchiostro-4); }
.led--on { background: var(--ot-ok); box-shadow: 0 0 0 3px rgb(11 122 82 / 0.16); }
.led--arrivo { background: #D99A1E; box-shadow: 0 0 0 3px rgb(217 154 30 / 0.2); }

/* ---------- Piede -------------------------------------------------------- */
.piede { background: var(--ot-carta); border-top: 1px solid var(--ot-filetto); padding-block: 48px 32px; }
.piede__in { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .piede__in { grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); align-items: start; } }
.piede__marchio img { height: 28px; width: auto; }
.piede__motto { margin-top: 14px; color: var(--ot-inchiostro-2); font-size: var(--ot-fs-small); max-width: 22em; }
.piede__colonne { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.piede__colonne h2 {
  font: var(--ot-w-medium) 0.75rem/1.2 var(--ot-font-mono); letter-spacing: var(--ot-track-label); text-transform: uppercase;
  color: var(--ot-inchiostro-3); margin-bottom: 10px;
}
.piede__colonne p { font-size: var(--ot-fs-small); color: var(--ot-inchiostro-2); }
.piede__colonne p + p { margin-top: 6px; }
.piede a { display: inline-block; padding-block: 4px; }
.piede__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--ot-filetto);
  font: 0.75rem/1.5 var(--ot-font-mono); letter-spacing: 0.02em; color: var(--ot-inchiostro-3);
}
.piede__base .piede__nota { display: flex; align-items: center; gap: 10px; }
.icona-rigo { width: 28px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 0.9; }

/* ---------- Movimento ridotto -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
