/* Everest Custom Elements: work-gallery.css
   everest_work_gallery. Modes: gallery (chips + lightbox), compare (before/after), clips (video).
   Photos are real <img>; selectors carry the parent class because ".elementor img" outranks single classes. */

.ehf-wg {
	box-sizing: border-box;
	padding-block: var(--ehf-pad-section);
	background: var(--ehf-c-surface);
	color: var(--ehf-c-body);
	font-family: var(--ehf-ff-body);
}

.ehf-wg--bg-tint {
	background: var(--ehf-c-tint-50);
}

.ehf-wg__inner {
	box-sizing: border-box;
	max-width: var(--ehf-container);
	margin-inline: auto;
	padding-inline: var(--ehf-gutter);
}

.ehf-wg__head {
	display: flex;
	flex-direction: column;
	gap: var(--ehf-s-1);
	max-width: var(--ehf-container-narrow);
	margin-bottom: var(--ehf-s-4);
}

.ehf-wg__eyebrow {
	margin: 0;
	font-size: var(--ehf-fs-eyebrow);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ehf-c-primary);
}

.ehf-wg__heading {
	margin: 0;
	font-family: var(--ehf-ff-head);
	font-size: var(--ehf-fs-h2);
	font-weight: 800;
	line-height: 1.15;
	color: var(--ehf-c-ink);
	text-wrap: balance;
}

.ehf-wg__sub {
	margin: 0;
	font-size: var(--ehf-fs-body);
	line-height: 1.65;
	max-width: var(--ehf-prose);
}

/* ---- Filter chips ------------------------------------------------------------------------ */
.ehf-wg__filters {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ehf-s-1);
	margin-bottom: var(--ehf-s-3);
}

.ehf-wg__filters[hidden] {
	display: none;
}

.ehf-wg .ehf-wg__chip {
	box-sizing: border-box;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--ehf-c-tint-200);
	border-radius: var(--ehf-r-pill);
	background: var(--ehf-c-tint-100);
	color: var(--ehf-c-primary-900);
	font-family: var(--ehf-ff-body);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color var(--ehf-dur) var(--ehf-ease), color var(--ehf-dur) var(--ehf-ease), border-color var(--ehf-dur) var(--ehf-ease);
}

.ehf-wg .ehf-wg__chip:hover {
	border-color: var(--ehf-c-primary);
	background: #ffffff;
	color: var(--ehf-c-primary);
}

.ehf-wg .ehf-wg__chip.is-active,
.ehf-wg .ehf-wg__chip[aria-pressed="true"] {
	border-color: var(--ehf-c-primary);
	background: var(--ehf-c-primary);
	color: #ffffff;
}

.ehf-wg__more-wrap {
	display: flex;
	justify-content: center;
	margin-top: var(--ehf-s-4);
}

.ehf-wg .ehf-wg__more {
	box-sizing: border-box;
	min-height: 48px;
	padding: 0 24px;
	border: 1px solid var(--ehf-c-primary);
	border-radius: var(--ehf-r-md);
	background: #ffffff;
	color: var(--ehf-c-primary);
	font-family: var(--ehf-ff-head);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}

.ehf-wg .ehf-wg__more:hover {
	background: var(--ehf-c-primary);
	color: #ffffff;
}

.ehf-wg__more-wrap[hidden] {
	display: none;
}

.ehf-wg__status {
	margin: 0 0 var(--ehf-s-2);
	font-size: var(--ehf-fs-small);
	color: var(--ehf-c-body);
}

.ehf-wg__status[hidden] {
	display: none;
}

/* ---- Gallery grid: uniform 4:5 tiles (the lightbox shows the whole photo) ------------------------ */
.ehf-wg__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--ehf-s-3) var(--ehf-gap-grid);
}

.ehf-wg--cols-2 .ehf-wg__grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ehf-wg--cols-3 .ehf-wg__grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ehf-wg .ehf-wg__item {
	margin: 0;
	padding: 0;
	min-width: 0;
}

.ehf-wg .ehf-wg__item[hidden],
.ehf-wg .ehf-wg__item.is-more {
	display: none;
}

.ehf-wg__fig {
	margin: 0;
}

.ehf-wg__link {
	display: block;
	overflow: hidden;
	border-radius: var(--ehf-r-lg);
	background: var(--ehf-c-tint-100);
	line-height: 0;
}

.ehf-wg .ehf-wg__link .ehf-wg__img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 0;
	transition: transform 320ms var(--ehf-ease);
}

.ehf-wg .ehf-wg__link:hover .ehf-wg__img {
	transform: scale(1.03);
}

.ehf-wg figcaption.ehf-wg__cap,
.ehf-wg-lb .ehf-wg-lb__cap {
	font-style: normal;
}

.ehf-wg__cap {
	margin-top: 8px;
	font-size: var(--ehf-fs-small);
	line-height: 1.45;
	color: var(--ehf-c-body);
}

/* ---- Before / after sliders -------------------------------------------------------------- */
.ehf-wg__pairs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--ehf-s-4) var(--ehf-gap-grid);
}

