/* =====================================================================
   Rifiniture UI - caricato DOPO il CSS del tema.
   Solo aggiunte: non ridefinisce colori, font o layout del tema.
   ================================================================== */

/* --- 1. Focus da tastiera -------------------------------------------
   Il tema azzera l'outline in 17 punti: chi naviga con Tab non vede
   piu' dove si trova. Lo ripristiniamo solo per la tastiera
   (:focus-visible), cosi' il mouse non mostra bordi indesiderati. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid currentColor !important;
  outline-offset: 3px !important;
  border-radius: 2px;
}

/* --- 2. Salta al contenuto ------------------------------------------
   Compare solo quando si naviga con Tab. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: .85em 1.5em;
  background: #fff;
  color: #212529;
  border: 1px solid #212529;
  text-decoration: none;
  font-size: .9rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* --- 3. Movimento ----------------------------------------------------
   Scorrimento morbido per chi lo gradisce; disattivato del tutto per
   chi ha chiesto meno animazioni a livello di sistema. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- 4. Testo --------------------------------------------------------
   Resa piu' pulita su schermi retina e sillabazione sulle colonne
   strette, dove il tedesco produce parole molto lunghe. */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
p, li { hyphens: auto; }
p { overflow-wrap: break-word; }

/* --- 5. Immagini -----------------------------------------------------
   Rete di sicurezza: nessuna immagine puo' sfondare il contenitore. */
img, iframe { max-width: 100%; }
img { height: auto; }

/* --- 6. Transizioni morbide su link e pulsanti ----------------------- */
a, .btn, button {
  transition: color .18s ease, background-color .18s ease,
              border-color .18s ease, opacity .18s ease;
}

/* --- 7. Selezione del testo ------------------------------------------ */
::selection { background: #212529; color: #fff; }

/* --- 8. Aree toccabili su mobile -------------------------------------
   Le voci di menu diventano abbastanza grandi per un dito. */
@media (max-width: 991.98px) {
  .nav-container a,
  nav a,
  .menu-item > a { min-height: 44px; display: flex; align-items: center; }
}

/* --- 9. Stampa -------------------------------------------------------
   Capita che gli ospiti stampino indirizzo e indicazioni. */
@media print {
  nav, .pum, .pum-overlay, .map-consent, button { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
