/*
 * E2IT - agrandissement d une image (composant reutilisable).
 * Bouton pose sur l image, fenetre plein ecran (dialog natif).
 */

.e2it-agrandir__cadre {
	position: relative;
}

.e2it-agrandir img {
	cursor: zoom-in;
}

/* ---- Bouton sur l image ---- */
.e2it-agrandir__bouton:not(#e2it) {
	position: absolute;
	z-index: 2;
	right: 14px;
	bottom: 14px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 16px 0 12px;
	border: 0;
	border-radius: var(--e2it-rayon-pilule);
	background: rgba(255, 255, 255, .94);
	color: var(--e2it-marine);
	font: 600 14px/1 var(--e2it-police);
	box-shadow: 0 8px 24px rgba(7, 28, 62, .25);
	cursor: pointer;
	transition: background-color .2s ease, transform .25s var(--e2it-courbe);
}

.e2it-agrandir__bouton:not(#e2it):hover {
	background: var(--e2it-blanc);
	transform: translateY(-2px);
}

.e2it-agrandir__bouton:focus-visible {
	outline: 2px solid var(--e2it-accent);
	outline-offset: 3px;
}

/* Icone : quatre coins qui s ecartent. */
.e2it-agrandir__icone {
	position: relative;
	width: 16px;
	height: 16px;
	flex: none;
	background:
		linear-gradient(currentColor, currentColor) 0 0 / 6px 2px,
		linear-gradient(currentColor, currentColor) 0 0 / 2px 6px,
		linear-gradient(currentColor, currentColor) 100% 0 / 6px 2px,
		linear-gradient(currentColor, currentColor) 100% 0 / 2px 6px,
		linear-gradient(currentColor, currentColor) 0 100% / 6px 2px,
		linear-gradient(currentColor, currentColor) 0 100% / 2px 6px,
		linear-gradient(currentColor, currentColor) 100% 100% / 6px 2px,
		linear-gradient(currentColor, currentColor) 100% 100% / 2px 6px;
	background-repeat: no-repeat;
}

/* ---- Fenetre ---- */
html.e2it-visionneuse-ouverte {
	overflow: hidden;
}

.e2it-visionneuse {
	width: 100vw;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.e2it-visionneuse::backdrop {
	background: rgba(7, 28, 62, .92);
}

.e2it-visionneuse[open] {
	display: flex;
	align-items: center;
	justify-content: center;
	animation: e2it-visionneuse-entree .25s var(--e2it-courbe);
}

@keyframes e2it-visionneuse-entree {
	from { opacity: 0; transform: scale(.98); }
	to { opacity: 1; transform: none; }
}

.e2it-visionneuse__figure {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 72px 24px 32px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
}

.e2it-visionneuse__image:not(#e2it) {
	display: block;
	max-width: min(100%, 1600px);
	max-height: calc(100% - 64px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 10px;
	box-shadow: 0 30px 80px rgba(3, 12, 28, .5);
	cursor: default;
}

.e2it-visionneuse__legende {
	max-width: 820px;
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	text-align: center;
	color: var(--e2it-bleu-clair);
}

.e2it-visionneuse__conseil {
	display: none;
	margin: 0;
	font: 500 11px/1.4 var(--e2it-police-mono);
	letter-spacing: .1em;
	text-transform: uppercase;
	text-align: center;
	color: var(--e2it-glacier);
}

.e2it-visionneuse__fermer:not(#e2it) {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(169, 196, 229, .45);
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
	color: var(--e2it-blanc);
	cursor: pointer;
	transition: background-color .2s ease;
}

.e2it-visionneuse__fermer::before {
	content: "×";
	font: 400 26px/1 var(--e2it-police);
}

.e2it-visionneuse__fermer:not(#e2it):hover {
	background: rgba(255, 255, 255, .18);
}

.e2it-visionneuse__fermer:focus-visible {
	outline: 2px solid var(--e2it-accent);
	outline-offset: 3px;
}

/* Telephone tenu a la verticale : conseil de rotation. */
@media (max-width: 767px) and (orientation: portrait) {
	.e2it-visionneuse__conseil {
		display: block;
	}

	.e2it-visionneuse__figure {
		padding: 72px 12px 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.e2it-visionneuse[open] {
		animation: none;
	}

	.e2it-agrandir__bouton:not(#e2it),
	.e2it-agrandir__bouton:not(#e2it):hover {
		transition: none;
		transform: none;
	}
}
