.gallery-redesign { background: var(--page-bg); }

.gallery-redesign .editorial-nav a[aria-current="page"] {
  border-bottom: 0;
}

.gallery-redesign .gallery-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--page-bg);
}

.gallery-collections {
  width: 100%;
  padding-top: 92px;
}

.gallery-redesign .gallery-collection {
  padding: 68px var(--content-gutter) 82px;
  border-bottom: 1px solid var(--border);
}

.gallery-redesign .gallery-collection:nth-child(even) { background: var(--section-alt); }

.gallery-redesign .gallery-collection:first-child { padding-top: 68px; }
.gallery-redesign .gallery-collection:last-child { padding-bottom: 82px; }

.gallery-redesign .gallery-page .gallery-collection__head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: start;
  max-width: none;
  margin: 0 0 30px;
  padding: 0;
}

.gallery-redesign .gallery-page .gallery-collection__head > span {
  display: block;
  padding-top: 12px;
  color: #9a8c6b;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.gallery-redesign .gallery-collection__head h2 {
  margin: 0;
  color: var(--text);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(42px, 3.8vw, 68px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0;
}

.gallery-redesign .gallery-collection__head p {
  max-width: 44ch;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 0.95vw, 18px);
  line-height: 1.6;
}

.gallery-redesign .gallery-collection__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: auto;
  gap: 12px;
}

.gallery-redesign .gallery-collection__grid figure,
.gallery-redesign .gallery-collection__grid figure:first-child,
.gallery-redesign .gallery-collection__grid figure:nth-child(1),
.gallery-redesign .gallery-collection__grid figure:nth-child(2),
.gallery-redesign .gallery-collection__grid figure:nth-child(3),
.gallery-redesign .gallery-collection:nth-child(even) .gallery-collection__grid figure:nth-child(1),
.gallery-redesign .gallery-collection:nth-child(even) .gallery-collection__grid figure:nth-child(2),
  .gallery-redesign .gallery-collection:nth-child(even) .gallery-collection__grid figure:nth-child(3) {
  position: relative;
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 2 / 3;
  margin: 0;
  overflow: hidden;
  background: #ebe9e5;
  cursor: zoom-in;
}

.gallery-redesign .gallery-collection__grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 0;
  aspect-ratio: auto;
  transition: transform 650ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.gallery-redesign .gallery-collection__grid figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 22px 18px 15px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent);
  font-size: 13px;
  line-height: 1.35;
  opacity: 0;
  transition: opacity 250ms ease;
}

.gallery-redesign .gallery-collection__grid figure:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-redesign .gallery-collection__grid figure:hover { transform: none; }
  .gallery-redesign .gallery-collection__grid figure:hover img { transform: scale(1.018); }
  .gallery-redesign .gallery-collection__grid figure:hover figcaption { opacity: 1; }
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 48px 92px;
  background: rgba(20, 20, 20, 0.95);
}

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

.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  color: #fff;
  background: transparent;
  font-family: Arial, sans-serif;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox__close { top: 24px; right: 24px; }
.gallery-lightbox__nav { top: 50%; transform: translateY(-50%); }
.gallery-lightbox__nav--prev { left: 24px; }
.gallery-lightbox__nav--next { right: 24px; }
.gallery-lightbox__count {
  position: absolute;
  bottom: 22px;
  left: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  transform: translateX(-50%);
}

.is-lightbox-open { overflow: hidden; }

@media (max-width: 900px) {
  .gallery-redesign .gallery-collection,
  .gallery-redesign .gallery-collection:first-child,
  .gallery-redesign .gallery-collection:last-child { padding-top: 70px; padding-bottom: 82px; }
  .gallery-redesign .gallery-collection__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .gallery-redesign .editorial-header { position: absolute; }
  .gallery-collections { padding-top: 66px; }
  .gallery-redesign .gallery-collection,
  .gallery-redesign .gallery-collection:first-child,
  .gallery-redesign .gallery-collection:last-child { padding: 58px 20px 70px; }
  .gallery-redesign .gallery-page .gallery-collection__head {
    grid-template-columns: 36px minmax(0, 1fr);
    margin-bottom: 28px;
  }
  .gallery-redesign .gallery-page .gallery-collection__head > span { padding-top: 7px; font-size: 11px; }
  .gallery-redesign .gallery-collection__head h2 { font-size: clamp(38px, 11vw, 50px); }
  .gallery-redesign .gallery-collection__head p { margin-top: 12px; font-size: 14px; }
  .gallery-redesign .gallery-collection__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 6px;
  }
  .gallery-redesign .gallery-collection__grid figure,
  .gallery-redesign .gallery-collection__grid figure:first-child,
  .gallery-redesign .gallery-collection__grid figure:nth-child(1),
  .gallery-redesign .gallery-collection__grid figure:nth-child(2),
  .gallery-redesign .gallery-collection__grid figure:nth-child(3),
  .gallery-redesign .gallery-collection:nth-child(even) .gallery-collection__grid figure:nth-child(1),
  .gallery-redesign .gallery-collection:nth-child(even) .gallery-collection__grid figure:nth-child(2),
  .gallery-redesign .gallery-collection:nth-child(even) .gallery-collection__grid figure:nth-child(3) {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
  }
  .gallery-redesign .gallery-collection__grid figcaption { display: none; }
  .gallery-lightbox { padding: 58px 12px; }
  .gallery-lightbox img { max-height: calc(100svh - 116px); }
  .gallery-lightbox__close,
  .gallery-lightbox__nav { width: 42px; height: 42px; }
  .gallery-lightbox__close { top: 12px; right: 12px; }
  .gallery-lightbox__nav { top: auto; bottom: 12px; transform: none; }
  .gallery-lightbox__nav--prev { left: 12px; }
  .gallery-lightbox__nav--next { right: 12px; }
}
