/* See Fate — gallery strips and lightbox. */

/* ------------------------------------------------------------------
   Horizontal strips

   A strip is a plain group so it can hold photos and video side by side.
   Album pages keep the theme's ordinary gallery grid — nothing here
   touches a gallery that is not marked as a strip.
------------------------------------------------------------------ */

.sf-carousel-shell {
	position: relative;
	margin: 0 0 clamp(8px, 1.2vw, 18px);
}

.sf-page-content .sf-carousel {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 6px;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.sf-page-content .sf-carousel::-webkit-scrollbar {
	display: none;
}

.sf-page-content .sf-carousel > figure {
	position: relative;
	display: block;
	flex: 0 0 auto;
	width: auto;
	max-width: none;
	height: clamp(210px, 30vw, 370px);
	margin: 0;
	background: #f4f4f4;
	overflow: hidden;
	scroll-snap-align: start;
}

.sf-page-content .sf-carousel > figure > img,
.sf-page-content .sf-carousel > figure > video {
	display: block;
	height: 100%;
	width: auto;
	max-width: none;
	aspect-ratio: auto;
	object-fit: cover;
}

.sf-page-content .sf-carousel > figure figcaption {
	display: none;
}

/* A play badge marks the clips, since the strip hides the video controls. */
.sf-page-content .sf-carousel > figure.wp-block-video::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 13px 0 13px 22px;
	border-color: transparent transparent transparent rgba(255, 255, 255, 0.92);
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
	pointer-events: none;
}

.sf-carousel-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 3rem;
	height: 3rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-bottom: 0.2rem;
	font-size: 2rem;
	line-height: 1;
	color: #fff;
	background: rgba(20, 20, 22, 0.45);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.18s ease, background 0.18s ease;
}

.sf-carousel-shell:hover .sf-carousel-nav,
.sf-carousel-nav:focus-visible {
	opacity: 1;
}

.sf-carousel-nav:hover {
	background: rgba(20, 20, 22, 0.72);
}

.sf-carousel-nav:disabled {
	opacity: 0;
	pointer-events: none;
}

.sf-carousel-nav--prev {
	left: 10px;
}

.sf-carousel-nav--next {
	right: 10px;
}

.sf-carousel-shell.is-static .sf-carousel-nav {
	display: none;
}

@media (hover: none) {
	.sf-carousel-nav {
		display: none;
	}
}

/* ------------------------------------------------------------------
   Lightbox
------------------------------------------------------------------ */

.sf-zoomable {
	cursor: zoom-in;
}

.sf-zoomable:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

body.sf-lightbox-open {
	overflow: hidden;
}

.sf-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(0.75rem, 3vw, 2.5rem);
}

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

.sf-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 8, 10, 0.94);
	cursor: zoom-out;
}

.sf-lightbox__figure {
	position: relative;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	max-width: 100%;
	max-height: 100%;
	pointer-events: none;
}

.sf-lightbox__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	min-height: 3rem;
	min-width: 3rem;
}

.sf-lightbox__stage > * {
	pointer-events: auto;
	max-width: min(94vw, 1800px);
	max-height: calc(100vh - 8rem);
	width: auto;
	height: auto;
	display: block;
	box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.55);
}

.sf-lightbox__stage > iframe {
	width: min(94vw, 1400px);
	height: min(calc(100vh - 8rem), 56.25vw);
	border: 0;
}

.sf-lightbox__stage.is-loading::after {
	content: "";
	width: 2.25rem;
	height: 2.25rem;
	border: 2px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sf-lightbox-spin 0.8s linear infinite;
}

@keyframes sf-lightbox-spin {
	to {
		transform: rotate(1turn);
	}
}

.sf-lightbox__caption {
	pointer-events: auto;
	max-width: min(90vw, 60ch);
	text-align: center;
	color: rgba(255, 255, 255, 0.86);
	font-size: 0.9rem;
	line-height: 1.45;
	margin: 0;
}

.sf-lightbox__caption[hidden] {
	display: none;
}

.sf-lightbox__counter {
	position: absolute;
	bottom: 0.9rem;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	font-variant-numeric: tabular-nums;
}

.sf-lightbox__counter[hidden] {
	display: none;
}

.sf-lightbox__close,
.sf-lightbox__nav {
	position: absolute;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.08);
	border: 0;
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	line-height: 1;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.sf-lightbox__close:hover,
.sf-lightbox__nav:hover,
.sf-lightbox__close:focus-visible,
.sf-lightbox__nav:focus-visible {
	background: rgba(255, 255, 255, 0.22);
}

.sf-lightbox__close {
	top: 0.85rem;
	right: 0.85rem;
	width: 2.75rem;
	height: 2.75rem;
	font-size: 1.7rem;
}

.sf-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 3.25rem;
	height: 3.25rem;
	font-size: 2.1rem;
	padding-bottom: 0.2rem;
}

.sf-lightbox__nav--prev {
	left: 0.85rem;
}

.sf-lightbox__nav--next {
	right: 0.85rem;
}

.sf-lightbox.is-single .sf-lightbox__nav {
	display: none;
}

@media (max-width: 600px) {
	.sf-lightbox__nav {
		width: 2.6rem;
		height: 2.6rem;
		font-size: 1.6rem;
	}

	.sf-lightbox__stage > * {
		max-height: calc(100vh - 9rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sf-lightbox__stage.is-loading::after {
		animation-duration: 2s;
	}
}