.ehf-wg__pair {
	margin: 0;
	min-width: 0;
}

.ehf-wg .ehf-wg__pair--wide .ehf-wg__cmp {
	aspect-ratio: 4 / 3;
}

.ehf-wg__cmp {
	position: relative;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	border-radius: var(--ehf-r-lg);
	background: var(--ehf-c-tint-100);
	box-shadow: var(--ehf-shadow-1);
	--ehf-wg-pos: 50%;
}

.ehf-wg .ehf-wg__cmp .ehf-wg__cmp-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 0;
	object-fit: cover;
}

.ehf-wg .ehf-wg__cmp .ehf-wg__cmp-img--before {
	clip-path: inset(0 calc(100% - var(--ehf-wg-pos)) 0 0);
}

.ehf-wg__tag {
	position: absolute;
	top: 12px;
	padding: 4px 10px;
	border-radius: var(--ehf-r-pill);
	background: rgba(6, 58, 82, 0.86);
	color: #ffffff;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	pointer-events: none;
}

.ehf-wg__tag--before {
	left: 12px;
}

.ehf-wg__tag--after {
	right: 12px;
}

.ehf-wg__handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--ehf-wg-pos);
	width: 3px;
	margin-left: -1.5px;
	background: #ffffff;
	box-shadow: 0 0 0 1px rgba(6, 58, 82, 0.25);
	pointer-events: none;
}

.ehf-wg__knob {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: var(--ehf-shadow-2);
	color: var(--ehf-c-primary);
}

.ehf-wg__knob svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ehf-wg .ehf-wg__range {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: ew-resize;
	touch-action: pan-y;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
}

.ehf-wg .ehf-wg__range[hidden] {
	display: none;
}

.ehf-wg .ehf-wg__range:focus-visible {
	opacity: 1;
	outline: 3px solid var(--ehf-focus-color);
	outline-offset: -3px;
	background: transparent;
}

.ehf-wg .ehf-wg__range:focus-visible::-webkit-slider-runnable-track {
	background: transparent;
}

/* ---- Clips ---------------------------------------------------------------------------------- */
.ehf-wg__clips {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--ehf-s-4) var(--ehf-gap-grid);
}

.ehf-wg__clip {
	margin: 0;
	min-width: 0;
}

.ehf-wg .ehf-wg__clip .ehf-wg__video {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	aspect-ratio: 9 / 16;
	object-fit: cover;
	border-radius: var(--ehf-r-lg);
	background: var(--ehf-c-footer-base);
}

/* ---- Lightbox (built by work-gallery.js) -------------------------------------------------- */
.ehf-wg-lb {
	box-sizing: border-box;
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(6, 12, 20, 0.94);
	color: #ffffff;
	font-family: var(--ehf-ff-body);
}

.ehf-wg-lb::backdrop {
	background: rgba(6, 12, 20, 0.94);
}

.ehf-wg-lb__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	height: 100%;
	padding: 64px 72px 24px;
	box-sizing: border-box;
}

.ehf-wg-lb .ehf-wg-lb__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(100dvh - 160px);
	border-radius: var(--ehf-r-sm);
	object-fit: contain;
}

.ehf-wg-lb__cap {
	margin: 0;
	max-width: 70ch;
	font-size: 15px;
	line-height: 1.45;
	text-align: center;
	color: #e6eef3;
}

.ehf-wg-lb__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
	cursor: pointer;
}

.ehf-wg-lb__btn:hover {
	background: rgba(255, 255, 255, 0.28);
}

.ehf-wg-lb__btn:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 3px;
}

.ehf-wg-lb__btn svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ehf-wg-lb__close {
	top: 12px;
	right: 12px;
}

.ehf-wg-lb__prev {
	top: 50%;
	left: 12px;
	margin-top: -24px;
}

.ehf-wg-lb__next {
	top: 50%;
	right: 12px;
	margin-top: -24px;
}

/* ---- Responsive --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.ehf-wg__grid,
	.ehf-wg--cols-2 .ehf-wg__grid,
	.ehf-wg--cols-3 .ehf-wg__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ehf-wg__pairs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ehf-wg__clips {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ehf-wg__grid,
	.ehf-wg--cols-2 .ehf-wg__grid,
	.ehf-wg--cols-3 .ehf-wg__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 12px;
	}

	.ehf-wg__pairs {
		grid-template-columns: minmax(0, 1fr);
	}

	.ehf-wg__clips {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--ehf-s-3) 12px;
	}

	.ehf-wg-lb__stage {
		padding: 64px 12px 16px;
	}

	.ehf-wg-lb__prev {
		top: auto;
		bottom: 16px;
		left: 12px;
		margin-top: 0;
	}

	.ehf-wg-lb__next {
		top: auto;
		bottom: 16px;
		right: 12px;
		margin-top: 0;
	}

	.ehf-wg-lb .ehf-wg-lb__img {
		max-height: calc(100dvh - 210px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ehf-wg .ehf-wg__link .ehf-wg__img {
		transition: none;
	}

	.ehf-wg .ehf-wg__link:hover .ehf-wg__img {
		transform: none;
	}
}
