.gallery-grid figure { cursor: zoom-in; }
.gallery-grid figure img { transition: transform .35s ease; }
.gallery-grid figure:hover img { transform: scale(1.035); }
.gallery-modal-open { overflow: hidden; }
.gallery-modal[hidden] { display: none; }
.gallery-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
}
.gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 18, 14, .82);
  backdrop-filter: blur(5px);
}
.gallery-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(1120px, calc(100vw - 140px));
  max-height: min(780px, calc(100vh - 80px));
  overflow: hidden;
  border: 1px solid rgba(255, 254, 250, .2);
  border-radius: 10px;
  background: #201813;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .35);
}
.gallery-modal__figure {
  display: grid;
  min-height: 0;
  margin: 0;
  place-items: center;
  background: #15100d;
}
.gallery-modal__figure img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: contain;
}
.gallery-modal__caption {
  margin: 0;
  padding: 15px 20px;
  color: #fffefa;
  font-family: var(--disp);
  font-size: 15px;
  letter-spacing: -.02em;
}
.gallery-modal__close,
.gallery-modal__nav {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 254, 250, .35);
  border-radius: 50%;
  background: rgba(28, 20, 15, .7);
  color: #fffefa;
  font-size: 25px;
  line-height: 1;
  place-items: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.gallery-modal__close { top: 14px; right: 14px; font-size: 28px; font-weight: 300; }
.gallery-modal__nav { top: 50%; transform: translateY(-50%); }
.gallery-modal__nav--prev { left: 14px; }
.gallery-modal__nav--next { right: 14px; }
.gallery-modal__close:hover,
.gallery-modal__nav:hover { border-color: var(--ember); background: var(--ember); }
@media (max-width: 760px) {
  .gallery-modal { padding: 18px; }
  .gallery-modal__dialog { width: 100%; max-height: calc(100vh - 36px); border-radius: 8px; }
  .gallery-modal__figure img { min-height: 220px; }
  .gallery-modal__close { top: 10px; right: 10px; }
  .gallery-modal__nav { width: 36px; height: 36px; font-size: 22px; }
  .gallery-modal__nav--prev { left: 8px; }
  .gallery-modal__nav--next { right: 8px; }
}
