/* Standalone Image Lightbox Module */
.image-lightbox-backdrop {
	position: fixed;
	inset: 0;
	z-index: 125;
	background-color: rgb(8 10 14 / .88);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
	backdrop-filter: blur(20px) saturate(140%);
	transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-backdrop-enter-active {
	transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-backdrop-leave-active {
	transition: opacity 230ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-backdrop-enter-from,
.image-lightbox-backdrop-leave-to {
	opacity: 0;
}

.image-lightbox-modal {
	position: fixed;
	inset: 0;
	z-index: 126;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	overflow: hidden;
	overscroll-behavior: contain;
	-webkit-user-select: none;
	user-select: none;
	outline: none;
	font-family: Inter, "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", sans-serif;
}
.image-lightbox-modal,
.image-lightbox-modal * {
	box-sizing: border-box;
}
.image-lightbox-modal-enter-active {
	transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1), transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-modal-leave-active {
	transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-modal-enter-from {
	opacity: 0;
	transform: scale(0.92);
}
.image-lightbox-modal-leave-to {
	opacity: 0;
	transform: scale(0.95);
}
.image-lightbox-modal.is-drag-dismissing.image-lightbox-modal-leave-active {
	transition: opacity 230ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-modal.is-drag-dismissing.image-lightbox-modal-leave-to {
	opacity: 0;
	transform: none;
}

.image-lightbox-topbar {
	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
	transition: opacity 220ms ease;
}

.image-lightbox-counter {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 13px;
	border-radius: 999px;
	background-color: rgb(255 255 255 / 13%);
	border: 1px solid rgb(255 255 255 / 18%);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	color: rgb(255 255 255 / 92%);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
}

.image-lightbox-modal .image-lightbox-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 999px;
	background-color: rgb(255 255 255 / 15%);
	border: 1px solid rgb(255 255 255 / 22%);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	box-shadow: 0 4px 16px rgb(0 0 0 / 28%);
	color: rgb(255 255 255 / 92%);
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-modal .image-lightbox-close svg {
	width: 20px;
	height: 20px;
}
@media (hover: hover) and (pointer: fine) {
	.image-lightbox-modal .image-lightbox-close:hover {
		background-color: rgb(255 255 255 / 30%);
		border-color: rgb(255 255 255 / 44%);
		color: #fff;
		box-shadow: 0 8px 24px rgb(0 0 0 / 38%);
		transform: scale(1.06);
	}
}
.image-lightbox-modal .image-lightbox-close:active {
	background-color: rgb(255 255 255 / 42%);
	border-color: rgb(255 255 255 / 56%);
	color: #fff;
	transform: scale(0.9);
	transition-duration: 85ms;
}
.image-lightbox-modal .image-lightbox-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.image-lightbox-viewport {
	position: relative;
	z-index: 10;
	width: 100%;
	height: 100%;
	min-height: 0;
	overflow: visible;
	touch-action: none;
}
.image-lightbox-viewport.is-draggable {
	cursor: grab;
}
.image-lightbox-viewport.is-dragging {
	cursor: grabbing;
}

.image-lightbox-track {
	display: flex;
	width: 100%;
	height: 100%;
	will-change: transform;
	transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-track.is-dragging {
	transition: none;
}

.image-lightbox-slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px 10px;
}

.image-lightbox-media-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	max-height: 100%;
	will-change: transform, opacity;
	transform: scale(0.93);
	opacity: 0.7;
	transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1), opacity 280ms ease;
}
.image-lightbox-slide.is-active .image-lightbox-media-wrap {
	transform: scale(1);
	opacity: 1;
}
.image-lightbox-viewport.is-dragging .image-lightbox-slide:not(.is-active) .image-lightbox-media-wrap {
	transform: scale(0.96);
	opacity: 0.88;
	transition: transform 200ms ease, opacity 200ms ease;
}
.image-lightbox-viewport.is-vertical-drag .image-lightbox-slide.is-active .image-lightbox-media-wrap {
	transition: none;
}

.image-lightbox-image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(100vh - 156px);
	max-height: calc(100dvh - 156px);
	object-fit: contain;
	border-radius: 14px;
	box-shadow: 0 18px 48px rgb(0 0 0 / 42%), 0 0 0 1px rgb(255 255 255 / 10%);
	user-select: none;
	-webkit-user-drag: none;
	touch-action: none;
	transform-origin: center center;
	will-change: transform;
	background-color: rgb(255 255 255 / 4%);
}
.image-lightbox-image.is-zoom-animating {
	transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-image.is-zoomed {
	cursor: grab;
}
.image-lightbox-viewport.is-dragging .image-lightbox-image.is-zoomed {
	cursor: grabbing;
}

.image-lightbox-modal .image-lightbox-nav {
	display: none;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 15;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 999px;
	align-items: center;
	justify-content: center;
	background-color: rgb(255 255 255 / 15%);
	border: 1px solid rgb(255 255 255 / 22%);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	box-shadow: 0 4px 16px rgb(0 0 0 / 28%);
	color: rgb(255 255 255 / 92%);
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, opacity 180ms ease, box-shadow 180ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-modal .image-lightbox-nav svg {
	width: 22px;
	height: 22px;
}
.image-lightbox-modal .image-lightbox-nav-prev { left: 24px; }
.image-lightbox-modal .image-lightbox-nav-next { right: 24px; }
@media (hover: hover) and (pointer: fine) {
	.image-lightbox-modal .image-lightbox-nav:not(:disabled):hover {
		background-color: rgb(255 255 255 / 30%);
		border-color: rgb(255 255 255 / 44%);
		color: #fff;
		box-shadow: 0 8px 24px rgb(0 0 0 / 38%);
		transform: translateY(-50%) scale(1.06);
	}
}
.image-lightbox-modal .image-lightbox-nav:not(:disabled):active {
	background-color: rgb(255 255 255 / 42%);
	border-color: rgb(255 255 255 / 56%);
	color: #fff;
	transform: translateY(-50%) scale(0.9);
	transition-duration: 85ms;
}
.image-lightbox-modal .image-lightbox-nav:disabled {
	opacity: 0.24;
	cursor: not-allowed;
}
.image-lightbox-modal .image-lightbox-nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.image-lightbox-bottombar {
	position: relative;
	z-index: 20;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 54px;
	padding: 10px max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	transition: opacity 220ms ease;
}

.image-lightbox-caption {
	margin: 0;
	max-width: min(640px, calc(100vw - 40px));
	color: rgb(255 255 255 / 84%);
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-shadow: 0 1px 6px rgb(0 0 0 / 45%);
}

/* Hero-section style indicator dots: perfect circles when idle, smooth pill when active */
.image-lightbox-indicators {
	display: inline-flex;
	align-items: center;
	gap: 0;
	padding: 3px 7px;
	border-radius: 999px;
	background-color: rgb(255 255 255 / 12%);
	border: 1px solid rgb(255 255 255 / 16%);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	max-width: calc(100vw - 32px);
	overflow-x: auto;
	scrollbar-width: none;
}
.image-lightbox-indicators::-webkit-scrollbar { display: none; }
.image-lightbox-modal .image-lightbox-indicator {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 24px;
	padding: 0 4px;
	border: 0;
	border-radius: 999px;
	background-color: transparent;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-modal .image-lightbox-indicator span {
	display: block;
	width: 7px;
	height: 7px;
	border-radius: 999px;
	background-color: rgb(255 255 255 / 48%);
	transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1), background-color 200ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.image-lightbox-modal .image-lightbox-indicator.is-active span {
	width: 28px;
	background-color: #fff;
}
@media (hover: hover) and (pointer: fine) {
	.image-lightbox-modal .image-lightbox-indicator:not(.is-active):hover span {
		background-color: rgb(255 255 255 / 88%);
		transform: scale(1.18);
	}
}
.image-lightbox-modal .image-lightbox-indicator:active {
	transform: scale(0.86);
}
.image-lightbox-modal .image-lightbox-indicator:active span {
	background-color: #fff;
}
.image-lightbox-modal .image-lightbox-indicator:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Clickable affordance for article / gallery images */
[data-content-body] .article-gallery__image,
[data-content-body] .img-skel img,
[data-article-cover] img {
	cursor: zoom-in;
}

@media (min-width: 768px) {
	.image-lightbox-topbar {
		padding: 20px 24px 12px;
	}
	.image-lightbox-slide {
		padding: 8px 92px;
	}
	.image-lightbox-image {
		max-width: min(100%, 1200px);
		max-height: calc(100vh - 172px);
		max-height: calc(100dvh - 172px);
		border-radius: 18px;
	}
	.image-lightbox-modal .image-lightbox-nav {
		display: inline-flex;
	}
	.image-lightbox-bottombar {
		min-height: 60px;
		padding: 12px 24px 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.image-lightbox-backdrop,
	.image-lightbox-backdrop-enter-active,
	.image-lightbox-backdrop-leave-active,
	.image-lightbox-modal-enter-active,
	.image-lightbox-modal-leave-active,
	.image-lightbox-track,
	.image-lightbox-media-wrap,
	.image-lightbox-topbar,
	.image-lightbox-bottombar,
	.image-lightbox-image.is-zoom-animating,
	.image-lightbox-modal .image-lightbox-indicator,
	.image-lightbox-modal .image-lightbox-indicator span,
	.image-lightbox-modal .image-lightbox-close,
	.image-lightbox-modal .image-lightbox-nav { transition: none; }
	.image-lightbox-media-wrap { transform: none; opacity: 1; }
}
