/* v5 — hero video a tutto schermo.
   Sovrascrive solo la hero: tutto il resto arriva da ../v4-codex-design/styles.css */

.video-hero {
  position: relative;
  /* risale sotto l'header sticky, che e' translucido: cosi' il video parte dal bordo alto */
  margin-top: calc(var(--header-height) * -1);
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* compensa la risalita, altrimenti il blocco centrato finisce sotto l'header */
  padding-top: var(--header-height);
  text-align: center;
  isolation: isolate;
}

.video-hero-media {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  /* il poster resta visibile finche' non c'e' un file video: la hero funziona comunque */
  background: var(--surface-2) center / cover no-repeat;
  object-fit: cover;
}

.video-hero-scrim {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(8 26 31 / 46%) 0%, rgb(8 26 31 / 6%) 30%, rgb(8 26 31 / 72%) 100%),
    linear-gradient(90deg, rgb(8 26 31 / 40%) 0%, transparent 62%);
  pointer-events: none;
}

.video-hero-copy {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
  color: #fff;
}

.video-hero-copy .eyebrow {
  color: #fff;
  opacity: 0.9;
}

.video-hero-copy h1 {
  max-width: 16ch;
  margin-inline: auto;
  color: #fff;
  font-size: clamp(3.2rem, 6.8vw, 6.6rem);
  line-height: 0.92;
  text-shadow: 0 2px 34px rgb(8 26 31 / 42%);
}

.video-hero-copy .hero-lead {
  max-width: 560px;
  margin: 24px auto 0;
  color: rgb(255 255 255 / 92%);
  text-shadow: 0 1px 18px rgb(8 26 31 / 52%);
}

.video-hero-copy .text-link {
  color: #fff;
  text-decoration-color: rgb(255 255 255 / 70%);
}

/* ---- barra di ricerca centrata nella hero ---- */

.hero-search {
  display: grid;
  width: min(100%, 940px);
  margin: 38px auto 0;
  padding: 6px;
  align-items: stretch;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 20px;
  background: rgb(8 26 31 / 36%);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 60px rgb(8 26 31 / 28%);
  text-align: left;
}

.hero-search label {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 5px;
  padding: 12px 18px;
  border-radius: 15px;
  transition: background-color 160ms ease;
}

.hero-search label:hover,
.hero-search label:focus-within {
  background: rgb(255 255 255 / 10%);
}

.hero-search label + label {
  box-shadow: -1px 0 0 rgb(255 255 255 / 18%);
}

.hero-search label span {
  color: rgb(255 255 255 / 74%);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-search input,
.hero-search select {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  outline: 0;
}

/* l'icona nativa del selettore data e' scura: su fondo video sparirebbe */
.hero-search input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.75;
  cursor: pointer;
}

/* il menu a tendina viene disegnato dal sistema, non sul video: serve il colore del tema */
.hero-search select option {
  background: var(--surface);
  color: var(--ink);
}

.hero-search .button {
  min-height: 0;
  padding-inline: clamp(22px, 3vw, 38px);
  border-radius: 15px;
  box-shadow: none;
}

.hero-search .button:hover {
  box-shadow: none;
  transform: none;
}

.hero-rooms-link {
  display: inline-block;
  margin-top: 26px;
  font-size: 0.92rem;
}

/* l'header translucido su un video chiaro perde leggibilita': lo scurisco finche'
   non si e' scrollato, quando torna al fondo pieno del tema */
body.has-video-hero .site-header:not(.is-scrolled) {
  border-bottom-color: rgb(255 255 255 / 18%);
  background: rgb(8 26 31 / 28%);
}

body.has-video-hero .site-header:not(.is-scrolled) .brand,
body.has-video-hero .site-header:not(.is-scrolled) .nav-links a,
body.has-video-hero .site-header:not(.is-scrolled) .theme-toggle {
  color: #fff;
}

body.has-video-hero .site-header:not(.is-scrolled) .brand small {
  color: #fff;
  opacity: 0.85;
}

body.has-video-hero .site-header:not(.is-scrolled) .language-switch {
  border-color: rgb(255 255 255 / 42%);
}

body.has-video-hero .site-header:not(.is-scrolled) .language-switch button {
  color: rgb(255 255 255 / 78%);
}

