/**
 * Click-to-enlarge overlay for the hero featured image.
 *
 * Loaded only on singular theme-rendered views that have a featured image —
 * never on a landing page, which owns its own cascade.
 *
 * Colours come from the theme palette where it exists, with literal fallbacks
 * so the overlay is never unstyled if the plugin outlives the theme.
 */

/* ── Trigger ──────────────────────────────── */
.sy-zoom-trigger {
	display: block;
	position: relative;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	line-height: 0;
}

.sy-zoom-trigger img {
	display: block;
	width: 100%;
	height: auto;
}

/* The affordance. Without it nobody discovers the image is interactive. */
.sy-zoom-hint {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	width: 2rem;
	height: 2rem;
	display: grid;
	place-content: center;
	border-radius: 50%;
	background: var( --wp--preset--color--cream, #faf8f3 );
	color: var( --wp--preset--color--charcoal, #1f2933 );
	box-shadow: 0 1px 6px rgba( 31, 41, 51, 0.25 );
	opacity: 0.9;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.sy-zoom-trigger:hover .sy-zoom-hint,
.sy-zoom-trigger:focus-visible .sy-zoom-hint {
	opacity: 1;
	transform: scale( 1.06 );
}

.sy-zoom-hint svg {
	width: 1rem;
	height: 1rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.sy-zoom-trigger:focus-visible {
	outline: 2px solid var( --wp--preset--color--sage-700, #4a6b58 );
	outline-offset: 3px;
}

/* ── Overlay ──────────────────────────────── */
.sy-zoom-lock,
.sy-zoom-lock body {
	overflow: hidden;
}

.sy-zoom {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	padding: clamp( 0.75rem, 3vw, 2.5rem );
	background: rgba( 22, 26, 24, 0.92 );
	opacity: 0;
	transition: opacity 0.2s ease;
	overflow: auto;
}

.sy-zoom.is-open {
	opacity: 1;
}

.sy-zoom[hidden] {
	display: none;
}

.sy-zoom__figure {
	margin: 0;
	max-width: 100%;
	line-height: 0;
}

/*
 * The chart this exists for is 1200px wide. Allowing it past its natural size
 * would only blur it, so the overlay caps at 100% and lets the viewport decide.
 */
.sy-zoom__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc( 100vh - 2 * clamp( 0.75rem, 3vw, 2.5rem ) );
	background: #fff;
}

.sy-zoom__close {
	position: fixed;
	top: clamp( 0.5rem, 2vw, 1.25rem );
	right: clamp( 0.5rem, 2vw, 1.25rem );
	width: 2.75rem;
	height: 2.75rem;
	display: grid;
	place-content: center;
	padding: 0;
	border: 1px solid rgba( 255, 255, 255, 0.35 );
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.35 );
	color: #fff;
	cursor: pointer;
}

.sy-zoom__close:hover {
	background: rgba( 0, 0, 0, 0.6 );
}

.sy-zoom__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.sy-zoom__close svg {
	width: 1.15rem;
	height: 1.15rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

@media ( prefers-reduced-motion: reduce ) {
	.sy-zoom,
	.sy-zoom-hint {
		transition: none;
	}
}
