/**
 * Gallery page — Stitch masonry + lightbox on the MARA design system.
 */

.gal {
	--gal-red: var(--mara-primary, #c62828);
	--gal-navy: #12263a;
	--gal-gold: var(--mara-secondary, #d4a017);
	--gal-surface: #f7f7f8;
	--gal-line: #e6e6e8;
	color: var(--mara-text, #333);
	background: #fff;
	overflow-x: clip;
}

.gal a:focus-visible,
.gal button:focus-visible,
.gal input:focus-visible,
.gal select:focus-visible,
.gal summary:focus-visible {
	outline: 2px solid var(--gal-gold);
	outline-offset: 3px;
}

.gal__eyebrow {
	display: inline-flex;
	margin: 0 0 0.55rem;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gal-gold);
}

.gal__section-title {
	margin: 0;
	font-family: var(--mara-font-heading);
	font-size: clamp(1.45rem, 3vw, 2rem);
	font-weight: 800;
	line-height: 1.15;
	color: var(--gal-navy);
}

.gal__section-intro {
	margin: 0.65rem auto 0;
	max-width: 36rem;
	line-height: 1.6;
	color: var(--mara-text-muted, #556);
}

.gal__section-head {
	text-align: center;
	margin-bottom: 1.5rem;
}

.gal__section-head--left {
	text-align: left;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.gal__accent-line {
	display: inline-block;
	width: 2.25rem;
	height: 3px;
	border-radius: 999px;
	background: var(--gal-red);
	flex-shrink: 0;
}

.gal__empty {
	margin: 0;
	padding: 1.5rem 0;
	text-align: center;
	color: var(--mara-text-muted, #556);
}

/* Hero — compact elegant */
.gal__hero {
	position: relative;
	isolation: isolate;
	min-height: clamp(12rem, 28vw, 17rem);
	display: flex;
	align-items: center;
	padding: clamp(1.6rem, 3.5vw, 2.4rem) 0;
	color: #fff;
	overflow: hidden;
}

.gal__hero-media,
.gal__hero-media img,
.gal__hero-scrim {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.gal__hero-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 40%;
	filter: saturate(0.95) contrast(1.05);
}

.gal__hero-scrim {
	background:
		linear-gradient(105deg, rgba(8, 14, 22, 0.88) 0%, rgba(8, 14, 22, 0.72) 48%, rgba(8, 14, 22, 0.58) 100%);
	pointer-events: none;
}

.gal__hero-inner {
	position: relative;
	z-index: 1;
	max-width: 38rem;
}

.gal__hero-title {
	margin: 0;
	font-family: var(--mara-font-heading);
	font-size: clamp(1.6rem, 3.6vw, 2.25rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.08;
	color: #fff;
	text-wrap: balance;
	text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4);
}

.gal__hero-rule {
	display: block;
	width: 2.75rem;
	height: 2px;
	margin: 0.65rem 0 0.7rem;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--gal-gold), rgba(212, 160, 23, 0.15));
}

.gal__hero-intro {
	margin: 0;
	max-width: 32rem;
	font-size: 0.95rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.92);
}

.gal__hero .gal__eyebrow {
	color: var(--gal-gold);
}

/* Editorial */
.gal__editorial {
	padding: clamp(1.75rem, 4vw, 2.75rem) 0;
	background: #fff;
}

.gal__editorial-grid {
	display: grid;
	gap: 0.75rem;
}

.gal__editorial-item {
	margin: 0;
	overflow: hidden;
	border-radius: 0.65rem;
	background: var(--gal-surface);
}

.gal__editorial-btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.gal__editorial-btn img {
	width: 100%;
	height: 100%;
	min-height: 12rem;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.gal__editorial-btn:hover img {
	transform: scale(1.03);
}

/* Feed / filters */
.gal__feed {
	padding: 0 0 clamp(2rem, 5vw, 3.25rem);
	background: #fff;
}

.gal__filters {
	margin-bottom: 1.35rem;
}

.gal__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 0.85rem;
	padding: 0;
	list-style: none;
}

.gal__cat {
	padding: 0.5rem 0.95rem;
	border: 1px solid var(--gal-line);
	border-radius: 0.4rem;
	background: #fff;
	color: #445;
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.gal__cat.is-active {
	background: #111;
	border-color: #111;
	color: #fff;
}

.gal__advanced summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--gal-navy);
}

.gal__advanced-grid {
	display: grid;
	gap: 0.85rem;
	margin-top: 0.85rem;
	padding: 1rem;
	border: 1px solid var(--gal-line);
	border-radius: 0.5rem;
	background: var(--gal-surface);
}

.gal__advanced-grid p {
	margin: 0;
	display: grid;
	gap: 0.3rem;
}

.gal__advanced-grid label {
	font-size: 0.8rem;
	font-weight: 700;
}

.gal__advanced-grid input,
.gal__advanced-grid select {
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--gal-line);
	border-radius: 0.35rem;
	font: inherit;
	background: #fff;
}

