.gallery-grid a[aria-haspopup="dialog"] { cursor: zoom-in; }
.gallery-lightbox {
  width: min(94vw, 92rem);
  height: min(92vh, 62rem);
  height: min(92dvh, 62rem);
  max-width: calc(100% - 2rem);
  max-height: calc(100% - 2rem);
  padding: 0;
  margin: auto;
  border: 1px solid #d9e4e9;
  border-radius: .65rem;
  background: #f6f8fa;
  color: #17354d;
  box-shadow: 0 1rem 5rem #0006;
  overflow: auto;
}
.gallery-lightbox[open] { display: grid; grid-template-rows: auto minmax(4rem, 1fr) auto; }
.gallery-lightbox::backdrop { background: rgba(8, 21, 30, .87); }
.gallery-lightbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem .65rem .45rem 1.2rem; background: #fff; border-bottom: 1px solid #d9e4e9; }
.gallery-lightbox-count { font-size: .95rem; font-weight: 650; }
.gallery-lightbox button { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-width: 46px; min-height: 46px; margin: 0; padding: .45rem .8rem; border: 1px solid #cad8e0; border-radius: .35rem; background: #fff; color: #17354d; font: inherit; font-weight: 650; line-height: 1.2; cursor: pointer; }
.gallery-lightbox button:hover { background: #e6eff5; border-color: #7194aa; }
.gallery-lightbox button:focus-visible { outline: 3px solid #347fac; outline-offset: 2px; }
.gallery-lightbox-close span { font-size: 1.7rem; font-weight: 400; }
.gallery-lightbox-stage { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; padding: .75rem; background: #142733; }
.gallery-lightbox .gallery-lightbox-image { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; object-fit: contain; }
.gallery-lightbox .gallery-lightbox-image[hidden], .gallery-lightbox-status[hidden] { display: none; }
.gallery-lightbox-status { max-width: 35rem; margin: 1rem; color: #fff; text-align: center; }
.gallery-lightbox-bottom { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .65rem 1rem; background: #fff; border-top: 1px solid #d9e4e9; }
.gallery-lightbox-bottom button { font-size: 1.5rem; }
#gallery-lightbox-caption { margin: 0; font-size: 1rem; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  .gallery-lightbox { width: calc(100% - 1rem); height: calc(100vh - 1rem); height: calc(100dvh - 1rem); max-width: calc(100% - 1rem); max-height: calc(100% - 1rem); border-radius: .4rem; }
  .gallery-lightbox-toolbar { padding-left: .8rem; }
  .gallery-lightbox-stage { padding: .3rem; }
  .gallery-lightbox-bottom { gap: .4rem; padding: .6rem .45rem; }
  #gallery-lightbox-caption { font-size: .9rem; }
}
@media (forced-colors: active) {
  .gallery-lightbox, .gallery-lightbox button { border: 1px solid CanvasText; }
  .gallery-lightbox button:focus-visible { outline-color: Highlight; }
}
@media print { .gallery-lightbox { display: none !important; } .gallery-lightbox::backdrop { display: none; } }
