/* Focus Pop-up — styles publics. Sélecteurs renforcés pour résister aux thèmes (dont Enfold). */
html.fpop-lock { overflow: hidden; }

#fpop[hidden], #fpop-reopen[hidden], #fpop [hidden] { display: none !important; }

body #fpop {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	font-size: 16px;
	line-height: 1.6;
	--fpop-overlay: rgba(12, 12, 14, .72);
}
#fpop *, #fpop *::before, #fpop *::after { box-sizing: border-box; }

#fpop .fpop__overlay {
	position: absolute;
	inset: 0;
	background: var(--fpop-overlay);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .25s ease;
}
#fpop.is-open .fpop__overlay { opacity: 1; }

#fpop .fpop__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: var(--fpop-width);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: hidden;
	background: var(--fpop-bg);
	color: var(--fpop-text);
	border-radius: var(--fpop-radius);
	box-shadow: 0 24px 70px rgba(0, 0, 0, .4);
	outline: none;
	opacity: 0;
	transition: opacity .25s ease, transform .25s cubic-bezier(.2, .8, .3, 1);
}
#fpop.fpop--anim-zoom .fpop__dialog { transform: scale(.94); }
#fpop.fpop--anim-slide .fpop__dialog { transform: translateY(28px); }
#fpop.is-open .fpop__dialog { opacity: 1; transform: none; }

#fpop .fpop__scroll {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

#fpop button.fpop__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	cursor: pointer;
	box-shadow: none;
	transition: background .15s ease, transform .15s ease;
}
#fpop button.fpop__close:hover { background: var(--fpop-accent); color: var(--fpop-btn-text); transform: rotate(90deg); }
#fpop button.fpop__close:focus-visible,
#fpop a.fpop__cta:focus-visible { outline: 3px solid var(--fpop-accent); outline-offset: 3px; }

#fpop .fpop__media { line-height: 0; }
#fpop .fpop__media img {
	display: block;
	width: 100%;
	height: auto;
	max-height: min(var(--fpop-img-h), 60vh);
	object-fit: var(--fpop-img-fit);
	margin: 0;
	border-radius: 0;
}

#fpop .fpop__body { padding: clamp(26px, 6vw, 42px) clamp(22px, 6vw, 44px); text-align: center; }

#fpop h2.fpop__title {
	margin: 0 0 14px;
	padding: 0;
	font-size: clamp(24px, 5.4vw, 34px);
	line-height: 1.2;
	color: var(--fpop-title) !important;
	text-transform: none;
	letter-spacing: 0;
}
#fpop .fpop__text { color: var(--fpop-text); font-size: 16px; }
#fpop .fpop__text p { margin: 0 0 12px; color: inherit; font-size: inherit; line-height: 1.6; }
#fpop .fpop__text p:last-child { margin-bottom: 0; }
#fpop .fpop__text strong, #fpop .fpop__text b { color: inherit; }
#fpop .fpop__text a { color: var(--fpop-accent); text-decoration: underline; }

#fpop a.fpop__cta {
	display: inline-block;
	max-width: 100%;
	margin-top: 22px;
	padding: 13px 28px;
	background: var(--fpop-accent);
	color: var(--fpop-btn-text) !important;
	border: 0;
	border-radius: min(var(--fpop-radius), 10px);
	font-weight: 700;
	font-size: 16px;
	line-height: 1.25;
	text-decoration: none;
	transition: filter .15s ease, transform .15s ease;
}
#fpop a.fpop__cta:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Image seule : l'image entière, adaptée à l'écran */
#fpop.fpop--image-only .fpop__body { display: none; }
#fpop.fpop--image-only .fpop__dialog {
	width: auto;
	max-width: 100%;
	background: transparent;
	border-top: 0 !important; /* prioritaire sur le liseré du modèle Combat */
}
#fpop.fpop--image-only .fpop__dialog::before { display: none; }
#fpop.fpop--image-only .fpop__scroll { overflow: hidden; }
#fpop.fpop--image-only .fpop__imglink { display: block; line-height: 0; }
#fpop.fpop--image-only .fpop__media img {
	width: auto;
	height: auto;
	max-width: min(var(--fpop-width), calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	object-fit: contain;
	border-radius: var(--fpop-radius);
}

