/* Homepage "Notte in quota" — caricato solo dalla home (content/{it,en}/page/home.php).
   Caratteri: Barlow Condensed (titoli) + Barlow (testo), aggiunti in head.php con $GLOBALS['headExtraFonts'].
   Movimenti: solo CSS + Assets/JS/home.js; tutto fermo con prefers-reduced-motion. */

.hv {
  --hv-night: #0D1114;
  --hv-surface: #161C20;
  --hv-snow: #F2F4F3;
  --hv-mist: #A3AEB4;
  --hv-text: #CBD3D7;
  --hv-red: #D21F26;
  --hv-line: #273035;
  --hv-disp: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --hv-body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --hv-ease: cubic-bezier(.2, .7, .1, 1);
  background: var(--hv-night);
  color: var(--hv-snow);
  font-family: var(--hv-body);
  overflow-x: clip;
}

.hv a { color: inherit; text-decoration: none; }
.hv img { display: block; max-width: 100%; }
.hv p { color: var(--hv-text); }
.hv h1, .hv h2, .hv h3 { color: var(--hv-snow); }

.hv-in { max-width: 1280px; margin: 0 auto; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
.hv-sec { padding-top: 88px; }
.hv-sec--last { padding-bottom: 96px; }

.hv-eyebrow {
  display: block;
  font-family: var(--hv-disp);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--hv-red) !important;
  margin: 0 0 .6rem;
}

.hv-more {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--hv-disp);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--hv-snow) !important;
  border-bottom: 2px solid var(--hv-red);
  padding-bottom: .25rem;
}
.hv-more::after { content: "\2192"; transition: transform .3s var(--hv-ease); }
.hv-more:hover::after, .hv-more:focus-visible::after { transform: translateX(5px); }
.hv a:focus-visible, .hv button:focus-visible, .hv [tabindex]:focus-visible { outline: 2px solid var(--hv-snow); outline-offset: 4px; }

/* ---------- Slideshow a tutto schermo ---------- */
.hv-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: min(78vh, 760px);
  min-height: 520px;
  background: var(--hv-surface);
}
.hv-slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 1.2s ease, visibility 0s linear 1.2s; }
.hv-slide.is-active { opacity: 1; visibility: visible; z-index: 1; transition: opacity 1.2s ease, visibility 0s; }
.hv-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; transform-origin: 60% 50%; }
.hv-slide.is-active img { animation: hv-kenburns 12s ease-out both; }
.hv-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 17, 20, .35) 0%, rgba(13, 17, 20, .05) 30%, rgba(13, 17, 20, .25) 55%, rgba(13, 17, 20, .92) 100%);
  pointer-events: none;
}
@keyframes hv-kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }

