/* ==========================================================================
   Font ospitati sul sito (cartella fonts/), non più caricati da Google Fonts:
   così il browser del visitatore non contatta server di terzi (GDPR).
   Sono font "variabili": un solo file copre tutti i pesi indicati.
   ========================================================================== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
  scroll-behavior: smooth;
}

/* Lascia spazio sotto l'header fisso quando si scorre ai form */
#contatti,
#richiedi,
#content-header {
  scroll-margin-top: 6rem;
}

/* ==========================================================================
   Navigazione dinamica tra pagine (View Transitions API nativa del browser)
   --------------------------------------------------------------------------
   Attiva una dissolvenza fluida quando si passa da una pagina all'altra del
   sito, al posto dello "sfarfallio" del reload classico. Nessun JavaScript
   necessario: il browser intercetta la navigazione e anima da solo il
   passaggio tra il vecchio e il nuovo documento.
   Supportata da Chrome/Edge; sugli altri browser degrada in modo invisibile
   a una normale navigazione tra pagine, senza alcun errore.
   ========================================================================== */
@view-transition {
  navigation: auto;
}

/* Dissolvenza morbida invece del taglio netto di default */
::view-transition-old(root) {
  animation: page-fade-out 0.18s ease-out both;
}

::view-transition-new(root) {
  animation: page-fade-in 0.28s ease-out both;
}

@keyframes page-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
}

/* Embed Instagram nella pagina Video & Blog: niente bordo, margini e ombra
   propri, così il player sta a filo della card (gli !important servono a
   vincere sugli stili che Instagram scrive direttamente sull'elemento) */
.video-media .instagram-media {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-width: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* Colore nativo del checkbox (usata nei moduli, es. contatti.html) */
.form-accent {
  accent-color: #4f9a1e;
}

/* Indica la pagina corrente nella navbar (desktop e mobile) */
.nav-active {
  position: relative;
}

.nav-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.05rem;
  height: 2px;
  background: #4f9a1e;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #4f9a1e, #8fc65a);
  z-index: 60;
  transition: width 0.1s linear;
}

header {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

header.is-scrolled {
  box-shadow: 0 12px 32px -14px rgba(20, 24, 42, 0.22);
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-24px) scale(1.05);
  }
}

.animate-float-glow {
  animation: floatGlow 9s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  #scroll-progress {
    display: none;
  }

  .animate-float-glow {
    animation: none;
  }
}
