/* =============================================================
   ESPACE DEBORAH MAMINA — Feuille de style des animations
   Créée le 2026-10-04 (demande de David) en s'inspirant du site
   Hôtel Sept-Îles : hero « cinéma » piloté par le scroll, textes qui
   apparaissent en douceur, apparitions des sections et des photos,
   barre de navigation en verre dépoli.
   Langage : CSS (les couleurs reprennent la palette sable / kaki /
   palmier / terracotta définie dans la config Tailwind de index.html).
   ============================================================= */

/* ---------- BASE ---------- */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 2.5rem; }
/* AOS décale parfois des éléments hors de l'écran : on évite la barre de défilement horizontale
   (« clip » plutôt que « hidden » pour ne pas casser le hero sticky) */
body { overflow-x: clip; }

.text-shadow-sm { text-shadow: 0 2px 14px rgba(24, 36, 20, 0.55); }

/* Petite ligne dégradée sous les étiquettes de section (équivalent du « gold-divider » de l'hôtel) */
.sable-divider {
  width: 60px;
  height: 2px;
  margin: 0.6rem auto 0;
  background: linear-gradient(90deg, transparent, #E0895B, transparent);
}
.sable-divider.is-left { margin-left: 0; background: linear-gradient(90deg, #E0895B, transparent); }

/* ---------- NAVIGATION : transparente sur le hero, verre dépoli ensuite ---------- */
#main-nav {
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
#main-nav.nav-transparent {
  background: transparent;
  border-bottom-color: transparent;
}
#main-nav.glass-nav {
  background: rgba(253, 251, 246, 0.9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom-color: rgba(224, 211, 174, 0.6);
  box-shadow: 0 2px 16px rgba(51, 72, 42, 0.08);
}
/* Couleurs des textes : blanc sur le hero sombre, couleurs normales une fois la barre « en verre » */
#main-nav .nav-link { color: rgba(51, 43, 31, 0.8); transition: color 0.2s; }
#main-nav .logo-text { color: #33482A; transition: color 0.3s; }
#main-nav #menu-toggle svg { color: #33482A; transition: color 0.3s; }
#main-nav.nav-transparent .nav-link,
#main-nav.nav-transparent .logo-text,
#main-nav.nav-transparent #menu-toggle svg { color: #ffffff; }
/* Ombre du logo : « drop-shadow » suit la forme du blason (une box-shadow dessinerait un rectangle autour
   de l'image transparente). Mise à jour le 2026-10-08 avec le logo à fond transparent. */
#main-nav.nav-transparent .logo-img { filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45)); }
.logo-img { transition: filter 0.3s ease; }

/* Soulignement animé au survol des liens du menu */
.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1px;
  background: #E0895B;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-link:hover::after { transform: scaleX(1); }

/* ---------- HERO « CINÉMA » PILOTÉ PAR LE SCROLL ----------
   La section est très haute (hauteur posée dans le HTML) ; le conteneur interne est « sticky » :
   il reste plein écran pendant que la page défile. La position du scroll décide quelle photo est
   visible, quel texte s'affiche et de combien la photo zoome (voir hero-scroll.js). */
.hero-scroll { position: relative; }

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #1c2918;
}

.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;       /* fondu enchaîné entre deux photos */
  will-change: opacity;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);              /* le zoom réel est piloté en JS */
  transform-origin: var(--origine, 50% 50%);
  will-change: transform;
}

/* Voile dégradé : garde le texte blanc lisible sans écraser les photos */
.hero-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(28, 41, 24, 0.62) 0%,
    rgba(28, 41, 24, 0.46) 42%,
    rgba(20, 30, 17, 0.80) 100%
  );
  pointer-events: none;
}
/* Fin grain de pellicule (même astuce que l'hôtel) */
.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ---------- ÉTAPES DE TEXTE : apparition floue → nette, montée douce ---------- */
.hero-stages { position: absolute; inset: 0; z-index: 10; color: #ffffff; }
.hero-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5.5rem 1.5rem 3.5rem;
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  filter: blur(6px);
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), filter 0.7s ease;
  pointer-events: none;
  will-change: opacity, transform;
}
.hero-stage.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.glass-hero-badge {
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50px;
}
.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #F6C3A0;
  text-shadow: 0 1px 10px rgba(20, 30, 17, 0.8);
}

/* Barre de progression + indice « faites défiler » */
.hero-progress {
  position: absolute;
  left: 50%;
  bottom: 1.75rem;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.hero-progress-track {
  width: 120px;
  height: 2px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  overflow: hidden;
}
.hero-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #E0895B, #F7F1E3);
  border-radius: 2px;
  transition: width 0.12s linear;
}
.hero-progress-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.hero-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 4.25rem;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  transition: opacity 0.4s ease;
}

/* Téléphones : le texte « Faites défiler » se superposerait aux boutons de l'étape 1, on garde seulement la flèche */
@media (max-width: 640px) {
  .hero-scroll-hint > span { display: none; }
}

/* Écrans bas (petits téléphones, mode paysage) : on raccourcit le texte pour que tout tienne */
@media (max-height: 720px) {
  .hero-desc { display: none; }
  .hero-stage { padding-top: 4.5rem; padding-bottom: 3rem; }
}

/* ---------- SECTIONS : micro-animations ---------- */
/* Les cartes se soulèvent au survol (même effet que les boutons de l'hôtel) */
.lift {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease, border-color 0.3s ease;
}
.lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(51, 72, 42, 0.14);
  border-color: #E0D3AE;
}

/* Photos supplémentaires du bouton « Voir plus » : elles apparaissent en cascade (3 colonnes) */
@keyframes tuileEntree {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
#galerie-plus.is-revealed > div { animation: tuileEntree 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
#galerie-plus.is-revealed > div:nth-child(3n+2) { animation-delay: 0.1s; }
#galerie-plus.is-revealed > div:nth-child(3n+3) { animation-delay: 0.2s; }

/* ---------- VISIONNEUSE PLEIN ÉCRAN : ouverture et changement de photo en douceur ---------- */
@keyframes lbFond  { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbPhoto { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
#lightbox:not(.hidden) { animation: lbFond 0.3s ease both; }
#lightbox-image.lb-swap { animation: lbPhoto 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ---------- BARRE DE DÉFILEMENT PERSONNALISÉE ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #F7F1E3; }
::-webkit-scrollbar-thumb { background: #9C8F55; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #C96A3E; }

/* ---------- ACCESSIBILITÉ : respect de « réduire les animations » ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-slide { transition: opacity 0.3s ease; }
  .hero-slide img { transform: none !important; }
  .hero-stage { transition: opacity 0.3s ease; transform: none; filter: none; }
  .lift, .lift:hover { transform: none; }
  #galerie-plus.is-revealed > div, #lightbox:not(.hidden), #lightbox-image.lb-swap { animation: none; }
}