.hv-cap {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 84px;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: max(28px, env(safe-area-inset-left, 0px));
  padding-right: max(28px, env(safe-area-inset-right, 0px));
}
.hv-kicker {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0 0 .7rem;
  font-family: var(--hv-disp);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--hv-mist) !important;
}
.hv-kicker::before { content: ""; width: 36px; height: 2px; background: var(--hv-red); }
.hv-cap__title {
  font-family: var(--hv-disp);
  font-weight: 700;
  font-size: clamp(3rem, 8.4vw, 6.75rem);
  line-height: .9;
  text-transform: uppercase;
  margin: 0 0 1rem;
  max-width: 14ch;
  text-wrap: balance;
}
.hv-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .04em; }
.hv-word > span { display: inline-block; }
.hv-slide.is-active .hv-word > span { animation: hv-rise .9s var(--hv-ease) both; animation-delay: calc(var(--i, 0) * 90ms + 150ms); }
.hv-cap__lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); margin: 0; max-width: 40ch; color: #DCE2E4 !important; }
.hv-slide.is-active .hv-cap__lead { animation: hv-fadeup .9s .5s ease both; }
@keyframes hv-rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes hv-fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hv-hero__ui {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 28px;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: max(28px, env(safe-area-inset-left, 0px));
  padding-right: max(28px, env(safe-area-inset-right, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.hv-hero__controls { display: flex; align-items: center; gap: 14px; }
.hv-dots { display: flex; gap: 6px; }
.hv-dots button {
  position: relative;
  width: 40px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.hv-dots button::before, .hv-dots button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
}
.hv-dots button::before { background: rgba(255, 255, 255, .35); }
.hv-dots button::after { background: var(--hv-red); transform: scaleX(0); transform-origin: left; }
.hv-dots button.is-on::after { transform: scaleX(1); }
.hv-hero.is-playing .hv-dots button.is-on::after { animation: hv-progress var(--hv-interval, 6s) linear both; }
@keyframes hv-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hv-pause {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(13, 17, 20, .35);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hv-pause span { width: 10px; height: 11px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.hv-pause.is-paused span { width: 0; height: 0; border: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }
.hv-scroll { display: flex; align-items: center; gap: 10px; font-family: var(--hv-disp); font-size: .82rem; letter-spacing: .24em; text-transform: uppercase; color: #fff; }
.hv-scroll i { position: relative; width: 1px; height: 30px; background: rgba(255, 255, 255, .45); overflow: hidden; }
.hv-scroll i::after { content: ""; position: absolute; left: 0; top: -10px; width: 1px; height: 10px; background: #fff; animation: hv-drip 1.8s ease-in-out infinite; }
@keyframes hv-drip { from { top: -10px; } to { top: 30px; } }

/* ---------- Presentazione e numeri ---------- */
.hv-intro__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.hv-intro__title {
  font-family: var(--hv-disp);
  font-weight: 700;
  font-size: clamp(2.6rem, 5.2vw, 4.4rem);
  line-height: .95;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}
.hv-intro__title .hv-eyebrow { line-height: 1.3; }
.hv-intro__text p { font-size: 1.06rem; line-height: 1.65; margin: 0 0 1rem; max-width: 60ch; }
.hv-intro__text .hv-intro__lead { font-size: 1.25rem; line-height: 1.5; color: var(--hv-snow) !important; }
.hv-intro__text .hv-more { margin-top: .5rem; }
.hv-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin: 56px 0 0;
  background: var(--hv-line);
  border-block: 1px solid var(--hv-line);
}
.hv-stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; background: var(--hv-night); padding: 22px 0 18px; }
.hv-stat:not(:first-child) { padding-left: 24px; }
.hv-stat dd { margin: 0; font-family: var(--hv-disp); font-weight: 700; font-size: clamp(2.6rem, 5vw, 4rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--hv-snow); }
.hv-stat dt { font-family: var(--hv-disp); font-weight: 500; font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; color: var(--hv-mist); margin-top: .35rem; }

/* ---------- Fascia foto con citazione ---------- */
.hv-band { position: relative; height: clamp(300px, 46vw, 460px); margin-top: 88px; overflow: hidden; display: grid; place-items: center; text-align: center; }
.hv-band img { position: absolute; left: 0; top: -12%; width: 100%; height: 124%; object-fit: cover; }
.hv-band::after { content: ""; position: absolute; inset: 0; background: rgba(13, 17, 20, .48); }
.hv-band__quote {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 24px;
  max-width: 900px;
  font-family: var(--hv-disp);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1;
  text-transform: uppercase;
  color: var(--hv-snow) !important;
  text-wrap: balance;
}
@supports (animation-timeline: view()) {
  .hv-band img { animation: hv-parallax linear both; animation-timeline: view(); }
  @keyframes hv-parallax { from { transform: translateY(-8%); } to { transform: translateY(8%); } }
}

/* ---------- Intestazioni di sezione ---------- */
.hv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.hv-head__title { font-family: var(--hv-disp); font-weight: 700; font-size: clamp(2.4rem, 4.6vw, 3.6rem); line-height: .95; text-transform: uppercase; margin: 0; }

/* ---------- Ultime uscite: griglia a mosaico ---------- */
.hv-news { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 250px; gap: 14px; }
.hv-tile { position: relative; display: block; overflow: hidden; background: var(--hv-surface); }
.hv-tile:first-child { grid-row: span 2; }
.hv-tile .hv-zoom { position: absolute; inset: 0; }
.hv-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(13, 17, 20, .92) 100%); pointer-events: none; }
.hv-tile__txt { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 18px; display: grid; gap: .5rem; }
.hv-tile__txt::before { content: ""; width: 28px; height: 2px; background: var(--hv-red); transition: width .4s var(--hv-ease); }
.hv-tile:hover .hv-tile__txt::before, .hv-tile:focus-visible .hv-tile__txt::before { width: 64px; }
.hv-tile__title { font-family: var(--hv-disp); font-weight: 600; font-size: 1.5rem; line-height: 1.02; text-transform: uppercase; color: var(--hv-snow); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hv-tile:first-child .hv-tile__title { font-size: clamp(2rem, 3.4vw, 2.75rem); }
.hv-tile__preview { color: var(--hv-text); font-size: 1rem; line-height: 1.5; max-width: 52ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.hv-zoom { display: block; overflow: hidden; }
.hv-zoom img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--hv-ease); }
a:hover .hv-zoom img, a:focus-visible .hv-zoom img { transform: scale(1.06); }
.hv-noimg {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(155deg, transparent 52%, rgba(255, 255, 255, .06) 52.3%, transparent 74%),
    linear-gradient(205deg, transparent 47%, rgba(255, 255, 255, .04) 47.3%),
    #222B31;
}

/* ---------- Ultimi percorsi: fila che scorre di lato ---------- */
.hv-arrows { display: flex; gap: 8px; }
.hv-arrows button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--hv-line);
  background: transparent;
  color: var(--hv-snow);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.hv-arrows button:hover { background: var(--hv-red); border-color: var(--hv-red); }
.hv-arrows button:disabled { opacity: .35; cursor: default; background: transparent; border-color: var(--hv-line); }
.hv-rail {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--hv-line) transparent;
  overscroll-behavior-x: contain;
}
.hv-card { flex: 0 0 300px; scroll-snap-align: start; }
.hv-card a { display: block; }
.hv-card .hv-zoom { aspect-ratio: 4 / 5; background: var(--hv-surface); }
.hv-card__title { display: block; font-family: var(--hv-disp); font-weight: 600; font-size: 1.4rem; line-height: 1.02; text-transform: uppercase; margin: .8rem 0 .35rem; color: var(--hv-snow); }
.hv-card__cta { font-family: var(--hv-disp); font-size: .8rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--hv-mist); transition: color .2s; }
.hv-card a:hover .hv-card__cta { color: var(--hv-red); }
.hv-rail__more { margin: 20px 0 0; }

