/* Academy 2026 photo gallery — strip + lightbox (inc/academy-gallery.php). Colours come from the
   page's own tokens (.ak --navy/--red/--line/--mut); fallbacks keep it sane anywhere else. */

/* directly under the video section: one band, not two stacked 64px paddings */
.ak #video + #galeria { padding-top: 0; }

.ak-gal { position: relative; margin-top: 8px; }
.ak-gal__track {
	display: flex; gap: 16px; margin: 0; padding: 4px 2px 14px; list-style: none;
	overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
	scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.ak-gal__track:focus-visible { outline: 2px solid var(--red, #CE2B2B); outline-offset: 4px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .ak-gal__track { scroll-behavior: auto; } }

/* 3 across at 1200, ~2 on a tablet, one-and-a-peek on a phone (the peek says "swipe") */
.ak-gal__item { flex: 0 0 calc((100% - 32px) / 3); scroll-snap-align: start; margin: 0; }
@media (max-width: 1000px) { .ak-gal__item { flex-basis: calc((100% - 16px) / 2.15); } }
@media (max-width: 640px)  { .ak-gal__item { flex-basis: 82%; } }
.ak-gal__item figure { margin: 0; }

/* fixed 3:2 box: no layout jump while the lazy image arrives */
.ak-gal__link { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 8px; background: var(--line, #E7E7EA); }
.ak-gal__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.ak-gal__link:hover .ak-gal__img { transform: scale(1.03); }
.ak-gal__link:focus-visible { outline: 3px solid var(--red, #CE2B2B); outline-offset: 3px; }
.ak-gal__cap { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--grey, #5C5C66); }

/* arrows: only where there is a mouse; touch swipes the strip natively */
.ak-gal__nav {
	position: absolute; top: calc(50% - 30px); z-index: 2; width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid var(--line, #E7E7EA); background: #fff; color: var(--navy, #181B2E); cursor: pointer;
	box-shadow: 0 4px 14px rgba(24, 27, 46, .14); display: none; align-items: center; justify-content: center;
}
.ak-gal__nav--prev { left: -18px; }
.ak-gal__nav--next { right: -18px; }
.ak-gal__nav span, .ak-gal-lb__btn span {
	width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; display: block;
}
.ak-gal__nav--prev span, .ak-gal-lb__prev span { transform: translateX(2px) rotate(135deg); }
.ak-gal__nav--next span, .ak-gal-lb__next span { transform: translateX(-2px) rotate(-45deg); }
.ak-gal__nav:hover { color: var(--red, #CE2B2B); }
.ak-gal__nav:focus-visible { outline: 2px solid var(--red, #CE2B2B); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
	.ak-gal__nav:not([hidden]) { display: flex; }
}
@media (max-width: 1290px) { .ak-gal__nav--prev { left: 6px; } .ak-gal__nav--next { right: 6px; } }

/* ── lightbox ── */
html.ak-gal-open { overflow: hidden; }
.ak-gal-lb {
	position: fixed; inset: 0; z-index: 100000; background: rgba(12, 14, 24, .985);
	display: flex; align-items: center; justify-content: center; touch-action: pan-y;
}
.ak-gal-lb[hidden] { display: none; }
.ak-gal-lb__fig { margin: 0; max-width: calc(100vw - 140px); max-height: calc(100vh - 110px); display: flex; flex-direction: column; align-items: center; }
.ak-gal-lb__img {
	display: block; max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto;
	object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-drag: none;
	transition: opacity .2s ease;
}
.ak-gal-lb__img.is-loading { opacity: .25; }
.ak-gal-lb__cap { margin-top: 12px; color: #e9e9ee; font-size: 14.5px; line-height: 1.45; text-align: center; max-width: 900px; }
.ak-gal-lb__count { color: #a9abb8; font-variant-numeric: tabular-nums; margin-right: 10px; }
.ak-gal-lb__btn {
	position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
	border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.ak-gal-lb__btn:hover { background: rgba(255, 255, 255, .22); }
.ak-gal-lb__prev { left: 20px; }
.ak-gal-lb__next { right: 20px; }
.ak-gal-lb__close {
	position: absolute; top: 16px; right: 20px; border: 1px solid rgba(255, 255, 255, .35); background: transparent;
	color: #fff; font: 600 14px/1 inherit; padding: 10px 14px; border-radius: 6px; cursor: pointer;
}
.ak-gal-lb__close:hover { background: rgba(255, 255, 255, .12); }
.ak-gal-lb button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 640px) {
	.ak-gal-lb__fig { max-width: 100vw; }
	.ak-gal-lb__img { max-height: calc(100vh - 170px); border-radius: 0; }
	.ak-gal-lb__cap { padding: 0 16px; }
	.ak-gal-lb__btn { top: auto; bottom: 18px; transform: none; width: 48px; height: 48px; }
	.ak-gal-lb__prev { left: calc(50% - 64px); }
	.ak-gal-lb__next { right: calc(50% - 64px); }
}