/* Modèle Combat (KMCA) */
#fpop.fpop--kmca .fpop__dialog { border-top: 6px solid var(--fpop-accent); }
#fpop.fpop--kmca .fpop__dialog::before {
	content: "";
	position: absolute;
	z-index: 1;
	top: 0;
	bottom: 0;
	right: 0;
	width: 58px;
	transform: skewX(-16deg);
	transform-origin: bottom right;
	background: linear-gradient(90deg, var(--fpop-accent) 0 26%, transparent 26% 42%, #fff 42% 50%, transparent 50% 62%, var(--fpop-accent) 62% 100%);
	pointer-events: none;
}
#fpop.fpop--kmca .fpop__body { position: relative; z-index: 2; padding-right: clamp(66px, 12vw, 84px); text-align: left; }
#fpop.fpop--kmca h2.fpop__title {
	font-family: Oswald, Impact, "Arial Narrow", sans-serif !important;
	font-weight: 700;
	font-size: clamp(30px, 7vw, 44px);
	line-height: 1.08;
	text-transform: uppercase;
}
#fpop.fpop--kmca a.fpop__cta {
	padding: 13px 26px;
	border-radius: 0;
	font-family: Oswald, Impact, "Arial Narrow", sans-serif;
	font-size: 18px;
	letter-spacing: .8px;
	text-transform: uppercase;
	box-shadow: 5px 5px 0 #fff;
	transform: skewX(-8deg);
}
#fpop.fpop--kmca a.fpop__cta:hover { filter: none; background: #fff; color: #0a0a0a !important; box-shadow: 5px 5px 0 var(--fpop-accent); transform: skewX(-8deg); }

/* Modèle Douceur (Le Cœur des Maux) */
#fpop.fpop--coeur { --fpop-overlay: rgba(52, 28, 42, .58); --fpop-gold: #c9a24d; }
#fpop.fpop--coeur .fpop__dialog { box-shadow: 0 24px 70px rgba(60, 25, 45, .35), inset 0 0 0 1px rgba(201, 162, 77, .45); }
#fpop.fpop--coeur h2.fpop__title {
	font-family: Georgia, "Times New Roman", serif !important;
	font-weight: 400;
	font-size: clamp(26px, 5.6vw, 36px);
	margin-bottom: 0;
}
#fpop.fpop--coeur h2.fpop__title::after {
	content: "";
	display: block;
	width: 64px;
	height: 2px;
	margin: 16px auto 18px;
	background: var(--fpop-gold);
}
#fpop.fpop--coeur a.fpop__cta { border-radius: 999px; padding: 13px 32px; }
#fpop.fpop--coeur a.fpop__cta:hover { filter: none; background: var(--fpop-gold); color: #fff !important; }
#fpop.fpop--coeur button.fpop__close { background: rgba(255, 255, 255, .92); color: var(--fpop-accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
#fpop.fpop--coeur button.fpop__close:hover { background: var(--fpop-accent); color: #fff; }
#fpop.fpop--coeur .fpop__media ~ .fpop__body { padding-top: 26px; }

/* Bouton Revoir */
body button.fpop-reopen {
	position: fixed;
	z-index: 2147482000;
	bottom: 20px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 10px 16px;
	max-width: calc(100vw - 32px);
	background: var(--fpop-accent);
	color: var(--fpop-btn-text);
	border: 0;
	border-radius: min(var(--fpop-radius), 999px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
	animation: fpop-in .3s ease both;
}
body button.fpop-reopen.fpop-reopen--left { left: 20px; }
body button.fpop-reopen.fpop-reopen--right { right: 20px; }
body button.fpop-reopen:hover { filter: brightness(1.1); }
body button.fpop-reopen span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@keyframes fpop-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 767px) {
	#fpop .fpop__media img { max-height: min(var(--fpop-img-h), 32vh); }
	#fpop.fpop--kmca .fpop__dialog::before { width: 36px; }
	#fpop.fpop--kmca .fpop__body { padding-right: 46px; }
	body button.fpop-reopen { bottom: 14px; padding: 9px 13px; font-size: 13px; }
	body button.fpop-reopen.fpop-reopen--left { left: 14px; }
	body button.fpop-reopen.fpop-reopen--right { right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	#fpop .fpop__dialog, #fpop .fpop__overlay, #fpop button.fpop__close, #fpop a.fpop__cta { transition: none; }
	body button.fpop-reopen { animation: none; }
}
