/**
 * Gallery — Eagle's Nest–style headline + infinite landscape marquee
 */

.section--gallery {
  position: relative;
  padding: 0;
  overflow: hidden;
  scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 5rem);
  background: var(--lux-light, #F0EDE5);
}

main > section.section--gallery {
  justify-content: flex-start;
}

.section--gallery::before {
  display: none;
}

/* ----- Mast ----- */
.gallery-mast {
  text-align: left;
  max-width: 52rem;
  margin: 0 auto 2rem;
  position: relative;
  z-index: 2;
}

.gallery-mast--marquee,
.gallery-mast--center {
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
}

.gallery-mast__eyebrow {
  font-family: "Montserrat", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lux-dark, #1a1a1a);
  margin: 0 0 0.5rem;
}

.gallery-mast__title {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4.8vw, 3rem);
  font-weight: 600;
  color: var(--lux-dark, #1a1a1a);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
  text-wrap: balance;
}

.gallery-mast__title--hero {
  font-family: "Saudagar", serif !important;
  display: inline-block;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: none;
  white-space: nowrap;
  overflow-wrap: normal;
  hyphens: none;
}

.gallery-mast__rule {
  width: 2.75rem;
  height: 1px;
  margin-bottom: 1.25rem;
  background: linear-gradient(
    90deg,
    var(--lux-brown, #F0EDE5),
    rgba(255, 158, 109, 0.35)
  );
  opacity: 0.95;
}

.gallery-mast__desc {
  margin: 0 auto;
  max-width: 32rem;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.72;
  color: var(--lux-text-muted, rgba(26, 26, 26, 0.62));
}

/* ----- Infinite marquee ----- */
.gallery-marquee {
  position: relative;
  width: 100%;
  z-index: 2;
  margin-top: 0.5rem;
}

.gallery-marquee__viewport {
  overflow: hidden;
  width: 100%;
  padding: 0.35rem 0 0.5rem;
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 4%,
    #000 96%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 4%,
    #000 96%,
    transparent
  );
}

.gallery-marquee__track {
  display: flex;
  width: max-content;
  animation: gallery-marquee-scroll 55s linear infinite;
  will-change: transform;
}

.gallery-marquee:hover .gallery-marquee__track {
  animation-play-state: paused;
}

.gallery-marquee__group {
  display: flex;
  flex-direction: row;
  gap: 1.15rem;
  padding: 0 0.575rem;
  align-items: stretch;
}

@keyframes gallery-marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-marquee__track {
    animation: none;
  }

  .gallery-marquee__viewport {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    mask-image: none;
    -webkit-mask-image: none;
    scrollbar-width: thin;
  }
}

/* ----- Slide cards (16:9 landscape, rounded) ----- */
.gallery-marquee__slide.gallery-reel__slide {
  flex: 0 0 clamp(280px, 74vw, 440px);
  width: clamp(280px, 74vw, 440px);
  scroll-snap-align: none;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.gallery-marquee__slide.gallery-reel__slide:focus-visible {
  outline: 2px solid var(--color-burnt-copper, #F0EDE5);
  outline-offset: 3px;
}

.gallery-marquee__img-wrap.gallery-reel__img-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.gallery-marquee__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-marquee__img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 1;
}

/* Top caption bar (Eagle's Nest–style) */
.gallery-marquee__top-cap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.95rem 1rem 2.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.58) 0%,
    rgba(0, 0, 0, 0.22) 55%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

.gallery-marquee__card-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(0.95rem, 2.1vw, 1.2rem);
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  max-width: 14ch;
}

.gallery-marquee__card-label {
  font-family: "Montserrat", sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

@media (min-width: 900px) {
  .gallery-mast--marquee {
    margin-bottom: 2.75rem;
  }

  .gallery-marquee__slide.gallery-reel__slide {
    flex: 0 0 clamp(360px, 32vw, 500px);
    width: clamp(360px, 32vw, 500px);
  }

  .gallery-marquee__group {
    gap: 1.35rem;
    padding: 0 0.675rem;
  }
}

@media (max-width: 1024px) {
  .gallery-marquee__slide.gallery-reel__slide {
    flex: 0 0 calc((clamp(280px, 74vw, 440px) * 9 / 16 + 2.2cm) * 16 / 9) !important;
    width: calc((clamp(280px, 74vw, 440px) * 9 / 16 + 2.2cm) * 16 / 9) !important;
  }

  .gallery-marquee__group {
    gap: 0.55rem !important;
    padding: 0 0.3rem !important;
  }

  .gallery-marquee__img-wrap.gallery-reel__img-wrap {
    aspect-ratio: 16 / 9 !important;
    height: calc((clamp(280px, 74vw, 440px) * 9 / 16) + 2.2cm) !important;
    min-height: calc((clamp(280px, 74vw, 440px) * 9 / 16) + 2.2cm) !important;
  }
}

@media (max-width: 600px) {
  .gallery-mast__title--hero {
    font-size: clamp(1.65rem, 6.5vw, 2.15rem);
  }

  .gallery-marquee__top-cap {
    padding: 0.75rem 0.85rem 1.75rem;
  }
}

.gallery-marquee__eyebrow,
.gallery-mast__title,
.gallery-mast__title--hero,
.gallery-reel__title,
.gallery-reel__slide-title {
  font-family: "SwissNow", sans-serif;
}

.gallery-marquee__desc,
.gallery-reel__meta,
.gallery-reel__slide-copy {
  font-family: "SwissNow", sans-serif;
}
