/**
 * L'Aire Bête — Portes vitrées d'entrée
 *
 * Overlay plein écran joué au premier visit de la session
 * (sessionStorage). Fronton + 2 portes coulissantes + CTA.
 */

/* === Overlay principal ================================================= */

.lb-entrance {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	pointer-events: auto;
	transition: opacity 0.5s ease;
}

/* FOUC guard : si le visiteur est déjà entré dans cette session,
   l'overlay n'est jamais peint (classe ajoutée par le script inline). */
.lb-entered .lb-entrance {
	display: none !important;
}

/* Fade-out final avant display:none */
.lb-entrance.is-closed {
	opacity: 0;
	pointer-events: none;
}

/* === Fronton (pediment) ================================================ */

.lb-entrance-pediment {
	flex: 0 0 auto;
	padding: var(--lb-space-xl) var(--lb-space-md);
	background: linear-gradient(180deg,
		var(--lb-blanc-casse) 0%,
		rgba(250, 247, 242, 0.95) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--lb-space-lg);
	box-shadow: 0 4px 20px rgba(26, 122, 110, 0.15);
	z-index: 2;
	transition: transform 1.2s cubic-bezier(0.65, 0, 0.35, 1),
				opacity 1s ease;
}

.lb-entrance-leaf {
	width: clamp(50px, 8vw, 100px);
	height: auto;
	flex-shrink: 0;
}

.lb-entrance-leaf--right {
	transform: scaleX(-1);
}

.lb-entrance-titles {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.lb-entrance-title {
	font-family: var(--lb-font-titre);
	color: var(--lb-sarcelle);
	font-size: clamp(2rem, 5vw, 3.5rem);
	margin: 0;
	line-height: 1;
}

.lb-entrance-subtitle {
	font-family: var(--lb-font-corps);
	color: var(--lb-bois-fonce);
	font-size: clamp(0.875rem, 2vw, 1.125rem);
	margin: var(--lb-space-sm) 0 0;
}

/* === Portes ============================================================ */

.lb-doors {
	flex: 1 1 auto;
	position: relative;
	display: flex;
	overflow: hidden;
}

.lb-door {
	flex: 1 1 50%;
	position: relative;
	background: linear-gradient(135deg,
		rgba(255, 255, 255, 0.30) 0%,
		rgba(184, 223, 240, 0.25) 30%,
		rgba(255, 255, 255, 0.20) 70%,
		rgba(255, 255, 255, 0.40) 100%);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 2px solid var(--lb-or);
	box-shadow:
		inset 0 0 60px rgba(255, 255, 255, 0.15),
		var(--lb-shadow-lg);
	transition: transform 1.5s cubic-bezier(0.7, 0, 0.3, 1);
}

.lb-door--left  { border-right-width: 1px; }
.lb-door--right { border-left-width:  1px; }

/* Surface vitrée — reflet diagonal subtil */
.lb-door-glass {
	position: absolute;
	inset: 6px;
	background: linear-gradient(170deg,
		rgba(255, 255, 255, 0.40) 0%,
		rgba(255, 255, 255, 0.05) 30%,
		rgba(255, 255, 255, 0.10) 60%,
		rgba(255, 255, 255, 0.45) 100%);
	pointer-events: none;
}

/* Poignée verticale sur le bord intérieur */
.lb-door-handle {
	position: absolute;
	top: 50%;
	width: 6px;
	height: clamp(80px, 16vh, 160px);
	transform: translateY(-50%);
	background: linear-gradient(180deg,
		var(--lb-or-clair) 0%,
		var(--lb-or) 50%,
		var(--lb-or-fonce) 100%);
	border-radius: var(--lb-radius-full);
	box-shadow:
		0 2px 6px rgba(0, 0, 0, 0.25),
		inset 0 0 4px rgba(255, 255, 255, 0.5);
}

.lb-door--left  .lb-door-handle { right: 14px; }
.lb-door--right .lb-door-handle { left:  14px; }

/* === CTA "Cliquez pour entrer" ========================================= */

.lb-door-cta {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 3;
	padding: var(--lb-space-md) var(--lb-space-xl);
	font-family: var(--lb-font-corps);
	font-size: var(--lb-text-base);
	font-weight: 600;
	letter-spacing: 0.05em;
	color: var(--lb-blanc-casse);
	background: rgba(26, 122, 110, 0.85);
	border: 2px solid var(--lb-or);
	border-radius: var(--lb-radius-full);
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(26, 122, 110, 0.4);
	animation: lb-cta-pulse 2.5s ease-in-out infinite;
	transition: background 0.3s ease, transform 0.3s ease, opacity 0.4s ease;
}

.lb-door-cta:hover,
.lb-door-cta:focus-visible {
	background: rgba(26, 122, 110, 0.95);
	transform: translate(-50%, -50%) scale(1.05);
}

.lb-door-cta:focus-visible {
	outline: 3px solid var(--lb-or-clair);
	outline-offset: 4px;
}

/* Pulse via box-shadow uniquement → ne touche pas au transform de centrage */
@keyframes lb-cta-pulse {
	0%, 100% {
		box-shadow: 0 4px 16px rgba(26, 122, 110, 0.4);
	}
	50% {
		box-shadow:
			0 4px 28px rgba(26, 122, 110, 0.6),
			0 0 0 14px rgba(26, 122, 110, 0.10);
	}
}

/* === Animation d'ouverture ============================================= */

.lb-entrance.is-opening .lb-door--left {
	transform: translateX(-105%);
}

.lb-entrance.is-opening .lb-door--right {
	transform: translateX(105%);
}

.lb-entrance.is-opening .lb-door-cta {
	opacity: 0;
	pointer-events: none;
	animation: none;
}

.lb-entrance.is-opening .lb-entrance-pediment {
	transform: translateY(-100%);
	opacity: 0;
}

/* === Reduced motion ==================================================== */
@media (prefers-reduced-motion: reduce) {
	.lb-door-cta {
		animation: none;
	}
}
