/* Effetti della UI (fonte: base/src/assets/css/effetti.css, copiato nei siti). Valgono solo con la classe "effetti"
   su <html>, che assets/js/effetti.js aggiunge se il JavaScript è attivo e non è richiesto «riduci movimento»:
   senza, il sito resta com'è. Solo transform e opacity: nessuno spostamento del contenuto. Colori dalle variabili del tema. */

/* 1. Comparsa allo scorrimento (ritardo a scalare tra elementi fratelli: --ritardo) */
.effetti .rivela { opacity: 0; transform: translate3d(0, 16px, 0); }
.effetti .rivela.visibile { opacity: 1; transform: none; transition: opacity .6s cubic-bezier(.2, .7, .2, 1) var(--ritardo, 0ms), transform .6s cubic-bezier(.2, .7, .2, 1) var(--ritardo, 0ms); }
.effetti .barre li.rivela .barre__barra { transform: scaleX(0); transform-origin: left center; }
.effetti .barre li.rivela.visibile .barre__barra { transform: none; transition: transform .9s cubic-bezier(.2, .7, .2, 1) calc(var(--ritardo, 0ms) + 150ms); }

/* 3. Copertine: zoom lento all'apertura e parallax (--parallasse, da effetti.js) */
@keyframes effetti-foto { from { transform: scale(1.06); } to { transform: none; } }
@keyframes effetti-sale { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
.effetti .copertina__foto { inset: -14% 0; transform: translate3d(0, var(--parallasse, 0px), 0); will-change: transform; }
.effetti .copertina__foto img { animation: effetti-foto 1.8s cubic-bezier(.2, .7, .2, 1) both; }
.effetti .hero--foto { background-position: 60% calc(35% + var(--parallasse, 0px)); }
.effetti .hero .wrap > *, .effetti .copertina__titolo > *, .effetti .introduzione__riga > * { animation: effetti-sale .7s cubic-bezier(.2, .7, .2, 1) both; }
.effetti .hero .wrap > :nth-child(2), .effetti .copertina__titolo > :nth-child(2), .effetti .introduzione__riga > :nth-child(1) { animation-delay: .08s; }
.effetti .hero .wrap > :nth-child(3), .effetti .introduzione__riga > :nth-child(2) { animation-delay: .16s; }
.effetti .hero .wrap > :nth-child(4) { animation-delay: .24s; }
.effetti .hero .wrap > :nth-child(n+5) { animation-delay: .32s; }

/* 4. Profondità al passaggio del mouse (solo con mouse) */
@media (hover: hover) {
  .effetti .scheda--link, .effetti .immobile, .effetti .vetrina__voce, .effetti .partecipata { transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s, border-color .2s; }
  .effetti .scheda--link:hover, .effetti .immobile:hover, .effetti .vetrina__voce:hover, .effetti .partecipata:hover {
    transform: translate3d(0, -4px, 0);
    box-shadow: 0 2px 4px color-mix(in oklch, var(--ink) 6%, transparent), 0 18px 40px -16px color-mix(in oklch, var(--ink) 38%, transparent);
  }
  .effetti .immobile__foto img, .effetti .partecipata__media img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
  .effetti .immobile:hover .immobile__foto:not(.galleria) img, .effetti .partecipata:hover .partecipata__media .immobile__foto:not(.galleria) img { transform: scale(1.04); }
  .effetti .scheda__cta { display: inline-block; transition: transform .25s; }
  .effetti .scheda--link:hover .scheda__cta, .effetti .scheda__cta:hover { transform: translate3d(3px, 0, 0); }
}

/* 5. Testata: più piena con lo scorrimento, barra di avanzamento della lettura */
.effetti .testata { transition: box-shadow .3s, background-color .3s; }
.effetti .testata--scorrimento { background-color: rgba(255, 255, 255, .95); box-shadow: 0 1px 0 var(--linea), 0 8px 24px -18px color-mix(in oklch, var(--ink) 45%, transparent); }
.avanzamento { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accento); transform: scaleX(0); transform-origin: left center; pointer-events: none; }

/* 6. Menu: sottolineatura che si allarga al passaggio del mouse (menu orizzontale) */
@media (hover: hover) and (min-width: 1181px) {
  .effetti .menu a:not(.btn):not([aria-current="page"]) { background: linear-gradient(var(--accento), var(--accento)) left bottom / 0 2px no-repeat; padding-bottom: 4px; transition: color .15s, background-size .3s cubic-bezier(.2, .7, .2, 1); }
  .effetti .menu a:not(.btn):not([aria-current="page"]):hover { background-size: 100% 2px; }
}
