.gallery-page {
  text-align: center;
  position: relative;
  margin: 0 auto;
  padding: 28px 24px 50px;
}
.gallery-page h1 {
  margin: 0;
  color: #913f36;
  font-size: 34px;
  font-weight: 300;
  line-height: 43px;
}
.gallery-albums {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 8px;
  margin: 48px auto 0;
}
.gallery-album {
  width: min(297px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #342b27;
  text-decoration: none;
}
.gallery-album > img,
.gallery-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f3eee3;
}
.gallery-placeholder {
  display: grid;
  place-items: center;
}
.gallery-placeholder svg {
  width: 52px;
  height: 52px;
  color: #913f36;
}
.gallery-album strong {margin-top: 8px}
.gallery-album > span:not(.gallery-placeholder) {font-size: 14px}
.gallery-back {
  position: absolute;
  top: 30px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.gallery-back-arrow {display: none}
.gallery-count {margin: 4px 0 24px}
.gallery-detail .gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 24px;
}
.gallery-detail .gallery-grid button {
  display: block;
  width: 175px;
  height: 175px;
  padding: 0;
  border: 0;
  background: #f3eee3;
}
.gallery-detail .gallery-grid img {width: 100%;height: 100%;object-fit: cover}
dialog.gallery-viewer {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #313131;
  color: #fff;
  overflow: hidden;
}
.gallery-viewer-media {
  height: 100%;
  display: grid;
  place-items: center;
}
.gallery-viewer:has(.gallery-viewer-legend) .gallery-viewer-media {height: calc(100% - 50px)}
.gallery-viewer-media img {
  display: block;
  max-width: 80vw;
  max-height: 80vh;
  object-fit: contain;
  touch-action: pan-y pinch-zoom;
}
.gallery-viewer button {
  position: absolute;
  z-index: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 40px;
  line-height: 1;
}
.gallery-viewer-close {top: 20px;right: 30px}
.gallery-viewer-download {top: 20px;left: 20px}
.gallery-viewer-download svg {display: block;width: 26px;height: 26px;margin: auto}
.gallery-viewer-previous,
.gallery-viewer-next {top: calc(50% - 25px);transform: translateY(-50%)}
.gallery-viewer-previous {left: 16px}
.gallery-viewer-next {right: 16px}
.gallery-viewer-legend {
  height: 50px;
  display: grid;
  place-items: center;
  padding: 0 60px;
  text-align: center;
  font-weight: 600;
}
@media (max-width: 960px) {
  .gallery-page {padding-inline: 12px}
  .gallery-back {top: 28px;left: 12px;padding: 0 12px}
  .gallery-back-arrow {display: inline;font-size: 24px;line-height: 1}
  .gallery-back-label {display: none}
  .gallery-detail .gallery-grid {margin: 0}
  .gallery-detail .gallery-grid button {width: 100px;height: 100px}
  .gallery-viewer-close {right: auto;left: 10px}
  .gallery-viewer-close span {font-size: 0}
  .gallery-viewer-close span::after {content: '‹';font-size: 40px}
  .gallery-viewer-previous,.gallery-viewer-next {top: auto;bottom: 3px;transform: none}
  .gallery-viewer-previous {left: 8px}
  .gallery-viewer-next {right: 8px}
}
@media (max-width: 575px) {
  .gallery-viewer-download {left: auto;right: 20px}
}
