.galleries-hero,
.single-gallery-hero {
  position: relative;
  min-height: min(760px, 76svh);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--ink);
}

.galleries-hero-media,
.single-gallery-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: var(--image-zoom, cover);
  background-position: var(--image-position, center);
}

.galleries-hero-media {
  background-image: var(--gallery-hero-image, url("assets/images/optimized/elland-vee-warminster-wiltshire-vintage-glamour-boudoir-263-full.webp"));
}

.classic-hero::before {
  background-image: var(--gallery-hero-image, url("assets/images/optimized/elland-vee-warminster-wiltshire-classic-boudoir-009-full.webp"));
  background-position: var(--image-position, center 38%);
}

.vintage-hero::before {
  background-image: var(--gallery-hero-image, url("assets/images/optimized/elland-vee-warminster-wiltshire-vintage-glamour-boudoir-261-full.webp"));
  background-position: var(--image-position, center right);
}

.bridal-hero::before {
  background-image: var(--gallery-hero-image, url("assets/images/optimized/elland-vee-warminster-wiltshire-bridal-boudoir-021-full.webp"));
  background-position: var(--image-position, center);
}

.fine-art-hero::before {
  background-image: var(--gallery-hero-image, url("assets/images/optimized/elland-vee-warminster-wiltshire-fine-art-nude-140-full.webp"));
  background-position: var(--image-position, center);
}

.fine-art-portraits-hero::before {
  background-image: var(--gallery-hero-image, url("assets/images/optimized/elland-vee-warminster-wiltshire-fine-art-portraits-024-full.webp"));
  background-position: var(--image-position, center);
}

.burlesque-hero::before {
  background-image: var(--gallery-hero-image, url("assets/images/optimized/elland-vee-warminster-wiltshire-burlesque-showgirl-boudoir-486-full.webp"));
  background-position: var(--image-position, center 38%);
}

.maternity-hero::before {
  background-image: var(--gallery-hero-image, url("assets/images/optimized/elland-vee-warminster-wiltshire-maternity-boudoir-231-full.webp"));
  background-position: var(--image-position, center);
}

.gallery-maternity-page .single-gallery-hero {
  align-items: start;
  justify-items: end;
}

.gallery-maternity-page .single-gallery-overlay {
  background:
    linear-gradient(270deg, rgba(16, 13, 12, 0.9), rgba(16, 13, 12, 0.42) 46%, rgba(16, 13, 12, 0.18) 70%),
    linear-gradient(180deg, rgba(16, 13, 12, 0.74), rgba(16, 13, 12, 0.16) 48%, rgba(16, 13, 12, 0.88));
}

.gallery-maternity-page .single-gallery-copy {
  margin-left: auto;
  padding: clamp(98px, 10vw, 132px) var(--page-pad) clamp(48px, 7vw, 82px);
  text-align: right;
}

.gallery-maternity-page .single-gallery-copy h1,
.gallery-maternity-page .single-gallery-copy p:not(.eyebrow) {
  margin-left: auto;
}

.galleries-hero-overlay,
.single-gallery-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 13, 12, 0.92), rgba(16, 13, 12, 0.38) 54%, rgba(16, 13, 12, 0.74)),
    linear-gradient(180deg, rgba(16, 13, 12, 0.2), rgba(16, 13, 12, 0.96));
}

.galleries-hero-copy,
.single-gallery-copy {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  padding: clamp(118px, 14vw, 142px) var(--page-pad) clamp(56px, 8vw, 96px);
}

.galleries-hero-copy h1,
.single-gallery-copy h1 {
  max-width: 760px;
  font-size: clamp(2.05rem, 3.55vw, 4.05rem);
  line-height: 1.02;
}

.galleries-hero-copy p:not(.eyebrow),
.single-gallery-copy p:not(.eyebrow) {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--ivory-muted);
}

.gallery-index {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 14px;
  background: var(--ink);
}

.gallery-card {
  position: relative;
  grid-column: span 4;
  min-height: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  color: var(--ivory);
  text-decoration: none;
}

.gallery-card.bottom-row {
  grid-column: span 3;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms ease;
}

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 36%, rgba(16, 13, 12, 0.88));
}

.gallery-card span,
.gallery-card p {
  position: absolute;
  z-index: 1;
  left: 24px;
  right: 24px;
}

.gallery-card span {
  bottom: 72px;
  font-family: "Forum", Georgia, serif;
  font-size: clamp(1.7rem, 2.5vw, 2.7rem);
  line-height: 1;
}

.gallery-card p {
  bottom: 24px;
  margin: 0;
  max-width: 440px;
  color: var(--ivory-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.gallery-card:hover img {
  transform: scale(1.045);
}

.gallery-intro {
  background:
    radial-gradient(circle at 76% 12%, rgba(189, 161, 108, 0.08), transparent 30%),
    var(--ink);
}

.gallery-page .gallery-intro.section-band,
.gallery-page .privacy-note.section-band {
  padding-top: clamp(36px, 4.6vw, 62px);
  padding-bottom: clamp(36px, 4.6vw, 62px);
}

.gallery-navigation {
  padding: 0 var(--page-pad);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 13, 12, 0.94);
}

.gallery-nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 0;
}

