/* Photo Gallery — approved editorial layout plus scalable discovery controls. */
body[data-page="gallery"] {
  --gallery-ink: #040d1e;
  --gallery-panel: #0a172b;
  --gallery-line: rgba(255, 255, 255, 0.14);
  --gallery-muted: #adb4c2;
  --gallery-accent: #f47f20;
}

body[data-page="gallery"] .gallery-hero {
  position: relative;
  width: 100%;
  max-width: none;
  min-height: 680px;
  padding: 165px var(--page-pad) 4rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #08101f;
  text-align: center;
}

body[data-page="gallery"] .gallery-hero .hero-overlay {
  z-index: 1;
  background: linear-gradient(180deg, rgba(1, 5, 14, 0.28), rgba(1, 5, 14, 0.58));
}

body[data-page="gallery"] .gallery-hero__memories {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  transform: none !important;
}

body[data-page="gallery"] .gallery-hero__memory {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #08101f;
}

body[data-page="gallery"] .gallery-hero__memory::before {
  content: none !important;
}

body[data-page="gallery"] .gallery-hero__memory::after {
  content: none !important;
}

body[data-page="gallery"] .gallery-hero__memory img {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  object-fit: cover !important;
  transform: none;
  box-shadow: none;
}

body[data-page="gallery"] .gallery-hero__memories--mobile {
  display: none;
}

body[data-page="gallery"] .gallery-hero__memory--triptych {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.16fr) minmax(0, 0.92fr);
  gap: 6px;
  background: #f7f4ee;
  will-change: opacity;
}

body[data-page="gallery"] .gallery-hero__memory--triptych img {
  position: relative;
  inset: auto;
  min-width: 0;
  object-fit: cover !important;
}

body[data-page="gallery"] .gallery-hero__photo--group {
  object-position: center 63% !important;
}

body[data-page="gallery"] .gallery-hero__photo--travelers {
  object-position: center 60% !important;
}

body[data-page="gallery"] .gallery-hero__photo--canopy,
body[data-page="gallery"] .gallery-hero__photo--pattern {
  object-position: center center !important;
}

body[data-page="gallery"] .gallery-hero__photo--desert {
  object-position: center 55% !important;
}

body[data-page="gallery"] .gallery-hero__photo--basket {
  object-position: 24% center !important;
}

body[data-page="gallery"] .gallery-hero__photo--celebration {
  object-position: center 58% !important;
}

body[data-page="gallery"] .gallery-hero__content {
  position: relative;
  z-index: 2;
  width: min(880px, calc(100vw - 40px));
  max-width: 880px !important;
  transform: translateY(118px);
}

body[data-page="gallery"] .gallery-hero h1 {
  margin: 0 0 0.8rem;
  font-family: "Avenir Next", "Montserrat", "Segoe UI", sans-serif;
  font-size: clamp(42px, 4.6vw, 68px) !important;
  font-weight: 700;
  line-height: 1.05 !important;
  letter-spacing: normal;
  white-space: normal;
}

body[data-page="gallery"] .gallery-hero p {
  max-width: 620px;
  margin: 0 auto;
  font-size: clamp(16px, 1.8vw, 22px) !important;
}

body[data-page="gallery"] .gallery-feature {
  min-height: 720px;
  padding-top: clamp(5.5rem, 9vw, 9rem);
  padding-bottom: clamp(5.5rem, 9vw, 9rem);
  background: #f7f4ee;
  color: #071123;
}

body[data-page="gallery"] .gallery-feature h2 {
  margin: 0.65rem 0 1.5rem;
  max-width: 620px;
  font-size: clamp(4rem, 7.4vw, 8rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
}

body[data-page="gallery"] .gallery-feature__copy {
  max-width: 520px;
  color: #49505d;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.8;
}

body[data-page="gallery"] .gallery-feature__image {
  position: relative;
  margin: 0;
}

body[data-page="gallery"] .gallery-feature__link {
  display: block;
  border-radius: 1rem;
  color: inherit;
  cursor: pointer;
  outline-offset: 10px;
}

body[data-page="gallery"] .gallery-feature__image::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -22px 24px 22px -24px;
  border: 1px solid rgba(244, 127, 32, 0.65);
  border-radius: 1.2rem;
}

