/*
 * Family Lightbox
 *
 * Colors can be set from the theme with CSS variables, e.g. in the theme stylesheet:
 *
 *   :root { --fl-accent: #d63638; --fl-bar: #1d2327; }
 *
 * --fl-accent, --fl-accent-hover, --fl-accent-text, --fl-accent-hover-text   buttons
 * --fl-bar, --fl-bar-text, --fl-bar-muted, --fl-line                           top bar and caption bar
 * --fl-focus                                                                   focus outline
 * --fl-backdrop                                                                background behind the image
 */

html.fl-lock,
html.fl-lock body {
	overflow: hidden;
}

.fl-root[hidden] {
	display: none;
}

/* Images in the post that open in the viewer */
img.fl-zoomable {
	cursor: zoom-in;
}

.fl-root {
	position: fixed;
	inset: 0; /* "top" is set by the script so the overlay starts below the theme's navigation bar */
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background: var(--fl-backdrop, rgba(8, 8, 12, 0.96));
	color: var(--fl-bar-text, #fff);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
}

/* Top bar */
.fl-bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: var(--fl-bar, #1d2327);
	border-bottom: 2px solid var(--fl-accent, #2271b1);
}
.fl-count {
	min-width: 3.5em;
	font-variant-numeric: tabular-nums;
	color: var(--fl-bar-muted, #dcdcde);
}
.fl-spacer {
	flex: 1 1 auto;
}

/* Buttons */
.fl-btn,
.fl-nav {
	border: 0;
	border-radius: 5px;
	background: var(--fl-accent, #2271b1);
	color: var(--fl-accent-text, #fff);
	cursor: pointer;
	font: inherit;
	line-height: 1;
	transition: background-color 0.3s ease-out;
	-webkit-tap-highlight-color: transparent;
}
.fl-btn {
	min-width: 44px;
	min-height: 40px;
	padding: 0 16px;
	font-size: 13px;
	text-transform: uppercase;
}
.fl-btn:hover,
.fl-nav:hover:not(:disabled) {
	background: var(--fl-accent-hover, #135e96);
	color: var(--fl-accent-hover-text, #fff);
}
.fl-btn:focus-visible,
.fl-nav:focus-visible {
	outline: 2px solid var(--fl-focus, #fff);
	outline-offset: 2px;
}

.fl-stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-gutter: stable;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}
.fl-img {
	display: block;
	margin: auto;
	border-radius: 2px;
	cursor: zoom-in;
	user-select: none;
	-webkit-user-select: none;
	transition: opacity 0.15s ease;
}
.fl-root.is-width .fl-img {
	cursor: zoom-out;
}
.fl-root.is-loading .fl-img,
.fl-root.has-error .fl-img {
	opacity: 0;
}

.fl-loading,
.fl-error {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	opacity: 0.85;
}
.fl-root.is-loading .fl-loading,
.fl-root.has-error .fl-error {
	display: flex;
}

/* Previous / next: disabled at the first and last image (no wrapping around) */
.fl-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 46px;
	height: 72px;
	font-size: 36px;
	opacity: 0.92;
}
.fl-nav:disabled {
	opacity: 0.2;
	cursor: default;
}
.fl-prev {
	left: 6px;
}
.fl-next {
	right: 6px;
}
.fl-root.is-single .fl-nav {
	display: none;
}

/* Caption bar */
.fl-caption {
	flex: 0 0 auto;
	padding: 8px 16px 10px;
	text-align: center;
	background: var(--fl-bar, #1d2327);
	border-top: 1px solid var(--fl-line, rgba(255, 255, 255, 0.15));
	color: var(--fl-bar-text, #fff);
}
.fl-caption[hidden] {
	display: none;
}

@media (max-width: 600px) {
	.fl-nav {
		width: 38px;
		height: 60px;
		font-size: 30px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fl-img,
	.fl-btn,
	.fl-nav {
		transition: none;
	}
}