/* Masonry */
.gal__masonry {
	column-count: 1;
	column-gap: 0.85rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gal__item {
	break-inside: avoid;
	margin: 0 0 0.85rem;
}

.gal__card {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 0.45rem;
	overflow: hidden;
	background: var(--gal-surface);
	text-align: left;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(18, 38, 58, 0.05);
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.gal__card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgba(18, 38, 58, 0.1);
}

.gal__media {
	position: relative;
	display: block;
}

.gal__media img {
	width: 100%;
	height: auto;
	display: block;
	vertical-align: middle;
}

.gal__item--tall .gal__media img {
	aspect-ratio: 3 / 4;
	object-fit: cover;
	width: 100%;
}

.gal__item--wide .gal__media img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
}

.gal__badge {
	position: absolute;
	left: 0.6rem;
	bottom: 0.6rem;
	padding: 0.2rem 0.45rem;
	border-radius: 0.25rem;
	background: rgba(17, 17, 17, 0.78);
	color: #fff;
	font-size: 0.65rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.gal__caption {
	display: block;
	padding: 0.65rem 0.75rem 0.8rem;
	font-family: var(--mara-font-heading);
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--gal-navy);
}

.gal__more-wrap {
	margin-top: 1.5rem;
	text-align: center;
}

/* Videos */
.gal__videos {
	padding: clamp(2rem, 5vw, 3.25rem) 0;
	background: var(--gal-surface);
	border-top: 1px solid var(--gal-line);
}

.gal__video-grid {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gal-video__btn {
	display: grid;
	gap: 0.75rem;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	text-align: left;
	cursor: pointer;
	color: inherit;
	font: inherit;
}

.gal-video__thumb {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 0.65rem;
	background: #1a1a1a;
	aspect-ratio: 16 / 9;
}

.gal-video__thumb img,
.gal-video__placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gal-video__placeholder {
	background: linear-gradient(135deg, #2a3140, #121820);
}

.gal-video__play {
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background: var(--gal-red);
	color: #fff;
	box-shadow: 0 10px 24px rgba(198, 40, 40, 0.35);
}

.gal-video__title {
	display: block;
	font-family: var(--mara-font-heading);
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--gal-navy);
}

.gal-video__duration {
	display: inline-block;
	margin-top: 0.25rem;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--gal-red);
}

.gal-video__desc {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--mara-text-muted, #556);
}

/* CTA */
.gal__cta {
	position: relative;
	isolation: isolate;
	padding: clamp(2.5rem, 6vw, 4rem) 0;
	color: #fff;
	text-align: center;
	overflow: hidden;
}

.gal__cta-media,
.gal__cta-media img,
.gal__cta-scrim {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.gal__cta-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gal__cta-scrim {
	background:
		linear-gradient(180deg, rgba(8, 12, 18, 0.78) 0%, rgba(8, 12, 18, 0.86) 100%);
	pointer-events: none;
}

.gal__cta-inner {
	position: relative;
	z-index: 1;
	max-width: 36rem;
}

.gal__cta-title {
	margin: 0;
	font-family: var(--mara-font-heading);
	font-size: clamp(1.6rem, 3.5vw, 2.25rem);
	font-weight: 800;
	line-height: 1.15;
	color: #fff;
	text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}

.gal__cta-intro {
	margin: 0.75rem 0 0;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.92);
}