body[data-page="gallery"] .gallery-feature__image img {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 5;
  max-height: 690px;
  box-shadow: 0 28px 70px rgba(3, 11, 26, 0.18);
  transition: transform 500ms ease, box-shadow 500ms ease;
}

body[data-page="gallery"] .gallery-feature__link:hover .gallery-feature__image img,
body[data-page="gallery"] .gallery-feature__link:focus-visible .gallery-feature__image img {
  transform: scale(1.018);
  box-shadow: 0 34px 82px rgba(3, 11, 26, 0.27);
}

body[data-page="gallery"] .gallery-feature__image figcaption {
  position: absolute;
  z-index: 2;
  right: -1.25rem;
  bottom: 2.2rem;
  display: grid;
  min-width: 190px;
  padding: 1rem 1.4rem;
  border: 1px solid rgba(244, 127, 32, 0.72);
  border-radius: 0.6rem;
  background: rgba(4, 13, 30, 0.94);
  color: #fff;
  box-shadow: 0 15px 40px rgba(3, 11, 26, 0.28);
}

body[data-page="gallery"] .gallery-feature__image figcaption span {
  color: #abb2bf;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body[data-page="gallery"] .gallery-feature__image figcaption strong {
  color: var(--gallery-accent);
  font-family: Georgia, serif;
  font-size: 1.75rem;
}

body[data-page="gallery"] .gallery-feature__image figcaption small {
  margin-top: 0.35rem;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-page="gallery"] .gallery-story {
  padding-top: clamp(5.5rem, 9vw, 8.5rem);
  padding-bottom: clamp(6rem, 10vw, 10rem);
  background:
    radial-gradient(circle at 10% 26%, rgba(244, 127, 32, 0.09), transparent 21rem),
    linear-gradient(180deg, #071326, var(--gallery-ink));
}

body[data-page="gallery"] .gallery-story > .section-heading {
  margin-bottom: clamp(3.2rem, 6vw, 5.7rem);
}

body[data-page="gallery"] .gallery-story > .section-heading h2 {
  margin-bottom: 1rem;
  font-size: clamp(4rem, 8vw, 8rem);
  line-height: 0.92;
}

body[data-page="gallery"] .gallery-story > .section-heading p:last-child {
  max-width: 670px;
  margin-inline: auto;
}

body[data-page="gallery"] .video-card {
  min-height: clamp(440px, 53vw, 680px);
  margin-bottom: clamp(6rem, 10vw, 10rem);
  border: 1px solid rgba(244, 127, 32, 0.4);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.36);
}

body[data-page="gallery"] .video-card > img {
  min-height: clamp(440px, 53vw, 680px);
}

body[data-page="gallery"] .video-card::after {
  background: linear-gradient(180deg, rgba(2, 8, 18, 0.28), rgba(2, 8, 18, 0.72));
}

body[data-page="gallery"] .video-card > div {
  inset: auto 0 clamp(2rem, 5vw, 4.8rem);
}

body[data-page="gallery"] .video-card h3 {
  font-size: clamp(2rem, 4.5vw, 4.2rem);
}

body[data-page="gallery"] .gallery-video-mark {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 1.7rem auto 0;
  place-items: center;
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(4, 13, 30, 0.5);
  color: #fff;
  font-size: 1.25rem;
  text-indent: 0.12em;
  backdrop-filter: blur(8px);
}

.gallery-discovery {
  padding-top: clamp(1rem, 3vw, 3rem);
}

.gallery-discovery__heading {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.55fr);
  align-items: end;
  gap: 4rem;
  margin-bottom: 3.4rem;
}

