/**
 * Photo gallery — Figma 1768:901394
 * Pinterest-style masonry: 3 fixed columns + aspect-ratio slots (no column reflow).
 */
.dg-gallery-page {
	--dg-bg: #f9f7f5;
	--dg-surface: #ffffff;
	--dg-text: #323c48;
	--dg-max: 172.8rem;
	--dg-sidebar: 56.2rem;
	--dg-pad: clamp(2rem, 5.8vw, 5rem);
	--dg-gap: 3rem;
	background: var(--dg-bg);
	padding-top: var(--delco-header-height, 13.9rem) !important;
}

/* Pin header immediately — avoids absolute→fixed scroll gap */
.dg-gallery-page .header {
	position: fixed !important;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 1100;
	animation: none !important;
}

.dg-gallery-page .second_banner,
.dg-gallery-page .gallery_banner {
	display: none !important;
}

/* ── Shell ─────────────────────────────────────────────────────────────────── */
.dg-gallery {
	padding: 0 0 6rem;
	background: var(--dg-bg);
}

.dg-gallery__layout {
	display: grid;
	grid-template-columns: minmax(0, var(--dg-sidebar)) minmax(0, 1fr);
	align-items: start;
	max-width: var(--dg-max);
	margin: 0 auto;
	background: var(--dg-surface);
}

/* ── Sidebar nav ───────────────────────────────────────────────────────────── */
.dg-gallery__nav {
	padding: 5rem 0 5rem;
	background: var(--dg-bg);
	position: sticky;
	top: var(--delco-header-height, 13.9rem);
	align-self: start;
	max-height: calc(100vh - var(--delco-header-height, 13.9rem));
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.dg-gallery__nav-title {
	margin: 0 0 2.9rem;
	padding: 0 var(--dg-pad);
	font-family: var(--delco-font-display);
	font-size: var(--delco-type-display-sm);
	font-weight: 500;
	line-height: 1.2;
	color: var(--dg-text);
}

.dg-gallery__nav-group + .dg-gallery__nav-group {
	margin-top: 2.9rem;
}

.dg-gallery__nav-heading {
	margin: 0 0 1rem;
	padding: 0 var(--dg-pad);
	font-family: var(--delco-font-title);
	font-size: var(--delco-type-body-lg);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.2rem;
	text-transform: uppercase;
	color: var(--dg-text);
}

.dg-gallery__nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.dg-gallery__nav-link {
	display: block;
	padding: 1rem var(--dg-pad);
	font-family: var(--delco-font-body);
	font-size: var(--delco-type-body-lg);
	line-height: 1.35;
	color: #000;
	text-decoration: none;
	background: var(--dg-bg);
	transition: background 0.2s ease, color 0.2s ease;
}

.dg-gallery__nav-link:hover {
	color: var(--dg-text);
	text-decoration: none;
	background: #fff;
}

.dg-gallery__nav-link.is-active {
	background: #fff;
	font-weight: 500;
}

/* ── Main content ──────────────────────────────────────────────────────────── */
.dg-gallery__main {
	padding: 5rem var(--dg-pad) 5rem;
	background: var(--dg-surface);
	min-width: 0;
}

.dg-gallery__header {
	margin-bottom: 3rem;
}

.dg-gallery__eyebrow {
	margin: 0 0 1rem;
	font-family: var(--delco-font-title);
	font-size: var(--delco-type-body-lg);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.2rem;
	text-transform: uppercase;
	color: var(--dg-text);
}

.dg-gallery__title {
	margin: 0;
	font-family: var(--delco-font-display);
	font-size: var(--delco-type-display-xl);
	font-weight: 500;
	line-height: 1.1;
	color: var(--dg-text);
	text-transform: none;
}

.dg-gallery__empty {
	margin: 0;
	font-family: var(--delco-font-body);
	font-size: var(--delco-type-body-lg);
	color: var(--dg-text);
}

/* ── Pinterest masonry — independent columns (no row gaps) ───────────────── */
.dg-masonry,
.dg-videos {
	display: flex;
	align-items: flex-start;
	gap: var(--dg-gap);
	width: 100%;
	min-width: 0;
}

.dg-masonry__col,
.dg-videos__col {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--dg-gap);
}

.dg-masonry--mobile,
.dg-videos--mobile {
	display: none;
}

.dg-masonry__item {
	display: block;
	width: 100%;
	min-width: 0;
	border-radius: 2rem;
	overflow: hidden;
	text-decoration: none;
	background: #ece9e4;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dg-masonry__item:hover {
	transform: translateY(-0.3rem);
	box-shadow: 0 1.2rem 2.8rem rgba(0, 0, 0, 0.12);
}

