.lb-trigger { cursor: zoom-in; }
.lb { border: 0; padding: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; background: rgba(0,0,0,.92); color: #fff; overflow: hidden; }
.lb::backdrop { background: rgba(0,0,0,.92); }
.lb[open] { display: flex; flex-direction: column; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; user-select: none; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; transform-origin: center; will-change: transform; transition: transform .15s ease; }
.lb-img.is-zoomed { cursor: grab; transition: none; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem 1rem; direction: ltr; }
.lb-bar > div { display: flex; gap: .5rem; align-items: center; }
.lb-btn { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 2.75rem; height: 2.75rem; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lb-btn:hover, .lb-btn:focus-visible { background: rgba(255,255,255,.3); outline: 2px solid #fff; }
.lb-btn[hidden] { display: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; direction: ltr; }
.lb-left { left: .75rem; }
.lb-right { right: .75rem; }
.lb-foot { text-align: center; padding: .5rem 1rem 1rem; min-height: 3rem; }
.lb-count { font-variant-numeric: tabular-nums; opacity: .85; }
@media (prefers-reduced-motion: reduce) { .lb-img { transition: none; } }
.gallery-thumb { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Article gallery: stage viewer + thumbnail strip. Works as a plain strip without JS. */
.gallery-stage { position: relative; margin: 0 0 .75rem; aspect-ratio: 16 / 9; overflow: hidden; border-radius: .5rem; background: #1b1f23; isolation: isolate; }
.gallery-stage-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(24px) brightness(.7); transform: scale(1.15); z-index: -1; }
.gallery-stage-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-js .gallery-stage-img { cursor: zoom-in; }
.gallery-caption, .gallery-counter { position: absolute; color: #fff; background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; font-size: .85rem; line-height: 1.5; padding: .25rem .85rem; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.gallery-caption { bottom: .75rem; inset-inline: .75rem; width: fit-content; max-width: calc(100% - 1.5rem); margin-inline: auto; text-align: center; }
.gallery-counter { top: .75rem; inset-inline-start: .75rem; font-variant-numeric: tabular-nums; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 2.75rem; height: 2.75rem; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: #fff; background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 1.1rem; cursor: pointer; }
.gallery-nav:hover, .gallery-nav:focus-visible { background: rgba(0,0,0,.6); outline: 2px solid #fff; outline-offset: 2px; }
.gallery-nav[hidden], .gallery-counter[hidden], .gallery-caption[hidden] { display: none; }
.gallery-prev { inset-inline-start: .75rem; }
.gallery-next { inset-inline-end: .75rem; }
.gallery-strip { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem; scroll-snap-type: x proximity; scrollbar-width: thin; }
.gallery-strip li { flex: 0 0 auto; scroll-snap-align: center; }
.gallery-thumb-link { display: block; width: 96px; height: 96px; border-radius: .4rem; overflow: hidden; border: 2px solid transparent; opacity: .8; transition: opacity .15s ease, border-color .15s ease; }
.gallery-thumb-link:hover, .gallery-thumb-link:focus-visible, .gallery-thumb-link[aria-current="true"] { opacity: 1; }
.gallery-thumb-link[aria-current="true"] { border-color: var(--bs-primary, #146c43); }
.gallery-thumb-link:focus-visible { outline: 2px solid var(--bs-primary, #146c43); outline-offset: 2px; }
@media (max-width: 575.98px) {
    .gallery-stage { aspect-ratio: 4 / 3; touch-action: pan-y; }
    .gallery-thumb-link { width: 76px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) { .gallery-thumb-link { transition: none; } }
