/* Header stile Degani: nascosto su scroll giù, riappare su scroll su */

.skip-to-content {
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
  z-index: 10000;
}
.skip-to-content:focus-visible {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  overflow: visible;
  padding: 10px 18px;
  background: #008392;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  z-index: 10001;
  outline: none;
  box-shadow: 0 0 0 4px rgba(132,205,197,.35);
}

/* Spazio per compensare l'header fixed (il contenuto non va dietro l'header) */
body {
  padding-top: var(--header-h) !important;
}

/* Override position: sticky da styles.min.css → forza fixed */
.site-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9999;
  background: #fff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(35, 31, 32, .08);
  transition: box-shadow 0.25s ease;
}

/* Nascosto: sparisce immediatamente senza animazione */
.site-header.header-hidden {
  display: none !important;
}

/* Visibile: presente nel layout */
.site-header.header-visible {
  display: block !important;
}

/* Ombra quando non siamo in cima alla pagina */
.site-header.header-scrolled {
  box-shadow: 0 2px 16px rgba(35, 31, 32, 0.10);
}

.site-header .header-inner {
  min-height: var(--header-h);
  padding: 14px 0;
}

/* Rimuove il padding-top DOPPIO: styles.min.css aggiunge clamp(24px,3vw,48px)
   ma theme.css gestisce già il padding via --hero-pad-top.
   Forziamo solo il valore di theme.css, eliminando l'accumulo. */
.home-hero.hero,
.percorso-page .hero,
.chi-siamo-page .hero,
.contatti-page .hero {
  padding-top: var(--hero-pad-top, clamp(40px, 5vw, 80px)) !important;
}

/* Con padding-top gestito da --hero-pad-top, ancora l'immagine in alto
   per evitare che venga tagliata quando il box è meno alto */
.home-page .home-hero {
  background-position: center top !important;
}

/* Fix contrasto WCAG AA: btn-primary nell'header su sfondo bianco
   #008392 su #fff = 3.56:1 (non sufficiente)
   #005f6b su #fff = 5.8:1 (AA ✓) */
.site-header .btn.btn-primary {
  background: #005f6b !important;
  border-color: #005f6b !important;
}
.site-header .btn.btn-primary:hover,
.site-header .btn.btn-primary:focus-visible {
  background: #004d57 !important;
  border-color: #004d57 !important;
}

@media (max-width: 860px) {
  /* Il menu mobile deve seguire la posizione dell'header */
  .site-nav {
    top: calc(var(--header-h) + 12px) !important;
    max-height: calc(100vh - (var(--header-h) + 28px)) !important;
  }
}
