/* =========================================================================
   Pop-in Evok — repris du thème evokcollection.com (assets/css/custom.css).
   Classes et comportement identiques, à deux adaptations près :

   1. UNITÉS. Le thème Evok pose 1rem = 10px (racine à 62,5 %). Storefront non :
      1rem y vaut 16px. Reprises telles quelles, les valeurs seraient 60 % trop
      grandes. Elles sont donc converties en pixels (×10), comme le port du
      footer l'a déjà fait.

   2. IMBRICATION. Le CSS d'origine utilise l'imbrication native ; elle est
      dépliée ici, pour rester lisible à côté des surcharges de Storefront.
   ========================================================================= */

.wp_popin {
	--white: #ffffff;
	--black_alt: #121212;
	--body-color: var(--black_alt);

	position: fixed;
	inset: 0;
	z-index: 1100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	visibility: hidden;
	transition: opacity .4s ease, visibility 0s linear .4s;
	font-family: var(--font-body, 'Futura PT', Arial, sans-serif);
	color: var(--body-color);
}

.wp_popin.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity .4s ease;
}

.wp_popin--wrap { position: relative; }

/* ---- Fermeture : cercle posé AU-DESSUS du contenu, sur le voile ---- */
.wp_popin--close {
	position: absolute;
	bottom: calc(100% + 16px);
	left: 50%;
	transform: translateX(-50%);
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--white);
	border-radius: 50%;
	color: var(--white);
	font-size: 24px;
	font-weight: 400;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	transition: background .3s ease, color .3s ease;
}
.wp_popin--close:hover {
	background: var(--white);
	color: var(--black_alt);
}

/* ---- Contenu : média à gauche, texte à droite ---- */
.wp_popin--content {
	display: flex;
	width: min(92vw, 880px);
	max-height: 80vh;
	min-height: min(420px, 70vh);
	background: var(--white);
	box-shadow: 0 8px 50px rgba(0, 0, 0, .25);
	overflow: hidden;
}

.wp_popin--media {
	flex: 0 0 50%;
	position: relative;
}
.wp_popin--media img,
.wp_popin--media iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.wp_popin--media img { object-fit: cover; }

.wp_popin--body {
	flex: 0 0 50%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 45px;
	text-align: center;
	overflow-y: auto;
}

/* ---- Variante « visuel portrait » (9/16) ---- */
.wp_popin .wp_popin--media.is-short {
	flex: 0 0 auto;
	height: min(70vh, 620px);
	aspect-ratio: 9 / 16;
}
.wp_popin .wp_popin--content:has(.is-short) {
	width: auto;
	max-width: min(92vw, 800px);
}
.wp_popin .wp_popin--content:has(.is-short) .wp_popin--body {
	flex: 1 1 auto;
	min-width: 300px;
}

/* ---- Variante sans média ---- */
.wp_popin .wp_popin--content.is-text-only {
	width: min(92vw, 560px) !important;
	min-height: 0 !important;
}
.wp_popin .wp_popin--content.is-text-only .wp_popin--body {
	flex: 1 1 100% !important;
}

/* ---- Typographie interne ---- */
.wp_popin--surtitle {
	margin: 0 0 8px;
	font-size: 12px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--body-color);
}
.wp_popin--title {
	font-family: var(--font-display, 'Portrait', Georgia, serif);
	font-weight: 300;
	font-size: 34px;
	line-height: 1.15;
	margin: 0 0 16px;
	color: var(--body-color);
}
.wp_popin--body .wp_wysiwyg { font-size: 15px; line-height: 1.6; }

/* Bouton : les styles `.btn` du thème Evok sont limités à `header.header`,
   ils ne descendent pas jusqu'ici. On les reprend, à l'identique du header
   (13px, interlettrage 1.04px, bordure pleine), plutôt que d'élargir leur
   portée — ce qui les ferait déborder sur les boutons de WooCommerce. */
.wp_popin--body .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	margin-top: 24px;
	padding: 10px 20px;
	border: 1px solid var(--body-color);
	background: transparent;
	color: var(--body-color);
	font-family: inherit;
	font-size: 13px;
	font-weight: 400;
	line-height: 22px;
	letter-spacing: 1.04px;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: color .3s ease, background-color .3s ease;
}
.wp_popin--body .btn:hover {
	background: var(--body-color);
	color: var(--white);
}

/* Le bouton de fermeture reçoit le focus à l'ouverture : on remplace le
   liseré par défaut du navigateur, très visible, par un halo discret. */
.wp_popin--close:focus { outline: none; }
.wp_popin--close:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
}

/* Soulignement animé des liens du texte, comme sur le site principal */
.wp_popin .wp_wysiwyg a {
	position: relative;
	text-decoration: none;
}
.wp_popin .wp_wysiwyg a::after {
	display: block;
	content: "";
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 100%;
	height: 1px;
	background: var(--body-color);
	transition: width .35s ease;
}

/* Le défilement de la page est bloqué tant que la pop-in est ouverte. */
body.evok-popin-ouverte { overflow: hidden; }

/* ---- Mobile : empilé, croix rentrée dans l'angle ---- */
@media (max-width: 767px) {
	.wp_popin--content {
		flex-direction: column;
		width: min(92vw, 420px);
		max-height: 75vh;
		overflow-y: auto;
	}
	.wp_popin--media {
		flex: 0 0 auto;
		aspect-ratio: 3 / 2;
	}
	.wp_popin--body {
		flex: 0 0 auto;
		padding: 35px 30px 30px;
	}
	.wp_popin .wp_popin--media.is-short {
		height: auto;
		width: 100%;
		aspect-ratio: 9 / 16;
		max-height: 50vh;
	}
	.wp_popin .wp_popin--close {
		bottom: auto;
		left: auto;
		transform: none;
		top: 15px;
		right: 15px;
		z-index: 2;
		width: 38px;
		height: 38px;
		font-weight: 100;
	}
	/* Sans média, le fond est blanc : la croix blanche y disparaîtrait. */
	.wp_popin .wp_popin--wrap:has(.is-text-only) .wp_popin--close {
		top: 10px;
		right: 10px;
		background: none;
		border: none;
		color: var(--black_alt);
	}
	.wp_popin--title { font-size: 28px; }
}
