/* Eric Clua — Pop-up affiche (v2.0.1) */

.ecp {
	--ecp-accent: var(--accent, #e30613);
	--ecp-accent-2: var(--accent-2, #b8050f);
	--ecp-ink: var(--ink, #12161a);
	--ecp-ease: cubic-bezier(.2, .8, .2, 1);
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: clamp(12px, 3vmin, 32px);
	box-sizing: border-box;
}
.ecp[hidden] { display: none; }

.ecp__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(11, 21, 29, .55);
	-webkit-backdrop-filter: blur(14px) saturate(.8);
	backdrop-filter: blur(14px) saturate(.8);
	opacity: 0;
	transition: opacity .45s var(--ecp-ease);
	cursor: pointer;
}
/* Sans backdrop-filter : voile plus dense pour garder la lisibilité. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.ecp__backdrop { background: rgba(11, 21, 29, .86); }
}

.ecp__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: min(92vw, calc((100vh - 2 * clamp(12px, 3vmin, 32px) - 36px) * 1138 / 1600));
	width: 100%;
	outline: none;
	opacity: 0;
	transform: translateY(24px) scale(.96);
	transition: opacity .5s var(--ecp-ease), transform .55s var(--ecp-ease);
	transition-delay: .08s;
}

.ecp.is-open .ecp__backdrop { opacity: 1; }
.ecp.is-open .ecp__dialog { opacity: 1; transform: none; }
.ecp.is-closing .ecp__backdrop { opacity: 0; transition-duration: .3s; }
.ecp.is-closing .ecp__dialog { opacity: 0; transform: translateY(12px) scale(.98); transition-duration: .3s; transition-delay: 0s; }

.ecp__figure {
	margin: 0;
	width: 100%;
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	box-shadow:
		0 40px 90px -20px rgba(0, 0, 0, .6),
		0 0 0 1px rgba(255, 255, 255, .12);
	line-height: 0;
}
.ecp__img-link {
	display: block;
	outline-offset: -4px;
}
.ecp__img {
	display: block;
	width: 100%;
	height: auto;
	max-height: calc(100vh - 2 * clamp(12px, 3vmin, 32px) - 36px);
	object-fit: contain;
	transform: scale(1);
	transform-origin: 50% 50%;
	transition: transform .8s var(--ecp-ease);
}
.ecp__img-link:hover .ecp__img,
.ecp__img-link:focus-visible .ecp__img { transform: scale(1.025); }

/* Bouton fermer : pastille blanche sur l'angle. */
.ecp__close {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 2;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--ecp-ink);
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
	transition: transform .35s var(--ecp-ease), background .25s, color .25s;
	-webkit-tap-highlight-color: transparent;
}
.ecp__close:hover {
	background: var(--ecp-accent);
	color: #fff;
	transform: rotate(90deg) scale(1.06);
}
.ecp__close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Bouton d'action : chevauche le bas de l'affiche. */
.ecp__cta {
	position: relative;
	z-index: 2;
	margin-top: -22px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 22px 13px 24px;
	border-radius: 999px;
	background: var(--ecp-accent);
	color: #fff;
	font: 700 14px/1 Archivo, system-ui, -apple-system, sans-serif;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	box-shadow: 0 14px 30px -8px rgba(227, 6, 19, .6);
	transition: background .25s, transform .35s var(--ecp-ease), box-shadow .35s var(--ecp-ease);
}
.ecp__cta svg { transition: transform .35s var(--ecp-ease); }
.ecp__cta:hover,
.ecp__cta:focus-visible {
	background: var(--ecp-accent-2);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 18px 34px -8px rgba(227, 6, 19, .7);
}
.ecp__cta:hover svg { transform: translateX(4px); }
.ecp__cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.ecp__sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Verrou du défilement pendant l'ouverture. */
html.ecp-lock,
html.ecp-lock body { overflow: hidden; }

@media (max-width: 560px) {
	.ecp__close { top: -10px; right: -6px; width: 40px; height: 40px; }
	.ecp__cta { font-size: 13px; padding: 12px 18px 12px 20px; margin-top: -20px; }
	.ecp__figure { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.ecp__backdrop,
	.ecp__dialog,
	.ecp__img,
	.ecp__close,
	.ecp__cta,
	.ecp__cta svg { transition: none !important; }
	.ecp__img-link:hover .ecp__img { transform: none; }
}
