/* =========================================================
   AFRC shared lightbox — driven by assets/js/lightbox.js.
   Loaded site-wide; the only full-screen image viewer in the theme.
   Default mode "fit": the whole image fits the viewport.
   Mode "scroll" (data-afrc-lightbox-mode="scroll"): tall documents keep
   their width and scroll vertically (newspaper scans, posters).
   ========================================================= */

.afrc-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 48px);
	background: rgba(7, 27, 69, .92);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	font-family: var(--afrc-font);
}
.afrc-lightbox.is-open { display: flex; }

.afrc-lightbox__stage {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	max-width: 100%;
}
.afrc-lightbox__img {
	max-width: 100%;
	max-height: 82vh;
	width: auto;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
	background: #0a1a44;
}
.afrc-lightbox__caption {
	max-width: 70ch;
	margin: 0;
	text-align: center;
	color: var(--afrc-cream);
	font-size: .95rem;
	line-height: 1.5;
}
.afrc-lightbox__counter {
	color: rgba(255, 255, 255, .68);
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .04em;
}

/* Scroll mode: long documents */
.afrc-lightbox[data-mode="scroll"] {
	align-items: flex-start;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-top: 84px;
}
.afrc-lightbox[data-mode="scroll"] .afrc-lightbox__stage { width: min(100%, 1100px); }
.afrc-lightbox[data-mode="scroll"] .afrc-lightbox__img {
	max-height: none;
	border-radius: 2px;
	background: var(--afrc-white);
}
.afrc-lightbox[data-mode="scroll"] .afrc-lightbox__btn { position: fixed; }

/* Controls — circular brand buttons */
.afrc-lightbox__btn {
	position: absolute;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}
.afrc-lightbox__btn:hover { background: var(--afrc-red); }
.afrc-lightbox__btn:focus-visible { outline: 3px solid var(--afrc-cream); outline-offset: 2px; }
.afrc-lightbox__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.afrc-lightbox__close { top: clamp(12px, 3vw, 26px); right: clamp(12px, 3vw, 26px); }
.afrc-lightbox__prev  { left: clamp(8px, 2vw, 22px); top: 50%; transform: translateY(-50%); }
.afrc-lightbox__next  { right: clamp(8px, 2vw, 22px); top: 50%; transform: translateY(-50%); }
.afrc-lightbox__prev:hover { transform: translateY(-50%) scale(1.06); }
.afrc-lightbox__next:hover { transform: translateY(-50%) scale(1.06); }

/* Single image: hide the navigation */
.afrc-lightbox[data-single="true"] .afrc-lightbox__prev,
.afrc-lightbox[data-single="true"] .afrc-lightbox__next,
.afrc-lightbox[data-single="true"] .afrc-lightbox__counter { display: none; }

/* Triggers announce the zoom */
.afrc-lightbox-trigger,
a[data-afrc-lightbox],
[data-afrc-lightbox-group] a:has(> img) { cursor: zoom-in; }
.afrc-lightbox-trigger:focus-visible { outline: 3px solid var(--afrc-gold); outline-offset: 4px; }

@media (max-width: 600px) {
	.afrc-lightbox__btn { width: 44px; height: 44px; }
	.afrc-lightbox__prev { left: 6px; }
	.afrc-lightbox__next { right: 6px; }
	.afrc-lightbox[data-mode="scroll"] { padding: 72px 12px 24px; }
}

@media (prefers-reduced-motion: reduce) {
	.afrc-lightbox__btn { transition: none; }
}
