/* ==========================================================================
   JOD Events — Modern Editorial Layered Carousel Gallery
   ========================================================================== */

.gallery-page {
	background: var(--background, #fffefa);
	color: var(--foreground, #26231f);
	min-height: 100vh;
}

.editorial-gallery-main {
	position: relative;
	overflow-x: clip;
	padding-top: calc(var(--site-header-height, 4.6rem) + 1.2rem);
	padding-bottom: 4rem;
}

.editorial-gallery-section {
	position: relative;
	width: 100%;
}

.gallery-container {
	width: 100%;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 1.5rem;
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Gallery Header
   -------------------------------------------------------------------------- */
.gallery-header {
	text-align: center;
	margin-bottom: 1.6rem;
}

.gallery-eyebrow {
	font-family: var(--body, sans-serif);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #64748b;
	margin: 0 0 0.5rem;
}

html[data-theme="dark"] .gallery-eyebrow {
	color: #94a3b8;
}

.gallery-heading {
	margin: 0 0 0.6rem;
	font-family: var(--display, 'Grift', sans-serif);
	font-size: clamp(2.2rem, 4.5vw, 3.4rem);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -0.035em;
	color: #0f172a;
}

html[data-theme="dark"] .gallery-heading {
	color: #f8fafc;
}

.gallery-description {
	font-size: clamp(0.95rem, 1.8vw, 1.1rem);
	line-height: 1.6;
	color: #64748b;
	margin: 0 auto;
	max-width: 620px;
	font-weight: 450;
}


html[data-theme="dark"] .gallery-description {
	color: #94a3b8;
}

@media (max-width: 640px) {
	.hide-mobile {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   Category Pill Filters
   -------------------------------------------------------------------------- */
.gallery-filters-wrapper {
	display: flex;
	justify-content: center;
	margin-bottom: 2.4rem;
	width: 100%;
}

.gallery-filters-scroll {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	overflow-x: auto;
	padding: 0.35rem 0.5rem;
	max-width: 100%;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.gallery-filters-scroll::-webkit-scrollbar {
	display: none;
}

.gallery-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	padding: 0.55rem 1.35rem;
	border-radius: 9999px;
	font-size: 0.88rem;
	font-weight: 600;
	font-family: var(--body, sans-serif);
	border: 1.5px solid #cbd5e1;
	background: #ffffff;
	color: #334155;
	cursor: pointer;
	transition: all 0.22s cubic-bezier(0.2, 0, 0, 1);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	user-select: none;
}

.gallery-pill:hover {
	border-color: #94a3b8;
	color: #0f172a;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.gallery-pill:focus-visible {
	outline: 2px solid var(--primary, #FF7508);
	outline-offset: 2px;
}

.gallery-pill.is-active {
	background: #0b0d17;
	color: #ffffff;
	border-color: #0b0d17;
	box-shadow: 0 4px 12px rgba(11, 13, 23, 0.25);
	transform: translateY(-1px);
}

html[data-theme="dark"] .gallery-pill {
	background: #1e293b;
	color: #cbd5e1;
	border-color: #334155;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .gallery-pill:hover {
	background: #334155;
	color: #f8fafc;
	border-color: #475569;
}

html[data-theme="dark"] .gallery-pill.is-active {
	background: #f8fafc;
	color: #0b0d17;
	border-color: #f8fafc;
	box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   Modern Editorial Layered Carousel
   -------------------------------------------------------------------------- */
.editorial-carousel-wrapper {
	position: relative;
	width: 100%;
	height: 520px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: visible;
	margin: 0 auto;
	touch-action: pan-y pinch-zoom;
	user-select: none;
}

.editorial-carousel-track {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Gallery Card (4:5 Aspect Ratio) */
.editorial-card {
	position: absolute;
	width: 360px;
	height: 450px;
	aspect-ratio: 4 / 5;
	border-radius: 20px;
	overflow: hidden;
	background: #0f172a;
	cursor: pointer;
	transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1),
	            opacity 0.46s cubic-bezier(0.22, 1, 0.36, 1),
	            box-shadow 0.46s cubic-bezier(0.22, 1, 0.36, 1),
	            filter 0.46s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform, opacity, box-shadow;
	outline: none;
	border: 0;
	padding: 0;
}

.editorial-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.editorial-card:hover img {
	transform: scale(1.04);
}

.editorial-card-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.65) 100%);
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.editorial-card-info {
	position: absolute;
	left: 1.25rem;
	right: 1.25rem;
	bottom: 1.1rem;
	z-index: 2;
	color: #ffffff;
	pointer-events: none;
}

.editorial-card-tag {
	display: inline-block;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.2rem 0.55rem;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.22);
	backdrop-filter: blur(8px);
	margin-bottom: 0.35rem;
}

.editorial-card-title {
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.25;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	margin: 0;
}

/* Video Play Badge */
.editorial-card-play {
	position: absolute;
	bottom: 1.1rem;
	right: 1.1rem;
	z-index: 3;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: blur(6px);
	color: #0f172a;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.editorial-card:hover .editorial-card-play {
	transform: scale(1.12);
	background: #ffffff;
}

.editorial-card-play svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	margin-left: 2px;
}

/* --------------------------------------------------------------------------
   Layered Positioning (Desktop: Center 360x450, Sides 300x375)
   Side scale = 300 / 360 = 0.8333
   -------------------------------------------------------------------------- */

/* Center (Featured) Card */
.editorial-card[data-pos="0"] {
	z-index: 10;
	transform: translate3d(0, 0, 0) scale(1);
	opacity: 1;
	box-shadow: 0 25px 55px -12px rgba(15, 23, 42, 0.42), 0 0 1px rgba(0, 0, 0, 0.2);
	cursor: pointer;
}

/* Immediate Left (pos: -1) */
.editorial-card[data-pos="-1"] {
	z-index: 5;
	transform: translate3d(-240px, 0, 0) scale(0.8333);
	opacity: 0.88;
	box-shadow: 0 16px 36px -10px rgba(15, 23, 42, 0.28);
	filter: brightness(0.96);
}

/* Immediate Right (pos: 1) */
.editorial-card[data-pos="1"] {
	z-index: 5;
	transform: translate3d(240px, 0, 0) scale(0.8333);
	opacity: 0.88;
	box-shadow: 0 16px 36px -10px rgba(15, 23, 42, 0.28);
	filter: brightness(0.96);
}

/* Far Left (pos: -2) */
.editorial-card[data-pos="-2"] {
	z-index: 2;
	transform: translate3d(-440px, 0, 0) scale(0.68);
	opacity: 0.55;
	box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.2);
	filter: brightness(0.9);
}

/* Far Right (pos: 2) */
.editorial-card[data-pos="2"] {
	z-index: 2;
	transform: translate3d(440px, 0, 0) scale(0.68);
	opacity: 0.55;
	box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.2);
	filter: brightness(0.9);
}

/* Outer Left (pos < -2) */
.editorial-card[data-pos="hidden-left"] {
	z-index: 1;
	transform: translate3d(-580px, 0, 0) scale(0.55);
	opacity: 0;
	pointer-events: none;
}

/* Outer Right (pos > 2) */
.editorial-card[data-pos="hidden-right"] {
	z-index: 1;
	transform: translate3d(580px, 0, 0) scale(0.55);
	opacity: 0;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Minimal Circular Carousel Navigation
   -------------------------------------------------------------------------- */
.editorial-carousel-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	margin-top: 2.8rem;
}

.carousel-nav-btn {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1.5px solid #0f172a;
	background: transparent;
	color: #0f172a;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.22s cubic-bezier(0.2, 0, 0, 1);
	outline: none;
	padding: 0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.carousel-nav-btn svg {
	width: 20px;
	height: 20px;
	transition: transform 0.22s ease;
}

.carousel-nav-btn:hover {
	background: #0f172a;
	color: #ffffff;
	transform: scale(1.08);
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

.carousel-nav-btn:active {
	transform: scale(0.94);
}

.carousel-nav-btn:focus-visible {
	outline: 2px solid var(--primary, #FF7508);
	outline-offset: 3px;
}

html[data-theme="dark"] .carousel-nav-btn {
	border-color: #f8fafc;
	color: #f8fafc;
}

html[data-theme="dark"] .carousel-nav-btn:hover {
	background: #f8fafc;
	color: #0f172a;
	box-shadow: 0 6px 18px rgba(255, 255, 255, 0.2);
}

/* Empty State */
.gallery-empty {
	text-align: center;
	color: #64748b;
	font-size: 1.05rem;
	margin-top: 3rem;
}

/* --------------------------------------------------------------------------
   Responsive Layouts: Tablet & Mobile
   -------------------------------------------------------------------------- */

/* Tablet (641px - 900px) */
@media (max-width: 900px) {
	.editorial-carousel-wrapper {
		height: 440px;
	}

	.editorial-card {
		width: 300px;
		height: 375px;
		border-radius: 18px;
	}

	/* Tablet: Center = 300x375, Side = 240x300 (scale: 240/300 = 0.8) */
	.editorial-card[data-pos="0"] {
		transform: translate3d(0, 0, 0) scale(1);
	}

	.editorial-card[data-pos="-1"] {
		transform: translate3d(-190px, 0, 0) scale(0.8);
	}

	.editorial-card[data-pos="1"] {
		transform: translate3d(190px, 0, 0) scale(0.8);
	}

	.editorial-card[data-pos="-2"] {
		transform: translate3d(-340px, 0, 0) scale(0.64);
		opacity: 0.35;
	}

	.editorial-card[data-pos="2"] {
		transform: translate3d(340px, 0, 0) scale(0.64);
		opacity: 0.35;
	}
}

/* Mobile (<= 640px) */
@media (max-width: 640px) {
	.editorial-gallery-main {
		padding-top: calc(var(--site-header-height, 4.6rem) + 1rem);
		padding-bottom: 3.5rem;
	}

	.gallery-header {
		margin-bottom: 1.6rem;
	}

	.gallery-filters-wrapper {
		margin-bottom: 2rem;
	}

	.editorial-carousel-wrapper {
		height: 460px;
		width: 100vw;
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
	}

	.editorial-card {
		width: min(85vw, 340px);
		height: auto;
		aspect-ratio: 4 / 5;
		border-radius: 18px;
	}

	/* Mobile: Center = 85vw 4:5; Side cards peek slightly or sit tucked behind */
	.editorial-card[data-pos="0"] {
		transform: translate3d(0, 0, 0) scale(1);
		box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.4);
	}

	.editorial-card[data-pos="-1"] {
		transform: translate3d(-62vw, 0, 0) scale(0.84);
		opacity: 0.45;
	}

	.editorial-card[data-pos="1"] {
		transform: translate3d(62vw, 0, 0) scale(0.84);
		opacity: 0.45;
	}

	.editorial-card[data-pos="-2"],
	.editorial-card[data-pos="2"] {
		opacity: 0;
		pointer-events: none;
	}

	.editorial-carousel-nav {
		margin-top: 1.8rem;
		gap: 1.1rem;
	}

	.carousel-nav-btn {
		width: 44px;
		height: 44px;
	}
}

/* Extra Small Mobile (<= 380px) */
@media (max-width: 380px) {
	.editorial-carousel-wrapper {
		height: 400px;
	}

	.editorial-card {
		width: 84vw;
	}

	.editorial-card[data-pos="-1"] {
		transform: translate3d(-66vw, 0, 0) scale(0.8);
		opacity: 0.3;
	}

	.editorial-card[data-pos="1"] {
		transform: translate3d(66vw, 0, 0) scale(0.8);
		opacity: 0.3;
	}
}

/* --------------------------------------------------------------------------
   Existing Lightbox (Preserved)
   -------------------------------------------------------------------------- */
.gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 4.25rem 0.75rem 2.35rem;
	background: rgba(8, 6, 4, 0.94);
	backdrop-filter: blur(20px);
	touch-action: pan-y;
	user-select: none;
}

.gallery-lightbox[hidden] {
	display: none;
}

.gallery-lb-stage {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	touch-action: none;
}

.gallery-lb-stage img,
.gallery-lb-stage video,
.gallery-lightbox .gallery-lb-photo {
	display: block !important;
	width: auto !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: 100% !important;
	margin: 0 auto !important;
	object-fit: contain !important;
	border-radius: 1rem;
	background: transparent;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.gallery-lb-stage iframe {
	width: min(100%, 1080px);
	max-height: min(82vh, 900px);
	aspect-ratio: 16 / 9;
	height: auto;
	min-height: 240px;
	border-radius: 1rem;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: #0c0a08;
}

.gallery-lb-close,
.gallery-lb-nav {
	position: absolute;
	z-index: 3;
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.gallery-lb-close:hover,
.gallery-lb-nav:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: scale(1.08);
}

.gallery-lb-close {
	top: 1.25rem;
	right: 1.25rem;
	width: 2.8rem;
	height: 2.8rem;
	border-radius: 50%;
	font-size: 1.6rem;
	line-height: 1;
}

.gallery-lb-nav {
	top: 50%;
	transform: translateY(-50%);
	width: 2.8rem;
	height: 2.8rem;
	border-radius: 50%;
	font-size: 1.8rem;
}

.gallery-lb-prev {
	left: 1.25rem;
}

.gallery-lb-next {
	right: 1.25rem;
}

.gallery-lb-count {
	position: absolute;
	z-index: 3;
	bottom: 1.1rem;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.88rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	pointer-events: none;
}