.gallery-nav-inner a {
  min-height: 38px;
  padding: 11px 14px;
  color: var(--ivory-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.gallery-nav-inner a:hover {
  color: var(--gold-soft);
}

.gallery-vintage-page .gallery-nav-inner a[href="gallery-vintage-glamour.html"],
.gallery-classic-page .gallery-nav-inner a[href="gallery-classic-boudoir.html"],
.gallery-bridal-page .gallery-nav-inner a[href="gallery-bridal-boudoir.html"],
.gallery-fine-art-page .gallery-nav-inner a[href="gallery-fine-art-nude.html"],
.gallery-burlesque-page .gallery-nav-inner a[href="gallery-burlesque-showgirl.html"],
.gallery-maternity-page .gallery-nav-inner a[href="gallery-maternity-boudoir.html"] {
  color: var(--ivory);
  background: rgba(189, 161, 108, 0.14);
}

.masonry-wrap {
  padding: clamp(24px, 3.4vw, 48px) var(--page-pad) clamp(52px, 7vw, 92px);
  background: var(--ink);
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 clamp(16px, 2.5vw, 28px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.gallery-toolbar:not(:has(*)) {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.gallery-toolbar p {
  margin: 0;
}

.gallery-toolbar p:first-child {
  color: var(--gold-soft);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.gallery-toolbar p:last-child {
  max-width: 360px;
  color: var(--ivory-muted);
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: right;
}

.masonry-gallery {
  column-count: 4;
  column-gap: 14px;
}

.masonry-item {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  break-inside: avoid;
}

.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  transition: opacity 180ms ease, transform 300ms ease;
}

.masonry-item:hover img {
  opacity: 0.78;
  transform: translateY(-2px);
}

body.lightbox-open {
  overflow: hidden;
}

.privacy-note {
  background: var(--ink-soft);
}

.gallery-final {
  background:
    linear-gradient(rgba(16, 13, 12, 0.78), rgba(16, 13, 12, 0.94)),
    url("assets/images/optimized/elland-vee-warminster-wiltshire-classic-boudoir-012-full.webp") center / cover;
}

.gallery-page .final-cta {
  min-height: 46svh;
  padding-top: clamp(58px, 7vw, 88px);
  padding-bottom: clamp(58px, 7vw, 88px);
}

.gallery-page .site-footer {
  padding-top: clamp(42px, 5vw, 60px);
  padding-bottom: 28px;
}

.lightbox {
  width: min(94vw, 1280px);
  max-width: 1280px;
  height: min(92svh, 900px);
  max-height: 900px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: rgba(16, 13, 12, 0.96);
  color: var(--ivory);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.lightbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-count {
  position: absolute;
  z-index: 2;
  left: 16px;
  top: 16px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 13, 12, 0.78);
  color: var(--ivory-muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.lightbox button {
  position: absolute;
  z-index: 2;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 13, 12, 0.78);
  color: var(--ivory);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lightbox-close {
  top: 16px;
  right: 16px;
  padding: 0 16px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  width: 108px;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

@media (max-width: 1100px) {
  .gallery-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-card,
  .gallery-card.bottom-row,
  .gallery-card.large-card,
  .gallery-card.wide-card {
    grid-column: auto;
    aspect-ratio: 4 / 5;
  }

  .masonry-gallery {
    column-count: 3;
  }
}

@media (max-width: 720px) {
  .galleries-hero,
  .single-gallery-hero {
    min-height: 66svh;
  }

  .galleries-hero-copy,
  .single-gallery-copy {
    padding-top: 150px;
  }

  .gallery-maternity-page .single-gallery-copy {
    padding-top: 130px;
  }

  .gallery-index {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .gallery-card,
  .gallery-card.bottom-row,
  .gallery-card.large-card,
  .gallery-card.wide-card {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 5;
    min-height: 0;
  }

  .gallery-card.large-card {
    aspect-ratio: 16 / 11;
  }

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

  .gallery-nav-inner {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .gallery-nav-inner::-webkit-scrollbar {
    display: none;
  }

  .gallery-nav-inner a {
    flex: 0 0 auto;
  }

  .gallery-toolbar {
    display: block;
  }

  .gallery-toolbar p:last-child {
    margin-top: 8px;
    max-width: none;
    text-align: left;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 16px;
    transform: none;
  }
}

@media (max-width: 460px) {
  .masonry-gallery {
    column-count: 1;
  }

  .gallery-card p {
    display: none;
  }

  .gallery-card span {
    bottom: 24px;
  }
}
