/* Baltic Agro Koduaed – image lightbox (dialog of assets/js/gallery.js): article/page galleries (gallery.css), product
   images (product-gallery.php) and single content images (inc/lightbox.php). Separate from gallery.css so that loading
   it on demand never restyles the page (gallery.css styles .ba-gallery, which the product image box also uses).
   Moved here from gallery.css (redesign D) unchanged; regressions/lightbox 2026-10-17. */

.ba-lightbox {
	position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center;
	padding: 56px 72px 24px; background: rgba(14, 18, 8, .96); color: #fff; font-family: var(--ba-font, Nunito, Helvetica, Arial, sans-serif);
	--ba-focus: #fff;
}
.ba-lightbox[hidden] { display: none; }
.ba-lightbox__fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; min-height: 0; }
.ba-lightbox__img {
	display: block; max-width: min(1200px, 100%); max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px);
	width: auto; height: auto; object-fit: contain; border-radius: 6px; background: rgba(255, 255, 255, .04); user-select: none;
}
/* Product images (gallery.js sets data-ba-lb-group): the pack shot on a white card with the same frame as on the page. */
.ba-lightbox[data-ba-lb-group="product"] .ba-lightbox__img { box-sizing: border-box; padding: clamp(16px, 4vmin, 48px); background: var(--ba-pimg-bg, #fff); border-radius: var(--ba-r-lg, 12px); }
.ba-lightbox__cap { font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .88); text-align: center; max-width: 720px; margin: 0; }
.ba-lightbox__cap:empty { display: none; }
.ba-lightbox__count { position: absolute; top: 18px; left: 24px; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .8); margin: 0; }
.ba-lightbox__btn {
	position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0;
	border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
	font: 700 26px/1 var(--ba-font, Nunito, sans-serif); transition: background-color .15s ease;
}
.ba-lightbox__btn:hover { background: rgba(255, 255, 255, .24); }
.ba-lightbox__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ba-lightbox__btn svg { width: 22px; height: 22px; }
.ba-lightbox__close { top: 10px; right: 12px; }
.ba-lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.ba-lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
.ba-lightbox__btn[hidden] { display: none; }
@media (max-width: 760px) {
	.ba-lightbox { padding: 56px 12px 72px; }
	.ba-lightbox__img { max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); }
	.ba-lightbox__prev, .ba-lightbox__next { top: auto; bottom: 14px; transform: none; }
	.ba-lightbox__prev { left: calc(50% - 60px); }
	.ba-lightbox__next { right: calc(50% - 60px); }
}
html.ba-lightbox-open { overflow: hidden; }