.gal__cta-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.7rem;
	margin-top: 1.25rem;
}

.gal .mara-btn--outline-light {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.75);
	color: #fff;
}

.gal .mara-btn--outline-light:hover,
.gal .mara-btn--outline-light:focus-visible {
	background: rgba(255, 255, 255, 0.1);
	border-color: #fff;
}

/* Lightbox */
.gal-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gal-lightbox[hidden] {
	display: none !important;
}

.gal-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(7, 13, 20, 0.88);
}

.gal-lightbox__dialog {
	position: relative;
	z-index: 1;
	width: min(96vw, 72rem);
	max-height: 94vh;
	display: grid;
	grid-template-rows: auto 1fr auto;
	gap: 0.75rem;
	padding: 0.85rem;
}

.gal-lightbox__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	color: #fff;
}

.gal-lightbox__tools {
	display: flex;
	gap: 0.35rem;
}

.gal-lightbox__tool,
.gal-lightbox__close,
.gal-lightbox__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	min-height: 2.5rem;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: 0;
	cursor: pointer;
}

.gal-lightbox__tool:hover,
.gal-lightbox__close:hover,
.gal-lightbox__nav:hover {
	background: rgba(255, 255, 255, 0.22);
}

.gal-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
}

.gal-lightbox__nav--prev { left: 0.35rem; }
.gal-lightbox__nav--next { right: 0.35rem; }

.gal-lightbox__stage {
	margin: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 40vh;
}

.gal-lightbox__stage img {
	max-width: 100%;
	max-height: min(72vh, 860px);
	width: auto;
	height: auto;
	object-fit: contain;
	transform-origin: center center;
	transition: transform 0.2s ease;
}

.gal-lightbox__meta {
	color: #fff;
	text-align: center;
	max-width: 40rem;
	margin: 0 auto;
}

.gal-lightbox__category {
	margin: 0 0 0.25rem;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
}

.gal-lightbox__title {
	margin: 0;
	font-family: var(--mara-font-heading);
	font-size: 1.2rem;
	font-weight: 800;
}

.gal-lightbox__description,
.gal-lightbox__date {
	margin: 0.35rem 0 0;
	font-size: 0.92rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.82);
}

/* Video modal */
.gal-video-modal {
	position: fixed;
	inset: 0;
	z-index: 10060;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.gal-video-modal[hidden] {
	display: none !important;
}

.gal-video-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(7, 13, 20, 0.72);
}

.gal-video-modal__panel {
	position: relative;
	z-index: 1;
	width: min(96vw, 56rem);
	background: #0f141c;
	border-radius: 0.85rem;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.gal-video-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	color: #fff;
}

.gal-video-modal__title {
	margin: 0;
	font-family: var(--mara-font-heading);
	font-size: 1.05rem;
	font-weight: 800;
}

.gal-video-modal__close {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 1.35rem;
	line-height: 1;
}

.gal-video-modal__stage {
	aspect-ratio: 16 / 9;
	background: #000;
}

.gal-video-modal__iframe,
.gal-video-modal__video {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

body.gal-lightbox-open,
body.gal-video-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.gal__editorial-btn img,
	.gal__card,
	.gal-lightbox__stage img {
		transition: none;
	}
}

@media (min-width: 600px) {
	.gal__masonry { column-count: 2; }
	.gal__editorial-grid {
		grid-template-columns: 1.4fr 1fr;
		grid-template-rows: 1fr 1fr;
	}
	.gal__editorial-item--primary {
		grid-row: 1 / span 2;
	}
	.gal__editorial-item--primary .gal__editorial-btn img {
		min-height: 100%;
		height: 100%;
	}
	.gal__advanced-grid {
		grid-template-columns: 1.4fr 1fr 1fr auto;
		align-items: end;
	}
	.gal__video-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (min-width: 900px) {
	.gal__masonry { column-count: 3; }
}

@media (min-width: 1100px) {
	.gal__masonry { column-count: 4; }
	.gal__video-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1280px) {
	.gal__masonry { column-count: 5; }
}
