/**
 * Maison Flora — livello visivo 3D.
 * Le regole di comparsa valgono solo con html.mf3d (aggiunto da js/maisonflora-3d.js):
 * senza JS il contenuto resta sempre visibile.
 */

/* Restyling grafico delle pagine pubbliche (menu, tipografia, sezioni). */
@import url("maisonflora-public.css");
@import url("maisonflora-pages.css");
@import url("maisonflora-scene.css");

/* —— Film scroll homepage —— */
.mf-film {
  position: relative;
  height: 420vh;
  background: #120c0a;
  color: #fff;
}

.mf-film-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.mf-film-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.mf-film-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(18, 12, 10, .55) 100%),
    linear-gradient(to top, rgba(18, 12, 10, .6), transparent 40%);
}

.mf-film-caption {
  position: absolute;
  left: 50%;
  bottom: clamp(70px, 14vh, 140px);
  z-index: 2;
  width: min(860px, calc(100% - 32px));
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 24px);
  transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
  pointer-events: none;
}

.mf-film-caption.is-active {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.mf-film-caption .eyebrow-light {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
}

.mf-film-caption h2,
.mf-film-caption h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(38px, 7vw, 80px);
  line-height: 1.02;
  margin: 0 0 14px;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .45);
}

.mf-film-caption p {
  margin: 0 auto 20px;
  max-width: 640px;
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.7;
  color: rgba(255, 255, 255, .92);
}

.mf-film-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 2;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
  transition: opacity .5s ease;
}

.mf-film-hint::after {
  content: '';
  display: block;
  width: 1px;
  height: 34px;
  margin: 10px auto 0;
  background: linear-gradient(#fff, transparent);
  animation: mf-film-hint 1.8s ease-in-out infinite;
}

.mf-film.is-started .mf-film-hint { opacity: 0; }

@keyframes mf-film-hint {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.mf-film-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 3px;
  background: rgba(255, 255, 255, .15);
}

.mf-film-progress span {
  display: block;
  height: 100%;
  background: var(--accent, #B63A64);
  transform: scaleX(0);
  transform-origin: left;
}

.mf-film--static { height: auto; }
.mf-film--static .mf-film-hint,
.mf-film--static .mf-film-progress { display: none; }

@media (max-width: 768px) {
  .mf-film { height: 340vh; }
}

@media (prefers-reduced-motion: reduce) {
  .mf-film-caption { transition: none; }
  .mf-film-hint::after { animation: none; }
}

/* —— Comparsa in prospettiva —— */
.mf3d .cards,
.mf3d .faq-list { perspective: 1400px; }

.mf3d .mf3d-reveal {
  opacity: 0;
  translate: 0 24px;
  rotate: x 5deg;
  transform-origin: 50% 100%;
  transition:
    opacity .7s ease var(--mf3d-delay, 0ms),
    translate .8s cubic-bezier(.22, .8, .28, 1) var(--mf3d-delay, 0ms),
    rotate .8s cubic-bezier(.22, .8, .28, 1) var(--mf3d-delay, 0ms);
}

.mf3d .mf3d-reveal.mf3d-in {
  opacity: 1;
  translate: 0 0;
  rotate: x 0deg;
}

/* —— Inclinazione 3D —— */
.mf3d .mf3d-tilting {
  transition: transform .12s ease-out, box-shadow .35s ease, border-color .35s ease !important;
  will-change: transform;
}

.mf3d .cards > .card.mf3d-tilting::after,
.mf3d .contact-card.mf3d-tilting::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mf3d-gx, 50%) var(--mf3d-gy, 50%), rgba(255, 255, 255, .28), transparent 55%);
}

.mf3d .contact-card { position: relative; }

/* —— Parallax —— */
.mf3d .hero .slide img { will-change: transform; transform: scale(1.08); }

/* —— Menu mobile (pagine pubbliche) ——
 * 1. Nei browser Chromium un header con backdrop-filter rende il menu a scomparsa (position: fixed)
 *    relativo all'header: chiuso fuori schermo a destra, allargava la pagina e Chrome la
 *    rimpiccioliva. La sfocatura passa quindi su header::before (aspetto identico: lo sfondo
 *    dell'header è opaco al 96-98%) e il menu torna relativo allo schermo.
 * 2. Ritaglio orizzontale di sicurezza solo a menu CHIUSO: su Safari iPhone ritagliare l'header
 *    nasconde il menu aperto, che dentro lo schermo non sborda comunque.
 * 3. L'header (sticky + z-index) racchiude il menu sotto il velo .nav-backdrop (z-index 1098):
 *    a menu aperto l'header passa sopra il velo, senza transizione sullo z-index.
 * Solo grafica: mobile-nav.js e maisonflora-responsive.css restano invariati. */
@media (max-width: 900px) {
  header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  @supports (overflow: clip) {
    body:not(.nav-open) header { overflow-x: clip; }
  }
  body.nav-open header {
    z-index: 1101;
    transition: none;
  }
}
