.gallery-photo-button {
  position: relative;
  display: block;
  flex: none;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}
.gallery-lightbox-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html.gallery-lightbox-open { overflow: hidden; }
.gallery-lightbox-open body {
  position: fixed;
  top: var(--gallery-scroll-top);
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  padding-right: var(--gallery-body-padding);
}
.gallery-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(84px, calc(env(safe-area-inset-top) + 72px)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: contain;
  border: 0;
  background: transparent;
  color: #fff;
}
.gallery-lightbox[open] {
  display: grid;
  place-items: center;
}
.gallery-lightbox::backdrop {
  background: #17110dc4;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.gallery-lightbox-close {
  position: absolute;
  top: max(20px, calc(env(safe-area-inset-top) + 12px));
  right: max(24px, calc(env(safe-area-inset-right) + 12px));
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #ffffff50;
  border-radius: 999px;
  background: var(--surface, #fbf8f3);
  color: var(--accent, #850216);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 20px #0002;
  transition: background .2s, color .2s;
}
.gallery-lightbox-close:hover { background: var(--accent, #850216); color: #fff; }
.gallery-lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.gallery-lightbox-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: min(1180px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0;
  pointer-events: none;
  animation: gallery-photo-enter .22s ease-out both;
}
.gallery-lightbox-image {
  display: block;
  place-self: center;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 70px #0005;
  pointer-events: auto;
}
@keyframes gallery-photo-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
  .gallery-lightbox { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-lightbox-figure { animation: none; }
  .gallery-lightbox-close { transition: none; }
}
