/* AB Gallery Slider — v1.3.0 */
.abgs {
	--abgs-gap: 16px;
	--abgs-tw: 360px;
	--abgs-tbw: 120px;
	--abgs-tcols: 2;
	--abgs-tgap: 12px;
	--abgs-radius: 4px;
	--abgs-tradius: 4px;
	--abgs-accent: #FF4D1F;
	--abgs-dim: .55;
	--abgs-ratio: 4/3;
	--abgs-mratio: 4/5;
	--abgs-maxh: 82vh;
	--abgs-asize: 48px;
	display: grid;
	gap: var(--abgs-gap);
	grid-template-columns: minmax(0, 1fr);
	color: #fff;
}
.abgs--thumbs-right { grid-template-columns: minmax(0, 1fr) var(--abgs-tw); }
.abgs--thumbs-left { grid-template-columns: var(--abgs-tw) minmax(0, 1fr); }
.abgs--thumbs-left .abgs__thumbs { order: -1; }
.abgs--thumbs-none .abgs__thumbs { display: none; }

/* ---------- Large photo ---------- */
.abgs__stage {
	position: relative;
	aspect-ratio: var(--abgs-ratio);
	max-height: var(--abgs-maxh);
	width: 100%;
	overflow: hidden;
	border-radius: var(--abgs-radius);
	background: var(--abgs-bg, #0A0A0A);
	isolation: isolate;
}
.abgs__track {
	display: flex;
	height: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
	outline: none;
}
/* While a photo is zoomed: no swiping to the next photo, the photo pans instead */
.abgs--zoomed .abgs__track { overflow-x: hidden; touch-action: none; }
.abgs--zoomed .abgs__img { cursor: grab; }
.abgs--zoomed .abgs__count,
.abgs--zoomed .abgs__caption { opacity: 0; transition: opacity .2s ease; }
.abgs__track::-webkit-scrollbar { display: none; }
.abgs__track:focus-visible { box-shadow: inset 0 0 0 3px var(--abgs-accent); }
.abgs__slide {
	position: relative;
	flex: 0 0 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}
.abgs .abgs__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	user-select: none;
	-webkit-user-drag: none;
}
.abgs--fit-contain .abgs__img { object-fit: contain; }

/* Whole photo (smart fit / contain): shown complete over a blurred copy of itself */
.abgs__slide.is-fit .abgs__img { position: relative; z-index: 1; object-fit: contain; }
.abgs--blur .abgs__slide.is-fit::before {
	content: "";
	position: absolute;
	inset: -40px;
	background: var(--abgs-blur) center / cover no-repeat;
	filter: blur(32px) saturate(1.15) brightness(var(--abgs-blur-dim, .45));
	transform: scale(1.08);
}
.abgs__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 48px 20px 18px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .75));
	font-size: 14px;
	line-height: 1.4;
	color: #fff;
	pointer-events: none;
}
.abgs:has(.abgs__caption) .abgs__count { bottom: auto; top: 14px; }
.abgs[data-lightbox="1"] .abgs__slide { cursor: zoom-in; }

/* ---------- Buttons (reset theme button styles) ---------- */
.abgs button,
.abgs button:hover,
.abgs button:focus {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.abgs button:focus-visible { outline: 2px solid var(--abgs-accent); outline-offset: 2px; }

.abgs button.abgs__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: var(--abgs-asize);
	height: var(--abgs-asize);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transform: translateY(-50%);
	background: var(--abgs-abg, rgba(0, 0, 0, .45));
	color: var(--abgs-ac, #fff);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color .15s ease, opacity .2s ease;
}
.abgs button.abgs__nav:hover { background: var(--abgs-ahbg, rgba(0, 0, 0, .75)); }
.abgs button.abgs__nav[disabled] { opacity: 0; pointer-events: none; }
.abgs__nav--prev,
.abgs__lb-prev { left: 14px; }
.abgs__nav--next,
.abgs__lb-next { right: 14px; }
.abgs--no-arrows .abgs__stage .abgs__nav { display: none; }

.abgs__count {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 2;
	margin: 0;
	padding: 5px 11px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .55);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .06em;
	color: #fff;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}
.abgs button.abgs__zoom {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	transition: background-color .15s ease;
}
.abgs button.abgs__zoom:hover { background: rgba(0, 0, 0, .75); }

/* ---------- Thumbnails ---------- */
.abgs__thumbs { position: relative; min-width: 0; min-height: 0; }
.abgs__thumbs-inner {
	display: flex;
	gap: var(--abgs-tgap);
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .25) transparent;
	padding: 3px;
}
.abgs button.abgs__thumb {
	position: relative;
	flex: 0 0 var(--abgs-tbw);
	display: block;
	overflow: hidden;
	border-radius: var(--abgs-tradius);
	background: #151515;
	opacity: var(--abgs-dim);
	scroll-snap-align: start;
	transition: opacity .2s ease, box-shadow .2s ease;
}
.abgs button.abgs__thumb:hover { opacity: .85; }
.abgs button.abgs__thumb.is-active {
	opacity: 1;
	box-shadow: 0 0 0 2px var(--abgs-accent);
}
.abgs .abgs__thumb-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--abgs-tratio, 4/3);
	max-width: none;
	object-fit: cover;
}