.dg-masonry__frame {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: var(--dg-aspect, 4 / 3);
	overflow: hidden;
	border-radius: 2rem;
	background: #ece9e4;
}

.dg-masonry__item img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	min-width: 0;
	object-fit: cover;
	border-radius: 2rem;
}

/* ── Video grid ────────────────────────────────────────────────────────────── */
.dg-videos__item {
	display: block;
	width: 100%;
	min-width: 0;
	border: none;
	padding: 0;
	background: #ece9e4;
	cursor: pointer;
	border-radius: 2rem;
	overflow: hidden;
	aspect-ratio: 16 / 9;
}

.dg-videos__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 2rem;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
	.dg-gallery__layout {
		grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
	}
}

@media (max-width: 900px) {
	.dg-gallery-page {
		--dg-gap: 0.8rem;
		--dg-pad: 1.2rem;
		overflow-x: clip;
	}

	.dg-gallery,
	.dg-gallery__layout,
	.dg-gallery__main {
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	.dg-gallery__layout {
		display: flex;
		flex-direction: column;
		grid-template-columns: 1fr;
	}

	.dg-gallery__main {
		order: 1;
		padding: 2rem var(--dg-pad) 2.4rem;
	}

	.dg-gallery__nav {
		display: none !important;
	}

	.dg-gallery__header {
		margin-bottom: 1.2rem;
	}

	.dg-gallery__eyebrow {
		text-align: center;
		margin-bottom: 1.2rem;
	}

	.dg-gallery__title {
		font-size: var(--delco-type-display-md);
		margin-top: 1.2rem;
	}

	/* Mobile category dropdown */
	.dg-gallery__filters {
		margin: 0;
		padding: 0;
	}

	.dg-gallery__filter-label {
		display: block;
		margin: 0 0 0.6rem;
		font-family: var(--delco-font-title);
		font-size: 1rem;
		font-weight: 600;
		line-height: 1;
		letter-spacing: 0.12em;
		text-transform: uppercase;
		color: rgba(50, 60, 72, 0.55);
	}

	.dg-gallery__filter-select-wrap {
		position: relative;
	}

	.dg-gallery__filter-select-wrap::after {
		content: '';
		position: absolute;
		top: 50%;
		right: 1.4rem;
		width: 0.8rem;
		height: 0.8rem;
		border-right: 0.15rem solid var(--dg-text);
		border-bottom: 0.15rem solid var(--dg-text);
		transform: translateY(-70%) rotate(45deg);
		pointer-events: none;
	}

	.dg-gallery__filter-select {
		display: block;
		width: 100%;
		min-height: 4.4rem;
		padding: 0.9rem 3.6rem 0.9rem 1.2rem;
		border: 0.1rem solid rgba(50, 60, 72, 0.16);
		border-radius: 1rem;
		background: var(--dg-bg);
		color: var(--dg-text);
		font-family: var(--delco-font-body);
		font-size: 1.4rem;
		font-weight: 500;
		line-height: 1.3;
		appearance: none;
		-webkit-appearance: none;
		cursor: pointer;
	}

	.dg-gallery__filter-select:focus {
		outline: 0.2rem solid rgba(22, 76, 168, 0.35);
		outline-offset: 0.1rem;
	}

	.dg-masonry--desktop,
	.dg-videos--desktop {
		display: none !important;
	}

	.dg-masonry--mobile,
	.dg-videos--mobile {
		display: flex !important;
	}

	.dg-gallery-page .dg-masonry__item,
	.dg-gallery-page .dg-videos__item {
		border-radius: 1.2rem;
	}

	.dg-gallery-page .dg-masonry__frame,
	.dg-gallery-page .dg-masonry__item img,
	.dg-gallery-page .dg-videos__item,
	.dg-gallery-page .dg-videos__item img {
		border-radius: 1.2rem;
	}

	.dg-gallery-page .dg-masonry__frame {
		position: relative;
	}

	.dg-gallery-page .dg-masonry__item img,
	.dg-gallery-page .dg-videos__item img {
		position: absolute;
		inset: 0;
		width: 100% !important;
		height: 100% !important;
		max-width: none !important;
		min-width: 0 !important;
		object-fit: cover !important;
	}

	.dg-gallery-page .dg-videos__item {
		position: relative;
		overflow: hidden;
	}

	.dg-gallery-page .dg-masonry__item:hover {
		transform: none;
		box-shadow: none;
	}
}

/* Desktop/tablet: hide mobile chip strip */
@media (min-width: 901px) {
	.dg-gallery__filters {
		display: none;
	}
}

@media (max-width: 640px) {
	.dg-gallery__filter-select {
		font-size: 1.35rem;
		min-height: 4.2rem;
	}
}
