.gallery-feature {
  background: #ffffff;
  padding: 84px 0;
}

.gallery-feature-head,
.gallery-page-head {
  display: flex;
  gap: 28px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 34px;
}

.gallery-feature-head h2,
.gallery-page-head h1 {
  max-width: 15ch;
  margin: 0;
  color: var(--brand-purple);
  font-family: "Fraunces", "Playfair Display", Georgia, serif;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.04;
}

.gallery-feature-head p,
.gallery-page-head p {
  max-width: 48ch;
  margin: 0;
  color: var(--brand-muted);
  font-size: 15px;
  line-height: 1.65;
}

.gallery-feature-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-purple);
  padding: 0 18px;
  color: var(--brand-purple);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.gallery-feature-link:hover,
.gallery-feature-link:focus-visible {
  border-color: var(--brand-red);
  background: var(--brand-red);
  color: #ffffff;
}

.gallery-feature-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr 0.85fr;
  gap: 16px;
}

.gallery-feature-card,
.gallery-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(42, 23, 107, 0.16);
  background: #f8f6fc;
}

.gallery-feature-card:first-child {
  grid-row: span 2;
}

.gallery-feature-card img,
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-feature-card img {
  aspect-ratio: 4 / 3;
}

.gallery-feature-card:first-child img {
  aspect-ratio: 4 / 5;
}

.gallery-feature-card span,
.gallery-card span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  background: rgba(29, 15, 77, 0.86);
  color: #ffffff;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.gallery-page {
  background: #f8f6fc;
}

.gallery-page-hero {
  padding: 92px 0 46px;
}

.gallery-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(32px, 6vw, 78px);
  align-items: end;
}

.gallery-page-head {
  display: block;
  margin: 0;
}

.gallery-page-head h1 {
  max-width: 13ch;
  margin: 0 0 22px;
  font-size: clamp(40px, 6vw, 82px);
}

.gallery-page-head p {
  font-size: 17px;
}

.gallery-note {
  border: 1px solid rgba(42, 23, 107, 0.16);
  background: #ffffff;
  padding: 28px;
}

.gallery-note h2 {
  margin: 12px 0 16px;
  color: var(--brand-purple);
  font-size: 24px;
  line-height: 1.15;
}

.gallery-note dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.gallery-note dt {
  color: var(--brand-purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-note dd {
  margin: 4px 0 0;
  color: var(--brand-muted);
  font-size: 14px;
  line-height: 1.5;
}

.gallery-page-grid-section {
  padding: 32px 0 92px;
}

.gallery-grid {
  column-count: 3;
  column-gap: 18px;
}

.gallery-card,
.gallery-card.wide {
  display: block;
  margin: 0 0 18px;
  break-inside: avoid;
  background: #ffffff;
}

.gallery-card,
.gallery-card.wide,
.gallery-card.tall {
  min-height: 0;
}

.gallery-card img,
.gallery-card.tall img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.gallery-card span {
  position: static;
  display: block;
  border-top: 1px solid rgba(42, 23, 107, 0.12);
  background: #ffffff;
  color: var(--brand-purple);
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.gallery-lightbox-lock {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  background: rgba(8, 6, 24, 0.94);
  color: #ffffff;
}

.gallery-lightbox.is-open {
  display: block;
}

.gallery-lightbox-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(80px, 0.12fr) minmax(0, 1fr) minmax(80px, 0.12fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: clamp(14px, 3vw, 34px);
}

.gallery-lightbox-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.gallery-lightbox-close {
  padding: 0 18px;
}

.gallery-lightbox-count {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.gallery-lightbox-nav {
  align-self: center;
  justify-self: stretch;
  padding: 0 12px;
}

.gallery-lightbox-prev {
  grid-column: 1;
  grid-row: 2;
}

.gallery-lightbox-next {
  grid-column: 3;
  grid-row: 2;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:hover,
.gallery-lightbox-nav:focus-visible {
  border-color: var(--brand-red);
  background: var(--brand-red);
  outline: none;
}

.gallery-lightbox-figure {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  min-height: 0;
  place-items: center;
  gap: 14px;
  margin: 0;
}

.gallery-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.gallery-lightbox-caption {
  max-width: min(760px, 90vw);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 980px) {
  .gallery-feature-head,
  .gallery-page-layout {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .gallery-feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-grid {
    column-count: 2;
  }

  .gallery-page-layout {
    gap: 28px;
  }

  .gallery-note {
    max-width: 560px;
  }
}

@media (max-width: 680px) {
  .gallery-feature,
  .gallery-page-hero {
    padding: 56px 0 36px;
  }

  .gallery-feature-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    column-count: 1;
  }

  .gallery-lightbox-panel {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
  }

  .gallery-lightbox-figure {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .gallery-lightbox-image {
    max-height: calc(100vh - 180px);
  }

  .gallery-lightbox-prev,
  .gallery-lightbox-next {
    grid-row: 3;
    min-height: 46px;
  }

  .gallery-lightbox-prev {
    grid-column: 1;
  }

  .gallery-lightbox-next {
    grid-column: 2;
  }

  .gallery-feature-card,
  .gallery-feature-card:first-child,
  .gallery-card,
  .gallery-card.wide,
  .gallery-card.tall {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
  }

  .gallery-feature-card img,
  .gallery-feature-card:first-child img,
  .gallery-card img,
  .gallery-card.tall img {
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .gallery-feature-link {
    width: 100%;
  }

  .gallery-feature-card span,
  .gallery-card span {
    position: static;
    display: block;
    background: var(--brand-purple);
    padding: 13px 14px;
  }
}