/* Beside the photo: a scrolling grid exactly as tall as the photo */
.abgs--thumbs-right .abgs__thumbs-inner,
.abgs--thumbs-left .abgs__thumbs-inner {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: repeat(var(--abgs-tcols), minmax(0, 1fr));
	grid-auto-rows: max-content;
	align-content: start;
	overflow-x: hidden;
	overflow-y: auto;
	scroll-snap-type: y proximity;
}
.abgs--thumbs-right .abgs__thumb,
.abgs--thumbs-left .abgs__thumb { flex: none; }

/* ---------- Full-screen view ---------- */
.abgs__lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, .94);
	color: #fff;
	overscroll-behavior: contain;
}
.abgs__lightbox[open] { display: flex; align-items: center; justify-content: center; }
.abgs__lightbox::backdrop { background: rgba(0, 0, 0, .94); }
.abgs__lb-frame {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: calc(100vw - 32px);
	max-height: calc(100dvh - 120px);
	overflow: hidden;
	touch-action: none;
}
.abgs .abgs__lb-img {
	display: block;
	max-width: calc(100vw - 32px);
	max-height: calc(100dvh - 120px);
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	cursor: zoom-in;
	will-change: transform;
}
.abgs__lb-frame.is-zoomed .abgs__lb-img { cursor: grab; }
.abgs button.abgs__lb-close {
	position: absolute;
	top: max(14px, env(safe-area-inset-top));
	right: 14px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
}
.abgs__lb-count {
	position: absolute;
	left: 0;
	right: 0;
	bottom: max(18px, env(safe-area-inset-bottom));
	margin: 0;
	text-align: center;
	font-size: 13px;
	letter-spacing: .08em;
	color: rgba(255, 255, 255, .75);
	font-variant-numeric: tabular-nums;
}
html.abgs-lock { overflow: hidden; }

.abgs--single .abgs__thumbs { display: none; }
.abgs-empty { padding: 24px; border: 1px dashed rgba(255, 255, 255, .3); color: rgba(255, 255, 255, .7); text-align: center; }

/* ---------- Tablet: thumbnails go below when there is no room beside ---------- */
@media (max-width: 1024px) {
	.abgs--thumbs-right,
	.abgs--thumbs-left { grid-template-columns: minmax(0, 1fr); }
	.abgs--thumbs-left .abgs__thumbs { order: 0; }
	.abgs--thumbs-right .abgs__thumbs-inner,
	.abgs--thumbs-left .abgs__thumbs-inner {
		position: static;
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x proximity;
	}
	.abgs--thumbs-right .abgs__thumb,
	.abgs--thumbs-left .abgs__thumb { flex: 0 0 var(--abgs-tbw); }
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {
	.abgs { --abgs-tbw: 76px; --abgs-asize: 40px; --abgs-gap: 10px; --abgs-tgap: 8px; }
	.abgs__stage { aspect-ratio: var(--abgs-mratio); }
	.abgs--thumbs-none .abgs__thumbs { display: block; }
	.abgs--no-mthumbs .abgs__thumbs { display: none; }
	.abgs--no-marrows .abgs__stage .abgs__nav { display: none; }
	.abgs--no-arrows:not(.abgs--no-marrows) .abgs__stage .abgs__nav { display: flex; }
	.abgs__nav--prev { left: 10px; }
	.abgs__nav--next { right: 10px; }
	.abgs .abgs__thumbs-inner { scrollbar-width: none; }
	.abgs .abgs__thumbs-inner::-webkit-scrollbar { display: none; }
	.abgs button.abgs__zoom { width: 36px; height: 36px; top: 10px; right: 10px; }
}

@media (hover: none) {
	.abgs button.abgs__thumb:hover { opacity: var(--abgs-dim); }
	.abgs button.abgs__thumb.is-active:hover { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.abgs__track { scroll-behavior: auto; }
	.abgs * { transition-duration: 0s !important; }
}
