/* 图库沿用门店详情的页宽、标题、引言和细线。缩略图与放大图完整显示原图。 */
body[data-page-key^="gallery/"] .store-gallery {
  width: min(1280px, calc(100% - 2 * var(--space, 24px)));
  margin: 24px auto clamp(56px, 7vw, 90px);
  color: var(--ink);
}

.store-gallery__head {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.store-gallery__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-underline-offset: 4px;
}

.store-gallery__back:is(:hover, :focus-visible) { text-decoration: underline; }

.store-gallery h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(48px, 5.8vw, 82px);
  text-wrap: balance;
}

.store-gallery__intro {
  max-width: 630px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  text-wrap: pretty;
}

.store-gallery__index {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.store-gallery__phrase { white-space: nowrap; }

.store-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.store-gallery__shot {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--cream, #f3f2ed);
}

.store-gallery__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}



.store-gallery__shot:focus-visible,
.store-gallery__back:focus-visible,
.store-gallery-dialog button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.store-gallery-dialog {
  box-sizing: border-box;
  width: min(1120px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .35);
  background: #29342c;
  color: #faf9f6;
  overflow: auto;
}

.store-gallery-dialog[open] { display: flex; flex-direction: column; }
.store-gallery-dialog::backdrop { background: rgba(25, 32, 27, .75); }
body[data-page-key^="gallery/"]:has(.store-gallery-dialog[open]) { overflow: hidden; }

.store-gallery-dialog [data-gallery-image-slot] {
  display: flex;
  justify-content: center;
  min-height: 0;
}

.store-gallery-dialog__frame {
  display: block;
  max-width: 100%;
  max-height: min(76dvh, calc(100dvh - 200px));
  width: auto;
  height: auto;
  object-fit: contain;
  touch-action: pan-y pinch-zoom;
}

.store-gallery-dialog__head,
.store-gallery-dialog__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.store-gallery-dialog__head { justify-content: end; margin-bottom: 8px; }

.store-gallery-dialog button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

.store-gallery-dialog__caption {
  margin: 8px auto 12px;
  color: inherit;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.store-gallery-dialog__position { font-size: 12px; white-space: nowrap; }

@media (max-width: 760px) {
  body[data-page-key^="gallery/"] .store-gallery {
    width: calc(100% - 48px);
    margin-top: 16px;
  }
  .store-gallery__head { padding-bottom: 16px; margin-bottom: 12px; }
  .store-gallery h1 {
    font-size: clamp(36px, 9.4vw, 44px);
    line-height: 1.08;
    letter-spacing: -.025em;
    overflow-wrap: break-word;
  }
  .store-gallery:lang(zh) h1 {
    font-size: clamp(30px, 8.2vw, 38px);
    line-height: 1.28;
    letter-spacing: normal;
  }
  .store-gallery__intro { margin-top: 12px; }
  .store-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body[data-page-key^="gallery/"] > .mobile-booking-bar:not([data-gallery-booking-visible]),
  body[data-page-key^="gallery/"]:has(.store-gallery-dialog[open]) > .mobile-booking-bar {
    visibility: hidden;
    pointer-events: none;
  }
}

/* 通用断词程序会把英文店名连同 photos 包成一个单位；标题按可用行宽排列。 */
.store-gallery h1 :is(.lb-unit, .lb-phrase) {
  display: inline;
  white-space: normal;
}
