/* Pregled galerije (gallery.js): fotografija preko cijelog ekrana, strelice, tastatura i prevlačenje.
   Zajednički za Dnevnik rijeke i Rafting s djecom (izdvojeno iz journal-details.css 30.11.2026.). */
html:has(.gallery-viewer[open]) { overflow: hidden; }
.gallery-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 56px 72px 24px;
  border: 0;
  background: rgb(10 30 26 / .97);
  color: #f8f0d7;
  touch-action: pan-y;
}
.gallery-viewer::backdrop { background: rgb(10 30 26 / .97); }
.gallery-viewer figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  height: 100%;
  margin: 0;
}
.gallery-viewer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}
.gallery-viewer figcaption { text-align: center; font: 400 16px/1.4 Lato, sans-serif; }
.gallery-viewer .gallery-count { opacity: .75; margin-left: 8px; }
.gallery-viewer button {
  position: absolute;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  font: 700 16px/1 Lato, sans-serif;
  cursor: pointer;
}
.gallery-viewer button:focus-visible { outline: 3px solid #fe6700; outline-offset: 2px; }
.gallery-viewer .gallery-close { top: 10px; right: 16px; display: inline-flex; align-items: center; gap: 8px; }
.gallery-viewer .gallery-close span { font-size: 28px; font-weight: 400; }
.gallery-viewer .gallery-nav { top: 50%; translate: 0 -50%; width: 52px; height: 52px; font-size: 28px; background: rgb(248 240 215 / .12); }
.gallery-viewer .gallery-nav:hover { background: rgb(248 240 215 / .24); }
.gallery-viewer .gallery-prev { left: 12px; }
.gallery-viewer .gallery-next { right: 12px; }
@media (max-width: 620px) {
  .gallery-viewer { padding: 56px 8px 16px; }
  .gallery-viewer .gallery-nav { top: auto; bottom: 64px; translate: none; }
}
