.gallery-page {
  position: relative;
  isolation: isolate;
  padding-top: clamp(32px, 6vw, 80px);
}
.gallery-page::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 16px 0 auto;
  height: clamp(280px, 43vw, 490px);
  border: 1px solid #d2ad97;
  border-radius: 9px 65px 9px 65px;
  background: linear-gradient(95deg, #fff9f0ee, #fff0f47a), url("/media/atelier-pearls.jpg") center / cover;
}
.gallery-page > .eyebrow, .gallery-page > h1, .gallery-intro { margin-inline: clamp(15px, 4vw, 60px); }
.gallery-page > h1 { margin-block: 9px 12px; }
.gallery-page > .eyebrow::after { content: " ✦"; color: #a04e6e; }
.gallery-intro { padding-top: 0; padding-bottom: 17px; color: var(--deep); }
.gallery-intro p:last-child { margin-bottom: 0; }
.gallery-page .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.gallery-grid a {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 5px;
  border: 1px solid #c1987c;
  border-radius: 5px 24px 5px 5px;
  background: #fff5ed;
  box-shadow: 0 5px 14px #542b2118;
  color: var(--deep);
}
.gallery-grid a:first-child { grid-column: span 2; grid-row: span 2; border-radius: 5px 46px 5px 5px; }
.gallery-grid a:first-child::after {
  content: "✦";
  position: absolute;
  top: 8px;
  right: 12px;
  color: #fff5d6;
  font-size: 2.2rem;
  line-height: 1;
  text-shadow: 0 1px 12px #5b222d;
  pointer-events: none;
}
.gallery-grid a:nth-child(4n+2) { background: #f8e2e8; }
.gallery-page .gallery-grid img { width: 100%; height: 100%; min-height: 0; aspect-ratio: 1; object-fit: cover; border-radius: 3px 19px 3px 3px; }
.gallery-page .gallery-grid a:first-child img { aspect-ratio: auto; border-top-right-radius: 39px; }
.gallery-grid a:hover { background: #f1d3df; text-decoration: none; border-color: #9f526d; }
.gallery-card-label {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 5px;
  padding: 8px 4px 3px;
  font-size: .76rem;
  line-height: 1.3;
  font-weight: 700;
}
.gallery-book { margin-top: 28px; }
.gallery-viewer {
  width: min(92vw, 730px);
  max-height: 94dvh;
  padding: 10px;
  border: 1px solid #d2ad97;
  border-radius: 12px;
  background: #fff6f1;
  color: var(--deep);
}
.gallery-viewer::backdrop { background: #251319dc; }
.gallery-viewer img { width: 100%; height: min(68dvh, 660px); object-fit: contain; border-radius: 6px; background: #301d23; }
.gallery-viewer-top, .gallery-viewer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px; }
.gallery-viewer button { min-width: 42px; min-height: 42px; border: 0; border-radius: 7px; background: #f4dfe7; color: var(--deep); font-size: 1.3rem; cursor: pointer; }
.gallery-caption { text-align: center; font-weight: 700; }
.gallery-counter { font-size: .86rem; }
@media (max-width: 650px) {
  .gallery-page .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .gallery-grid a:first-child { grid-row: auto; }
  .gallery-page .gallery-grid a:first-child img { aspect-ratio: 1.14; }
  .gallery-page > h1 { font-size: clamp(2.7rem, 13vw, 4.5rem); }
}
@media (max-width: 650px) {
  .gallery-page::before { height: 440px; mask-image: linear-gradient(#000 55%, transparent); }
}
