/**
 * v1.35.0 r4 — Transition d'entrée pavillon : crossfade vers façade MP4
 * fullscreen, lecture de l'animation (portes qui s'ouvrent), puis nav.
 *
 * Architecture simplifiée vs r1-r3 (qui découpaient les portes en CSS) :
 *   - L'animation des portes est dans la vidéo elle-même (Kling génère le
 *     bâtiment + l'ouverture des portes en un seul rendu)
 *   - On ne fait que : fade-in fullscreen video → play → onended → nav
 *
 * Pas de zoom du stage, pas de CSS sliding doors, pas de pixel-match.
 *
 * Flow temporel :
 *   t=0      : .lb-facade-overlay créé (opacity:0)
 *   t=10ms   : .is-visible posé → opacity 0→1 (fade-in 0.7s)
 *   t=video  : la vidéo joue (~5s, l'animation des portes est dedans)
 *   t=onend  : nav HTML vers /pavillon-X/
 */

.lb-facade-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  background: #000;
  transition: opacity 0.7s ease-in;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-facade-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* v1.43.19 — Deux instances vidéo (A et B) superposées pour le crossfade
   du loop. Position absolue dans l'overlay flex (centré), même taille. */
.lb-facade-overlay__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  display: block;
  background: #000;
}

/* v1.43.44 — Mode "CSS doors" pour poissons-reptiles (Kling MP4 inadéquat
   pour l'ouverture). PNG static + foliage video overlay en blend mode +
   2 portes clippées qui glissent. */
.lb-facade-overlay__bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  display: block;
  z-index: 1;
}
.lb-facade-overlay__foliage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  display: block;
  z-index: 2;
  /* multiply : zones sombres de la vidéo (porte, ombres) assombrissent le
     PNG ; zones claires (feuillage en mouvement) restent quasi neutres.
     L'effet : motion subtile de feuillage par-dessus le PNG sans masquer
     la façade. */
  mix-blend-mode: multiply;
  pointer-events: none;
}
/* Les portes : background = même PNG que .lb-facade-overlay__bg-img, mais
   clippées par clip-path pour ne montrer QUE la zone porte (~40-58% x,
   ~32-78% y mesuré visuellement sur le PNG poissons-reptiles 1376x768).
   Chaque porte couvre la moitié de la zone (gauche : 40-50%, droite :
   50-58%). Translatent vers l'extérieur sur 3s pour simuler l'ouverture. */
.lb-facade-overlay__door {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 3;
  transition: transform 3s ease-out, opacity 0.5s ease-out;
  pointer-events: none;
  will-change: transform;
}
.lb-facade-overlay__door--left {
  clip-path: polygon( 40% 32%, 50% 32%, 50% 78%, 40% 78% );
}
.lb-facade-overlay__door--right {
  clip-path: polygon( 50% 32%, 58% 32%, 58% 78%, 50% 78% );
}
.lb-facade-overlay__door--left.is-open  { transform: translateX( -10vw ); }
.lb-facade-overlay__door--right.is-open { transform: translateX(  10vw ); }

/* v1.43.5 — Plus d'animation CSS sur la vidéo. La vraie motion vient du
   loop continu de la portion "portes ouvertes + feuillage" (les 2 dernières
   secondes des MP4 sources). Le feuillage bouge en continu via la vidéo
   elle-même, pas besoin de simulation CSS. */

/* Reduce motion : pas de fade-in (apparition brutale), mais la vidéo joue
   quand même — c'est le contenu informationnel essentiel. */
@media (prefers-reduced-motion: reduce) {
  .lb-facade-overlay { transition: none !important; }
}

/* === v1.41.1 / v1.43.91 — Bouton "Retour" coin bas-gauche === */
/* v1.43.91 : style unifié sur tous les boutons Retour du site
   (noir semi-transparent + cadre crème + texte cream Georgia).
   Position bas-gauche conservée pour cohérence avec les autres
   pages (.lb-pavillon-back, .lb-passerelle__back). */
.lb-facade-overlay__back {
  position: absolute;
  bottom: 1.75rem;
  left: 1.75rem;
  z-index: 12;                /* au-dessus de la vidéo, du panneau et de l'enter */
  display: inline-block;
  padding: 8px 18px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(244, 220, 174, 0.5);
  color: #f4dcae;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 22px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.lb-facade-overlay__back:hover,
.lb-facade-overlay__back:focus-visible {
  background: rgba(244, 220, 174, 0.2);
  transform: scale(1.04);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.4);
  color: #f4dcae;
  text-decoration: none;
  outline: none;
}
.lb-facade-overlay__back:focus-visible {
  outline: 2px solid #f4dcae;
  outline-offset: 2px;
}

.lb-facade-overlay__back:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* === v1.40.1 — Bouton "Entrer" CTA (style paillasson, discret) === */
/* Positionné en bas des portes ouvertes (~22% du bas du viewport),
   centré horizontalement, comme un paillasson d'entrée. Sobre, sans
   uppercase ni shadow dominant — invite sans crier. */
.lb-facade-overlay__enter {
  position: absolute;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  z-index: 11;             /* au-dessus de la vidéo et du panneau (z:10) */
  padding: 0.4em 1.6em;
  background: linear-gradient(180deg, #a37346, #8B5E3C 70%, #6e4528);
  color: #fff;
  border: 2px solid #5C3A1E;
  border-radius: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.9rem, 1.25vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease-in, transform 0.2s ease, box-shadow 0.2s ease;
}

.lb-facade-overlay__enter.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.lb-facade-overlay__enter:hover,
.lb-facade-overlay__enter:focus-visible {
  transform: translateX(-50%) translateY(-1px) scale(1.04);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  outline: none;
}

.lb-facade-overlay__enter:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .lb-facade-overlay__enter { transition: none; }
}

