/**
 * Elementor Topography Gallery 94 — Front-end styles.
 * Text domain: etpg94
 */

.etpg94-widget {
	--etpg94-land: #fff8e0;
	--etpg94-water: #66ccff;
	--etpg94-line: #000000;
	position: relative;
	width: 100%;
}

.etpg94-stage {
	position: relative;
	width: 100%;
	height: 600px;
	min-height: 300px;
	overflow: hidden;
	background: #0a0a0a;
	border-radius: 0;
	isolation: isolate;
	cursor: crosshair;
	-webkit-user-select: none;
	user-select: none;
	touch-action: pan-y;
}

/* ----------------------------------------------------------------------
 * Media layer (background image / video)
 * -------------------------------------------------------------------- */
/*
 * The media layer is the raw image/video source used to feed pixel data
 * into the canvas texture. It must never be visible on its own — only
 * the processed contour-line canvas should be seen. It stays fully
 * opaque (so the browser still decodes/loads it at normal priority) but
 * visually hidden behind the canvas via z-index AND clip, as a double
 * safety net against any flash-of-raw-image during load.
 */
.etpg94-media-layer {
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 0;
	pointer-events: none;
}

.etpg94-media-item {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
}

.etpg94-media-item.is-active {
	opacity: 1;
	visibility: visible;
}

.etpg94-image,
.etpg94-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ----------------------------------------------------------------------
 * Loading state: shown until the first contour frame has rendered,
 * preventing any flash of the unprocessed source image.
 * -------------------------------------------------------------------- */
.etpg94-stage {
	background: #d9d2b8;
}

.etpg94-stage::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 4;
	background: #d9d2b8;
	opacity: 1;
	transition: opacity 0.5s ease;
	pointer-events: none;
}

.etpg94-stage.is-ready::before {
	opacity: 0;
	pointer-events: none;
}

/* ----------------------------------------------------------------------
 * Canvas: contour-line / heightmap rendering surface
 * -------------------------------------------------------------------- */
.etpg94-canvas {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: block;
	mix-blend-mode: normal;
}

/* ----------------------------------------------------------------------
 * Elevation labels (e.g. "100m", "200m")
 * -------------------------------------------------------------------- */
.etpg94-labels-layer {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	font-family: 'Courier New', Consolas, monospace;
}

.etpg94-elev-label {
	position: absolute;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	padding: 1px 5px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.55);
	color: var(--etpg94-line);
	white-space: nowrap;
	transform: translate(-50%, -50%);
	text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

/* ----------------------------------------------------------------------
 * HUD: current water level readout
 * -------------------------------------------------------------------- */
.etpg94-hud {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 5;
	font-family: 'Courier New', Consolas, monospace;
	font-size: 11px;
	letter-spacing: 1px;
	color: #fff;
	background: rgba(0, 0, 0, 0.5);
	padding: 6px 10px;
	border-radius: 3px;
	pointer-events: none;
	text-transform: uppercase;
	display: flex;
	flex-direction: column;
	gap: 2px;
	line-height: 1.3;
}

.etpg94-hud-label {
	opacity: 0.7;
	font-size: 9px;
}

.etpg94-hud-level {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.5px;
}

/* ----------------------------------------------------------------------
 * Navigation arrows + dots
 * -------------------------------------------------------------------- */
.etpg94-nav {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: space-between;
	pointer-events: none;
	padding: 0 10px;
}

.etpg94-nav-btn {
	pointer-events: auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}

.etpg94-nav-btn:hover,
.etpg94-nav-btn:focus-visible {
	background: rgba(0, 0, 0, 0.7);
	transform: scale(1.05);
}

.etpg94-dots {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 6;
	display: flex;
	gap: 8px;
}

.etpg94-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.8);
	background: rgba(255, 255, 255, 0.25);
	cursor: pointer;
	padding: 0;
	transition: background 0.2s ease, transform 0.2s ease;
}

.etpg94-dot.is-active,
.etpg94-dot:hover {
	background: #fff;
	transform: scale(1.15);
}

/* ----------------------------------------------------------------------
 * Caption + expand button
 * -------------------------------------------------------------------- */
.etpg94-caption {
	position: absolute;
	bottom: 16px;
	right: 16px;
	z-index: 6;
	max-width: 60%;
	font-size: 13px;
	color: #fff;
	background: rgba(0, 0, 0, 0.45);
	padding: 6px 12px;
	border-radius: 3px;
}