body.has-video-hero .site-header:not(.is-scrolled) .language-switch button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
}

@media (max-width: 900px) {
  /* sopra la hero il testo dell'header e' bianco. Col menu aperto il pannello e' opaco e
     chiaro: senza questi override le voci restavano bianche su bianco, illeggibili. */
  body.has-video-hero.menu-open .site-header:not(.is-scrolled) {
    background: var(--bg);
  }

  body.has-video-hero.menu-open .site-header:not(.is-scrolled) .brand,
  body.has-video-hero.menu-open .site-header:not(.is-scrolled) .theme-toggle,
  body.has-video-hero.menu-open .site-header:not(.is-scrolled) .nav-links a {
    color: var(--ink);
  }

  body.has-video-hero.menu-open .site-header:not(.is-scrolled) .brand small {
    color: var(--accent);
    opacity: 1;
  }

  body.has-video-hero.menu-open .site-header:not(.is-scrolled) .language-switch {
    border-color: var(--line);
  }

  body.has-video-hero.menu-open .site-header:not(.is-scrolled) .language-switch button {
    color: var(--muted);
  }

  body.has-video-hero.menu-open .site-header:not(.is-scrolled) .language-switch button[aria-pressed="true"] {
    background: var(--ink);
    color: var(--bg);
  }
}

@media (max-width: 900px) {
  /* la barra passa a due colonne, con il pulsante a tutta larghezza sotto */
  .hero-search {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 30px;
  }

  .hero-search label:nth-child(2) {
    box-shadow: none;
  }

  .hero-search .button {
    grid-column: 1 / -1;
    min-height: 50px;
  }
}

@media (max-width: 767px) {
  .video-hero {
    /* con la barra dentro la hero il contenuto e' piu' alto: altezza libera,
       altrimenti su schermi bassi il pulsante finisce fuori */
    height: auto;
    min-height: 100dvh;
    padding-block: calc(var(--header-height) + 36px) 92px;
  }

  .video-hero-copy {
    width: min(calc(100% - 32px), var(--shell));
  }

  .video-hero-copy h1 {
    max-width: 12ch;
    font-size: clamp(2.9rem, 12vw, 4.4rem);
  }

  .video-hero-copy .hero-lead {
    margin-top: 18px;
    font-size: 1.02rem;
  }

  /* su telefono la barra copriva mezza hero: piu' compatta e piu' trasparente,
     con piu' sfocatura per compensare il minor contrasto sullo sfondo */
  .hero-search {
    grid-template-columns: 1fr;
    width: min(100%, 332px);
    gap: 1px;
    margin: 22px auto 0;
    padding: 4px;
    border-radius: 16px;
    border-color: rgb(255 255 255 / 26%);
    /* a nascondere lo sfondo e' la sfocatura, non il velo scuro: qui la sfocatura
       resta minima (lo sfondo si legge) e il contrasto lo tiene il velo + l'ombra
       sul testo */
    background: rgb(8 26 31 / 26%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 14px 40px rgb(8 26 31 / 22%);
  }

  .hero-search label {
    padding: 7px 14px;
    gap: 2px;
    border-radius: 13px;
  }

  .hero-search label span {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-shadow: 0 1px 2px rgb(8 26 31 / 45%);
  }

  .hero-search input,
  .hero-search select {
    font-size: 0.94rem;
    text-shadow: 0 1px 2px rgb(8 26 31 / 45%);
  }

  .hero-search .button {
    min-height: 46px;
    font-size: 0.94rem;
  }

  .hero-search label + label {
    box-shadow: 0 -1px 0 rgb(255 255 255 / 18%);
  }

  .hero-rooms-link {
    margin-top: 22px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .video-hero-copy > * {
    animation: heroRise 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .video-hero-copy > *:nth-child(2) { animation-delay: 90ms; }
  .video-hero-copy > *:nth-child(3) { animation-delay: 170ms; }
  .video-hero-copy > *:nth-child(4) { animation-delay: 240ms; }

  @keyframes heroRise {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: none; }
  }
}

/* --- pagine dedicate per camera --- */
.room-link { display: inline-block; margin-top: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.room-link::after { content: " \2192"; }
.room-link:hover, .room-link:focus-visible { text-decoration: underline; }

.room-detail { padding: calc(var(--header-height) + 46px) 0 76px; display: grid; gap: 52px; }
.room-head { display: grid; gap: 12px; max-width: 72ch; }
.room-head h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.9rem; color: var(--muted); margin: 0 0 4px; padding: 0; list-style: none; }
.breadcrumbs a { color: inherit; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; opacity: 0.6; }
.room-page-lead { margin: 0; font-size: 1.18rem; line-height: 1.55; color: var(--muted); }

.room-cover { margin: 0; }
.room-cover img { width: 100%; aspect-ratio: 21 / 10; object-fit: cover; border-radius: var(--radius); display: block; }

.room-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 44px; align-items: start; }
.room-desc { display: grid; gap: 18px; justify-items: start; }
.room-desc p { margin: 0; font-size: 1.08rem; line-height: 1.75; color: var(--soft); max-width: 58ch; }
.room-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 26px; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.room-facts div { margin: 0; }
.room-facts dt { font-size: 0.76rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.room-facts dd { margin: 8px 0 0; font-weight: 650; line-height: 1.35; }

.room-photos { display: grid; gap: 22px; }
.room-photos h2 { margin: 0; }
.room-gallery { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.room-gallery img { width: 100%; height: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-small); display: block; }

.room-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface-2); border-radius: var(--radius); padding: 30px 38px; }
.room-cta h2 { margin: 0 0 6px; font-size: 1.5rem; }
.room-cta p { margin: 0; color: var(--muted); max-width: 52ch; }
.back-link { color: var(--muted); }