/* ---------- Tre pilastri ---------- */
.hv-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 0; padding: 0; list-style: none; }
.hv-pillar { border-top: 2px solid var(--hv-line); padding-top: 18px; transition: border-color .3s; }
.hv-pillar:hover { border-color: var(--hv-red); }
.hv-pillar__title { font-family: var(--hv-disp); font-weight: 600; font-size: 1.75rem; text-transform: uppercase; margin: 0 0 .4rem; }
.hv-pillar p { margin: 0; line-height: 1.6; }

/* ---------- Comparsa allo scorrimento (solo per ciò che è ancora sotto: home.js) ---------- */
.hv [data-hv-reveal] { transition: opacity .8s ease, transform .9s var(--hv-ease); }
.hv [data-hv-reveal].is-pending { opacity: 0; transform: translateY(28px); }

/* ---------- Telefono e tablet ---------- */
@media (max-width: 991.98px) {
  .hv-intro__grid { grid-template-columns: 1fr; gap: 24px; }
  .hv-news { grid-template-columns: 1fr 1fr; grid-auto-rows: 210px; }
  .hv-tile:first-child { grid-column: span 2; grid-row: span 2; }
}
@media (max-width: 767.98px) {
  .hv-in, .hv-cap, .hv-hero__ui { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .hv-sec { padding-top: 60px; }
  .hv-sec--last { padding-bottom: 64px; }
  .hv-hero { height: min(82svh, 640px); min-height: 480px; }
  .hv-cap { bottom: 80px; }
  .hv-cap__title { font-size: clamp(2.6rem, 13vw, 3.8rem); }
  .hv-scroll span { display: none; }
  .hv-stat:not(:first-child) { padding-left: 14px; }
  .hv-stats { grid-template-columns: repeat(3, 1fr); margin-top: 40px; }
  .hv-stat dd { font-size: 2.3rem; }
  .hv-stat dt { font-size: .7rem; letter-spacing: .12em; }
  .hv-band { margin-top: 60px; }
  .hv-news { grid-auto-rows: 180px; gap: 10px; }
  .hv-tile__txt { left: 14px; right: 14px; bottom: 12px; }
  .hv-tile__title { font-size: 1.15rem; }
  .hv-tile__preview { display: none; }
  .hv-card { flex-basis: 74%; }
  .hv-arrows { display: none; }
  .hv-pillars { grid-template-columns: 1fr; gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .hv *, .hv *::before, .hv *::after { animation: none !important; transition: none !important; }
  .hv [data-hv-reveal].is-pending { opacity: 1; transform: none; }
  .hv-scroll i::after { display: none; }
}