.etpg94-expand-btn {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 6;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}

.etpg94-expand-btn:hover,
.etpg94-expand-btn:focus-visible {
	background: rgba(0, 0, 0, 0.7);
	transform: scale(1.08);
}

/* ----------------------------------------------------------------------
 * Lightbox
 * -------------------------------------------------------------------- */
.etpg94-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
}

.etpg94-lightbox.is-open {
	display: flex;
}

.etpg94-lightbox-overlay {
	position: absolute;
	inset: 0;
	background: rgba(5, 5, 8, 0.92);
}

.etpg94-lightbox-inner {
	position: relative;
	width: min(94vw, 1400px);
	height: min(92vh, 900px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.etpg94-lightbox-media,
.etpg94-lightbox-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.etpg94-lightbox-media {
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
}

.etpg94-lightbox-media img,
.etpg94-lightbox-media video {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.5s ease;
}

.etpg94-lightbox-media img.is-loaded,
.etpg94-lightbox-media video.is-loaded {
	opacity: 1;
}

.etpg94-lightbox-canvas {
	z-index: 2;
	opacity: 0;
	transition: opacity 0.5s ease;
	pointer-events: none;
}

.etpg94-lightbox-canvas.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.etpg94-lightbox-close,
.etpg94-lightbox-prev,
.etpg94-lightbox-next {
	position: absolute;
	z-index: 5;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease;
}

.etpg94-lightbox-close {
	top: -48px;
	right: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
}

.etpg94-lightbox-prev,
.etpg94-lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 22px;
}

.etpg94-lightbox-prev {
	left: -56px;
}

.etpg94-lightbox-next {
	right: -56px;
}

.etpg94-lightbox-close:hover,
.etpg94-lightbox-prev:hover,
.etpg94-lightbox-next:hover {
	background: rgba(255, 255, 255, 0.2);
}

.etpg94-lightbox-topo-toggle {
	position: absolute;
	bottom: -44px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 5;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #fff;
	padding: 7px 16px;
	border-radius: 16px;
	font-size: 12px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease;
}

.etpg94-lightbox-topo-toggle[aria-pressed="true"],
.etpg94-lightbox-topo-toggle:hover {
	background: rgba(255, 255, 255, 0.22);
}

.etpg94-lightbox-caption {
	position: absolute;
	bottom: -78px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.8);
	font-size: 13px;
	text-align: center;
	max-width: 90%;
}

@media (max-width: 767px) {
	.etpg94-lightbox-prev {
		left: 6px;
	}
	.etpg94-lightbox-next {
		right: 6px;
	}
	.etpg94-lightbox-close {
		top: 6px;
		right: 6px;
	}
	.etpg94-lightbox-topo-toggle {
		bottom: 8px;
	}
	.etpg94-lightbox-caption {
		bottom: -36px;
		font-size: 11px;
	}
}

/* ----------------------------------------------------------------------
 * Misc / utility / accessibility
 * -------------------------------------------------------------------- */
.etpg94-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

.etpg94-empty-notice {
	padding: 40px;
	text-align: center;
	background: #f5f5f5;
	color: #555;
	border: 1px dashed #ccc;
}

.etpg94-editor-hint {
	position: absolute;
	bottom: 8px;
	left: 8px;
	font-size: 11px;
	color: rgba(255, 255, 255, 0.6);
	background: rgba(0, 0, 0, 0.4);
	padding: 3px 8px;
	border-radius: 3px;
	z-index: 9;
}

/* Reduced motion: disable idle tide drift animation transitions */
@media (prefers-reduced-motion: reduce) {
	.etpg94-media-item,
	.etpg94-nav-btn,
	.etpg94-dot,
	.etpg94-expand-btn {
		transition: none !important;
	}
}

/* Focus visibility for keyboard users */
.etpg94-stage:focus-visible {
	outline: 2px solid var(--etpg94-water);
	outline-offset: -2px;
}

.etpg94-nav-btn:focus-visible,
.etpg94-dot:focus-visible,
.etpg94-expand-btn:focus-visible,
.etpg94-lightbox-close:focus-visible,
.etpg94-lightbox-prev:focus-visible,
.etpg94-lightbox-next:focus-visible,
.etpg94-lightbox-topo-toggle:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