/* === v1.40.1 — Panneau pub "Annoncez-vous ici" sur façades === */
/* Sur les 5 façades standards (pas Sanctuaire) pendant la lecture vidéo.
   Bas-droite (planté dans le sol devant la façade). v1.40.1 : taille
   augmentée à 25vw (min 240 max 400) pour meilleure présence visuelle. */
.lb-panneau-pub {
  position: absolute;       /* relatif à .lb-facade-overlay (position:fixed) */
  bottom: 15%;
  top: auto;
  transform: none;
  width: 25vw;
  min-width: 240px;
  max-width: 400px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 10;              /* au-dessus de la vidéo (z natural dans overlay) */
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
  transition: transform 0.25s ease, filter 0.25s ease;
}

/* v1.39.0 façade côté droit (par défaut historique) */
.lb-panneau-pub--droite { right: 3%; left: auto; }

/* v1.43.86 façade côté gauche (consigne Johanne — symétrique du droit) */
.lb-panneau-pub--gauche { left: 3%; right: auto; }

.lb-panneau-pub:hover,
.lb-panneau-pub:focus-visible {
  /* v1.49.2 — Pattern unifié : luminosité dorée seulement, pas de zoom */
  filter: drop-shadow(0 8px 24px rgba(255, 215, 100, 0.65));
  outline: none;
}

.lb-panneau-pub:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  border-radius: 8px;
}

.lb-panneau-pub__img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.lb-panneau-pub__text {
  position: absolute;
  top: 47%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(0.72rem, 1.15vw, 1rem);
  letter-spacing: 0.02em;
  line-height: 1.18;
  text-align: center;
  color: #5C3A1E;
  pointer-events: none;
  user-select: none;
}

/* === Modal pub (charte bois/parchemin) === */
.lb-pub-modal {
  /* v1.43.38 — z:500 consigne Johanne. Note : sur la HOME via façade,
     .lb-facade-overlay est à z:9999. Le modal pub n'est pas censé être
     au-dessus de la façade overlay car il s'ouvre depuis l'intérieur de
     l'overlay (le panneau pub est DANS l'overlay). z:500 reste au-dessus
     de tout sauf l'overlay façade lui-même, c'est ce qu'on veut. */
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-pub-modal[hidden] { display: none; }

.lb-pub-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);             /* v1.43.29 — assombrissement plus léger (était 0.7) */
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* v1.40.3 — Style PARCHEMIN raffiné, appliqué à tous les pop-ups
   (façades + intérieurs). Spec Johanne :
     CARD : bg #F5E6C8 + grain SVG, border 2px #8B5E3C, radius 12px,
            shadow 4px 4px 15px rgba(0,0,0,0.35), color #3D2010
     INPUTS : bg #FFF8E7, border 1px #8B5E3C, radius 6px, color #3D2010
     SUBMIT : bg #8B5E3C, color white, radius 20px
     CLOSE X : color #8B5E3C
     TITRE : #5C3A1E (conservé pour contraste avec textes #3D2010) */
/* v1.43.29 — Reset complet (consigne Johanne "tout recommencer
   proprement"). Approche minimale :
   - card centrée, max-width 480, overflow-y auto si besoin de scroll
   - bg parchemin directement sur le card en cover (le feuillage fait
     partie de l'image, pas besoin de déborder)
   - padding 40, radius 12, ombre douce
   - PAS de ::before, PAS de z-index hack, PAS de débordement. */
.lb-pub-modal__card {
  /* v1.43.32 — Restauration du fond image parchemin-fond.png (consigne
     Johanne). Couleur cream #F5E6C8 conservée comme fallback. Bordure
     brune et ombre conservées. */
  /* v1.43.38 — z:501 explicite (au-dessus du backdrop frère). */
  position: relative;
  z-index: 501;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: #F5E6C8;
  background-image: url('../../public/assets/parchemin-fond.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border: 2px solid #8B5E3C;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.35);
  color: #3D2010;
  font-family: Georgia, "Times New Roman", serif;
  box-sizing: border-box;
}

.lb-pub-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: #8B5E3C;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.lb-pub-modal__close:hover,
.lb-pub-modal__close:focus-visible {
  background: rgba(139, 94, 60, 0.15);
  outline: none;
}

.lb-pub-modal__title {
  margin: 0 0 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #5C3A1E;
}

.lb-pub-modal__form label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #3D2010;
}

.lb-pub-modal__form label > span {
  display: block;
  margin-bottom: 0.25rem;
}

.lb-pub-modal__form input,
.lb-pub-modal__form select,
.lb-pub-modal__form textarea {
  display: block;
  width: 100%;
  padding: 0.55em 0.7em;
  font-family: inherit;
  font-size: 0.95rem;
  color: #3D2010;
  /* v1.43.26 — Plus de fond cream/blanc/gris. Le parchemin du card
     transparaît directement à travers les champs. Bordure brune
     suffit à délimiter les zones de saisie. */
  background: transparent;
  border: 1px solid #8B5E3C;
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.lb-pub-modal__form textarea {
  resize: vertical;
  min-height: 80px;
}

.lb-pub-modal__form input:focus,
.lb-pub-modal__form select:focus,
.lb-pub-modal__form textarea:focus {
  outline: none;
  border-color: #5C3A1E;
  /* v1.43.26 — Focus subtil : pas de fond, juste un anneau (box-shadow). */
  background: transparent;
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.22);
}

.lb-pub-modal__submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75em;
  background: #8B5E3C;
  color: #fff;
  border: 0;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.lb-pub-modal__submit:hover,
.lb-pub-modal__submit:focus-visible {
  background: #74492c;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
  outline: none;
}