.gallery-discovery__heading h2 {
  max-width: 820px;
  margin-top: 0.7rem;
  font-size: clamp(3.25rem, 6.5vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.gallery-discovery__heading > p {
  max-width: 450px;
  color: var(--gallery-muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.gallery-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 0.75rem;
  padding: 1.2rem;
  border: 1px solid rgba(244, 127, 32, 0.42);
  border-radius: 0.85rem;
  background: rgba(9, 23, 43, 0.76);
}

.gallery-filters label {
  display: grid;
  gap: 0.45rem;
  color: #e9edf4;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-filters select {
  min-width: 0;
  height: 50px;
  padding: 0 2.6rem 0 0.9rem;
  border: 1px solid var(--gallery-line);
  border-radius: 0.35rem;
  background: #111d32;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.gallery-filters button {
  height: 50px;
  padding: 0 1.25rem;
  border: 1px solid var(--gallery-accent);
  border-radius: 0.35rem;
  background: transparent;
  color: var(--gallery-accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.gallery-filters button:hover,
.gallery-filters button:focus-visible {
  background: var(--gallery-accent);
  color: #071123;
}

.gallery-results-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 0 1rem;
  color: #8f98aa;
  font-size: 0.78rem;
}

.gallery-results-bar p {
  color: #fff;
}

body[data-page="gallery"] .gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: auto;
  align-items: stretch;
  gap: clamp(1rem, 2vw, 1.6rem);
}

body[data-page="gallery"] .gallery-grid[data-gallery-grid] > button,
body[data-page="gallery"] .gallery-grid[data-gallery-grid] > button:nth-child(n) {
  position: relative;
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.7rem;
  background: #081427;
  outline-offset: 4px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  isolation: isolate;
}

body[data-page="gallery"] .gallery-grid[data-gallery-grid] > button > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.002);
}

body[data-page="gallery"] .gallery-grid button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 8, 18, 0.04) 20%, rgba(2, 8, 18, 0.88) 88%);
  opacity: 1;
  transition: opacity 260ms ease;
}

body[data-page="gallery"] .gallery-grid button:hover::after,
body[data-page="gallery"] .gallery-grid button:focus-visible::after {
  opacity: 1;
}

.gallery-card__meta {
  position: absolute;
  z-index: 1;
  right: 1rem;
  bottom: 1.25rem;
  left: 1.25rem;
  display: grid;
  gap: 0.2rem;
  color: #fff;
  opacity: 1;
  transform: none;
  transition: opacity 260ms ease, transform 260ms ease;
  text-align: left;
}

.gallery-card__meta strong {
  font-family: Georgia, serif;
  font-size: clamp(1.7rem, 2.7vw, 2.6rem);
  line-height: 1;
}

.gallery-card__meta span {
  color: #d7dce6;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.gallery-card__eyebrow {
  color: var(--gallery-accent) !important;
  font-size: 0.63rem !important;
  font-weight: 900;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
}

.gallery-card__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff !important;
  font-size: 0.7rem !important;
  font-weight: 800;
  letter-spacing: 0.06em !important;
  text-transform: uppercase;
}

.gallery-card__action b {
  color: var(--gallery-accent);
  font-size: 1rem;
}

body[data-page="gallery"] .gallery-grid button:hover .gallery-card__meta,
body[data-page="gallery"] .gallery-grid button:focus-visible .gallery-card__meta {
  opacity: 1;
  transform: translateY(0);
}

.gallery-empty {
  padding: 5rem 1rem;
  border: 1px solid var(--gallery-line);
  text-align: center;
}

.gallery-empty h3 {
  margin-bottom: 0.6rem;
  font-family: Georgia, serif;
  font-size: 2rem;
}

.gallery-load-more {
  display: flex;
  justify-content: center;
  padding-top: 2.7rem;
}

.gallery-load-more .button {
  min-width: 250px;
}