@media (max-width: 900px) {
  .room-detail { padding: calc(var(--header-height) + 26px) 0 52px; gap: 36px; }
  .room-cover img { aspect-ratio: 4 / 3; }
  .room-columns { grid-template-columns: 1fr; gap: 28px; }
  .room-gallery { grid-template-columns: 1fr; }
  .room-gallery img { aspect-ratio: 4 / 3; }
  .room-cta { padding: 24px; }
}

/* --- logo ufficiale (insegna) --- */
/* mask + currentColor: il logo prende da solo il colore del testo in ogni stato
   (bianco sull'hero, scuro da scrollato, chiaro in dark mode, scuro a menu aperto) */
.brand-logo {
  display: block;
  width: 116px;
  height: 48px;
  background-color: currentColor;
  -webkit-mask: url("assets/logo.png") no-repeat center / contain;
  mask: url("assets/logo.png") no-repeat center / contain;
}
.site-footer .brand-logo { width: 150px; height: 62px; }

/* --- badge vista panoramica --- */
.room { position: relative; }
.room-badge {
  position: absolute; top: 16px; left: 16px; z-index: 1;
  background: rgb(10 32 38 / 68%); color: #fff;
  backdrop-filter: blur(8px);
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 999px; padding: 8px 16px;
  font-size: 0.72rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.room-badge::before {
  content: "★";
  color: #f2c14e; letter-spacing: 0; margin-right: 8px;
}
.room-view-badge {
  display: inline-block; justify-self: start; margin: 0 0 12px;
  background: var(--surface-2); color: var(--ink);
  border-radius: 999px; padding: 8px 16px;
  font-size: 0.72rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.room-view-badge::before {
  content: "★";
  color: #f2c14e; letter-spacing: 0; margin-right: 8px;
}

.room-badge-garden::before,
.room-view-badge.room-badge-garden::before {
  content: "✿";
  color: #8fbf6f;
}

/* la hero e' un interno con la vista a destra: su schermi stretti il taglio centrale
   mostrerebbe solo gli infissi, quindi si sposta l'inquadratura verso il golfo */
@media (max-width: 900px) {
  .video-hero-media { object-position: 80% center; }
}

/* badge della scheda "tutta la casa": fondo chiaro e simbolo diverso dalle camere */
.room-badge.room-badge-whole {
  background: rgb(245 248 246 / 94%);
  border-color: transparent;
  color: #102e34;
}

/* niente glifo: la pillola chiara distingue gia' la scheda dalle camere */
.room-badge.room-badge-whole::before {
  content: none;
}
