/**
 * «Detalle al 100 %» (efeoncepro/detail-zoom). Front end and editor.
 * Values from AXIS `efeonceGraphicLine` (copied, no build): navy ink #023c70 · ink-soft #6d6777 / #cfe4fa ·
 * ground #001a33 · paper #f7f8f6 · accent = the line of the topic (--eo-line-on-light / --eo-line-on-dark, Engine
 * fallback), only in graphics: the marker ring and the lens ring. Ohio host: own section, clear:both, its decorative
 * cursor hidden while the pointer is on the image; the dialog lives in the top layer, above the site menu (z 1001).
 */

.eo-zoom,
.eo-zoom__dialog {
	--eo-z-ink: #023c70;
	--eo-z-soft: #6d6777;
	--eo-z-ground: #001a33;
	--eo-z-paper: #f7f8f6;
	--eo-z-line: rgba(2, 60, 112, 0.16);
	--eo-z-acc: var(--eo-line-on-light, #0375db);
	--eo-z-lens: 184px;
}

.dark-scheme .eo-zoom,
.dark-scheme .eo-zoom__dialog {
	--eo-z-ink: #ffffff;
	--eo-z-soft: #cfe4fa;
	--eo-z-paper: #001a33;
	--eo-z-line: rgba(255, 255, 255, 0.14);
	--eo-z-acc: var(--eo-line-on-dark, #0375db);
}

.eo-zoom.eo-zoom {
	clear: both;
	box-sizing: border-box;
	margin: 40px 0;
	padding: 0;
	color: var(--eo-z-ink);
	font-family: "Poppins", system-ui, sans-serif;
}

.eo-zoom__stage {
	position: relative;
	overflow: hidden;
	border-radius: 16px;
	background: var(--eo-z-paper);
	touch-action: manipulation;
}

.eo-zoom.eo-zoom .eo-zoom__img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}

/* The marker frames the detail and carries its number. */
.eo-zoom .eo-zoom__marker {
	position: absolute;
	left: var(--x);
	top: var(--y);
	width: var(--w);
	height: var(--h);
	min-width: 24px;
	min-height: 24px;
	margin: 0;
	padding: 0;
	border: 2px solid #ffffff;
	border-radius: 12px;
	background: transparent;
	box-shadow: 0 0 0 2px var(--eo-z-acc), 0 6px 20px rgba(0, 26, 51, 0.28);
	color: var(--eo-z-ground);
	cursor: zoom-in;
	appearance: none;
}

.eo-zoom .eo-zoom__marker span {
	position: absolute;
	top: -12px;
	left: -12px;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #ffffff;
	color: #023c70;
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.eo-zoom .eo-zoom__marker:disabled {
	cursor: default;
}

.eo-zoom .eo-zoom__marker:focus-visible {
	outline: 3px solid var(--eo-z-acc);
	outline-offset: 3px;
}

/* The crops: a grid under the image, numbered like the markers. */
.eo-zoom.eo-zoom .eo-zoom__crops {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
	gap: 12px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.eo-zoom.eo-zoom .eo-zoom__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.eo-zoom.eo-zoom .eo-zoom__item::before,
.eo-zoom.eo-zoom .eo-zoom__item::marker {
	content: none;
}

.eo-zoom.eo-zoom .eo-zoom__crop {
	margin: 0;
}

.eo-zoom .eo-zoom__frame {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--eo-z-line);
	border-radius: 12px;
	background: var(--eo-z-paper);
}

.eo-zoom.eo-zoom .eo-zoom__cut {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}

/* Cut in CSS from the large image: inline width/left/top place the detail inside the frame. */
.eo-zoom.eo-zoom .eo-zoom__cut--css {
	position: absolute;
	height: auto;
	object-fit: fill;
}

.eo-zoom.eo-zoom .eo-zoom__crop figcaption,
.eo-zoom.eo-zoom .eo-zoom__caption {
	display: flex;
	gap: 8px;
	align-items: baseline;
	margin: 8px 0 0;
	color: var(--eo-z-soft);
	font-family: "Poppins", system-ui, sans-serif;
	font-size: 13px;
	line-height: 1.5;
	text-align: left;
}

.eo-zoom.eo-zoom .eo-zoom__caption {
	display: block;
	margin-top: 12px;
}

.eo-zoom .eo-zoom__n {
	color: var(--eo-z-ink);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* Lens (loupe mode, fine pointer only): the full-size image at 100 % under a ring in the line accent. */
.eo-zoom__lens {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	width: var(--eo-z-lens);
	height: var(--eo-z-lens);
	border: 3px solid #ffffff;
	border-radius: 50%;
	background-color: var(--eo-z-paper);
	background-repeat: no-repeat;
	box-shadow: 0 0 0 2px var(--eo-z-acc), 0 12px 32px rgba(0, 26, 51, 0.32);
	opacity: 0;
	pointer-events: none;
	transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.eo-zoom.is-lens-on .eo-zoom__lens {
	opacity: 1;
}

@media (pointer: fine) {
	.eo-zoom.has-lens .eo-zoom__stage {
		cursor: none;
	}

	.eo-zoom.has-lens .eo-zoom__marker:not(:disabled) {
		cursor: zoom-in;
	}
}

/* Ohio's decorative cursor would sit on top of the lens. */
body:has(.eo-zoom__stage:hover) .circle-cursor {
	opacity: 0 !important;
	visibility: hidden !important;
}

/* The detail at 100 % (top layer). */
.eo-zoom__dialog {
	box-sizing: border-box;
	width: min(960px, calc(100vw - 32px));
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 16px;
	border: 0;
	border-radius: 20px;
	background: var(--eo-z-paper);
	color: var(--eo-z-ink);
	font-family: "Poppins", system-ui, sans-serif;
}

.eo-zoom__dialog::backdrop {
	background: rgba(0, 26, 51, 0.72);
}

.eo-zoom__dialog-head {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 12px;
}

.eo-zoom__dialog .eo-zoom__dialog-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.eo-zoom__dialog .eo-zoom__close {
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid var(--eo-z-line);
	border-radius: 9999px;
	background: transparent;
	color: var(--eo-z-ink);
	font: 600 14px/1 "Poppins", system-ui, sans-serif;
	cursor: pointer;
}

.eo-zoom__dialog .eo-zoom__close:focus-visible {
	outline: 3px solid var(--eo-z-acc);
	outline-offset: 2px;
}

/* 1 image pixel = 1 CSS pixel: larger details scroll inside the view. */
.eo-zoom__view {
	max-height: calc(100dvh - 120px);
	overflow: auto;
	border-radius: 12px;
	overscroll-behavior: contain;
}

.eo-zoom__dialog .eo-zoom__px {
	display: block;
	max-width: none;
	margin: 0 auto;
	border-radius: 0;
	background-repeat: no-repeat;
}

.eo-proof-notice {
	clear: both;
	padding: 12px 16px;
	border: 1px dashed #6d6777;
	border-radius: 8px;
	color: #6d6777;
	font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.eo-zoom__lens {
		transition: none;
	}
}

/* 0.25.1: una imagen vertical no pasa del 82 por ciento del alto de la pantalla y se centra; las horizontales siguen a todo el ancho. */
.wp-block-efeoncepro-detail-zoom .eo-zoom__stage {
	max-width: min(100%, calc(82svh * var(--eo-w, 16) / var(--eo-h, 9)));
	margin-inline: auto;
}