.gallery-load-more [hidden] {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 1.25rem clamp(1rem, 3vw, 3rem);
  background: rgba(2, 7, 17, 0.97);
  color: #fff;
}

.gallery-lightbox__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
}

.gallery-lightbox__count {
  color: #aeb6c4;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-lightbox button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(4, 13, 30, 0.72);
  color: #fff;
  cursor: pointer;
}

.gallery-lightbox__close {
  font-size: 1.75rem;
}

.gallery-lightbox__stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
}

.gallery-lightbox__figure {
  display: grid;
  max-width: min(1200px, 84vw);
  max-height: 76vh;
  margin: 0;
  place-items: center;
}

.gallery-lightbox__figure img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 0.35rem;
  object-fit: contain;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
}

.gallery-lightbox__prev { left: 0; }
.gallery-lightbox__next { right: 0; }

.gallery-lightbox__caption {
  display: grid;
  gap: 0.22rem;
  justify-items: center;
  min-height: 65px;
  padding-top: 0.75rem;
  text-align: center;
}

.gallery-lightbox__caption strong {
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.gallery-lightbox__caption span {
  color: #aeb6c4;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .gallery-discovery__heading {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gallery-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="gallery"] .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body[data-page="gallery"] .gallery-hero {
    min-height: 560px;
    padding: 128px 20px 3rem;
  }

  body[data-page="gallery"] .gallery-hero__memories--desktop {
    display: none;
  }

  body[data-page="gallery"] .gallery-hero__memories--mobile {
    display: block;
  }

  body[data-page="gallery"] .gallery-hero__memory img {
    width: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    box-shadow: none;
  }

  body[data-page="gallery"] .gallery-hero__photo--group { object-position: center 61% !important; }
  body[data-page="gallery"] .gallery-hero__photo--travelers { object-position: center 60% !important; }
  body[data-page="gallery"] .gallery-hero__photo--desert { object-position: center 52% !important; }

  body[data-page="gallery"] .gallery-hero__content {
    width: min(100%, 360px);
    transform: translateY(62px);
  }

  body[data-page="gallery"] .gallery-hero h1 {
    font-size: clamp(38px, 11vw, 48px) !important;
  }

  body[data-page="gallery"] .gallery-hero p {
    max-width: 320px;
    font-size: 17px !important;
  }

  body[data-page="gallery"] .gallery-feature {
    min-height: 0;
  }

  body[data-page="gallery"] .gallery-feature h2 {
    font-size: clamp(3.2rem, 15vw, 4.8rem);
  }

  body[data-page="gallery"] .gallery-feature__image::before {
    inset: -12px 12px 12px -12px;
  }

  body[data-page="gallery"] .gallery-feature__image figcaption {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  body[data-page="gallery"] .gallery-story > .section-heading h2 {
    font-size: clamp(3.4rem, 18vw, 5.3rem);
  }

  body[data-page="gallery"] .video-card,
  body[data-page="gallery"] .video-card > img {
    min-height: 420px;
  }

  .gallery-discovery__heading h2 {
    font-size: clamp(3rem, 14vw, 4.4rem);
  }

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

  .gallery-results-bar span {
    display: none;
  }

  body[data-page="gallery"] .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  body[data-page="gallery"] .gallery-grid button {
    aspect-ratio: 16 / 10;
  }

  .gallery-card__meta {
    opacity: 1;
    transform: none;
  }

  body[data-page="gallery"] .gallery-grid button::after {
    opacity: 1;
  }

  .gallery-lightbox {
    padding: 0.75rem;
  }

  .gallery-lightbox__figure {
    max-width: 94vw;
  }

  .gallery-lightbox__nav {
    top: auto;
    bottom: 0.25rem;
    transform: none;
  }

  .gallery-lightbox__caption {
    padding-inline: 3.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="gallery"] .gallery-grid img,
  body[data-page="gallery"] .gallery-card__meta,
  body[data-page="gallery"] .gallery-grid button::after {
    transition: none;
  }
}
