.image-viewer {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  opacity: 1; visibility: visible; transition: opacity .28s ease, visibility .28s;
}
.image-viewer[aria-hidden="true"] { opacity: 0; visibility: hidden; pointer-events: none; }
.image-viewer__backdrop {
  position: absolute; inset: 0; background: rgba(0, 8, 5, .88); backdrop-filter: blur(18px) saturate(.65);
}
.image-viewer__dialog {
  position: relative; width: min(1480px, 96vw); height: min(900px, 94vh); display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  border: 1px solid rgba(208,224,137,.18); border-radius: 16px;
  background: linear-gradient(145deg, rgba(3,31,18,.96), rgba(1,15,9,.98));
  box-shadow: 0 40px 120px rgba(0,0,0,.58);
}
.image-viewer__header { min-height: 64px; padding: 10px 12px 10px 20px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid rgba(208,224,137,.12); }
.image-viewer__albums { min-width: 0; flex: 1; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.image-viewer__albums::-webkit-scrollbar { display: none; }
.image-viewer__albums button {
  flex: 0 0 auto; min-height: 36px; padding: 0 13px; border: 1px solid transparent; border-radius: 18px;
  color: rgba(245,241,232,.54); font-size: 8px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}
.image-viewer__albums button:hover, .image-viewer__albums button.is-active { color: #f5f1e8; border-color: rgba(208,224,137,.3); background: rgba(83,107,85,.18); }
.image-viewer__close { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #f5f1e8; font-size: 29px; }
.image-viewer__close:hover { background: rgba(245,241,232,.08); }
.image-viewer__stage { min-height: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; }
.image-viewer__figure { min-width: 0; height: 100%; margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.image-viewer__figure picture { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.image-viewer__figure img { width: 100%; height: 100%; max-height: calc(94vh - 160px); object-fit: contain; }
.image-viewer__figure img.is-entering { animation: viewerImageIn .34s ease both; }
.image-viewer__figure figcaption { min-height: 48px; padding: 12px 4px 8px; display: flex; justify-content: space-between; gap: 16px; color: rgba(245,241,232,.72); font-size: 10px; }
.image-viewer__figure figcaption small { color: #d0e089; }
.image-viewer__arrow { width: 44px; height: 44px; justify-self: center; display: grid; place-items: center; border: 1px solid rgba(208,224,137,.2); border-radius: 50%; color: #f5f1e8; font-size: 17px; }
.image-viewer__arrow:hover { border-color: rgba(208,224,137,.56); background: rgba(83,107,85,.2); }
.image-viewer__thumbs { min-height: 78px; padding: 10px 20px 14px; display: flex; justify-content: center; gap: 8px; overflow-x: auto; border-top: 1px solid rgba(208,224,137,.1); }
.image-viewer__thumb { width: 78px; height: 52px; flex: 0 0 auto; padding: 0; overflow: hidden; border: 1px solid transparent; border-radius: 5px; opacity: .48; }
.image-viewer__thumb.is-active { opacity: 1; border-color: #d0e089; }
.image-viewer__thumb img { width: 100%; height: 100%; object-fit: cover; }
.has-image-viewer { overflow: hidden; }
@keyframes viewerImageIn { from { opacity: .2; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 720px) {
  .image-viewer__dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .image-viewer__header { min-height: 58px; padding-left: 12px; }
  .image-viewer__stage { grid-template-columns: 44px minmax(0,1fr) 44px; }
  .image-viewer__arrow { width: 36px; height: 36px; }
  .image-viewer__figure img { max-height: calc(100dvh - 190px); }
  .image-viewer__thumbs { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .image-viewer__figure img.is-entering { animation: none; } }
