/* ==========================================================================
   Harini Catering — Gallery
   Premium editorial photography portfolio.
   ========================================================================== */

.section-heading { max-width: 38rem; }

.hero-anim {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-anim--1 { animation-delay: 0.08s; }
.hero-anim--2 { animation-delay: 0.18s; }
.hero-anim--3 { animation-delay: 0.3s; }
.hero-anim--4 { animation-delay: 0.42s; }

.text-link {
  display: inline-flex;
  align-items: center;
  margin-top: 1.1rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-primary);
  border-bottom: 1px solid var(--brand-gold);
  padding-bottom: 0.15rem;
}
.text-link:hover,
.text-link:focus-visible {
  color: var(--brand-primary-deep);
  border-bottom-color: var(--brand-primary);
}

.page-gallery section[id],
.page-gallery [data-gallery-section] {
  scroll-margin-top: calc(var(--header-height) + 3.6rem);
}

/* -------------------------------------------------------------------------- */
/* Hero
/* -------------------------------------------------------------------------- */

.gallery-hero {
  position: relative;
  min-height: clamp(36rem, 88svh, 54rem);
  display: flex;
  align-items: flex-end;
  color: var(--text-on-brand);
  overflow: hidden;
  background: #e4d0be;
}
.gallery-hero.parallax-section {
  min-height: clamp(36rem, 88svh, 54rem);
}
.gallery-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.gallery-hero__media .media-placeholder {
  height: 100%;
  min-height: 100%;
  border-radius: 0;
  background-image:
    radial-gradient(ellipse 70% 50% at 58% 40%, rgba(255, 248, 242, 0.3), transparent 56%),
    linear-gradient(122deg, #f1e4d6 6%, #d7b79a 50%, #c09472 100%);
}
.gallery-hero__media .media-placeholder::before {
  padding-bottom: 0;
  height: 100%;
}
.gallery-hero.has-media .gallery-hero__emblem {
  opacity: 0;
}
.gallery-hero__media .media-placeholder img {
  object-position: 50% 46%;
}
.gallery-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(105deg, rgba(31, 14, 12, 0.58) 0%, rgba(31, 14, 12, 0.34) 28%, rgba(31, 14, 12, 0.12) 48%, transparent 70%),
    linear-gradient(180deg, rgba(31, 14, 12, 0.28) 0%, rgba(31, 14, 12, 0.12) 30%, rgba(31, 14, 12, 0.42) 76%, rgba(31, 14, 12, 0.62) 100%);
  pointer-events: none;
}
.gallery-hero__emblem {
  position: absolute;
  top: 13%;
  right: 5%;
  width: min(28vw, 220px);
  height: 120px;
  background: url("../images/branding/heritage-emblem.png") center / contain no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 1;
}
.gallery-hero__content {
  position: relative;
  z-index: 2;
  padding: 7.8rem 0 3.2rem;
  max-width: 46rem;
  width: 100%;
  min-width: 0;
}
.gallery-hero h1 {
  font-size: clamp(2.35rem, 4.4vw + 1rem, 4.4rem);
  max-width: 16ch;
  color: #fffaf4;
  line-height: 1.12;
  text-shadow: 0 8px 24px rgba(31, 14, 12, 0.22);
  overflow-wrap: break-word;
}
.gallery-hero .lead {
  color: rgba(255, 248, 242, 0.92);
  line-height: 1.7;
  max-width: 38rem;
}

/* -------------------------------------------------------------------------- */
/* Category navigation
/* -------------------------------------------------------------------------- */

.gallery-nav-wrap {
  position: relative;
  z-index: 30;
  scroll-margin-top: var(--header-height);
  min-width: 0;
}
.gallery-nav-wrap .section:first-of-type { padding-top: 2.5rem; }
.gallery-nav {
  position: sticky;
  top: var(--header-height);
  z-index: 30;
  background: rgba(255, 251, 247, 0.94);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.gallery-nav.is-stuck {
  border-bottom-color: var(--border-light);
  box-shadow: 0 8px 18px rgba(36, 17, 15, 0.06);
}
.gallery-nav__inner { min-width: 0; }
.gallery-nav__scroller {
  display: flex;
  gap: 0.55rem;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 0.85rem 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}
.gallery-nav__scroller::-webkit-scrollbar { display: none; }
.gallery-nav__btn {
  flex: 0 0 auto;
  border: 1px solid var(--border-light);
  background: var(--brand-background);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  min-height: 42px;
  padding: 0.45rem 1.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}
.gallery-nav__btn:hover,
.gallery-nav__btn:focus-visible {
  background: var(--brand-blush);
  border-color: var(--brand-gold);
  color: var(--brand-primary);
}
.gallery-nav__btn.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-brand);
}

/* -------------------------------------------------------------------------- */
/* Cards + grids
/* -------------------------------------------------------------------------- */

.gallery-card {
  min-width: 0;
  margin: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.gallery-card.is-collapsed { display: none; }
.gallery-card__open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-md);
}
.gallery-card__open:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 4px;
}
.gallery-card__media {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}
.gallery-card__media .media-placeholder {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.gallery-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 46%, rgba(31, 14, 12, 0.38) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.gallery-card__open:hover .media-placeholder,
.gallery-card__open:focus-visible .media-placeholder {
  transform: scale(1.035);
}
.gallery-card__open:hover .gallery-card__overlay,
.gallery-card__open:focus-visible .gallery-card__overlay {
  opacity: 1;
}
.gallery-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.1rem 0;
}
.gallery-card__category {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brand-gold-deep);
}
.gallery-card__title {
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.gallery-card__soon {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
}
.gallery-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

.gallery-featured__grid,
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
.gallery-grid--videos {
  grid-template-columns: 1fr;
}

.gallery-card--video .gallery-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  background: rgba(255, 248, 242, 0.94);
  color: var(--brand-primary);
  font-size: 1.7rem;
  z-index: 1;
}
.gallery-card--video .gallery-card__media { display: block; }

.gallery-more {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}
.gallery-more[hidden] { display: none !important; }
.gallery-more .btn-cta-secondary { min-width: 12rem; }

.gallery-featured.heritage-emblem--watermark::before {
  inset: auto 5% 6% auto;
  width: min(26%, 200px);
  height: 38%;
  opacity: 0.04;
}

.gallery-video-block {
  background: #2a1612;
  color: var(--text-on-brand);
}
.gallery-video-block h2,
.gallery-video-block .section-copy { color: #fffaf4; }
.gallery-video-block.heritage-emblem--watermark::before {
  inset: 10% auto auto 4%;
  width: min(28%, 200px);
  height: 40%;
  opacity: 0.08;
}

.gallery-moments .gallery-empty { font-style: italic; }

/* -------------------------------------------------------------------------- */
/* CTA
/* -------------------------------------------------------------------------- */

.gallery-cta {
  position: relative;
  overflow: hidden;
  background: var(--brand-primary);
  color: var(--text-on-brand);
  text-align: center;
  min-height: 0;
  padding: clamp(4.5rem, 10vw, 8.5rem) 0;
}
.gallery-cta__media { inset: -12% 0; }
.gallery-cta__media .media-placeholder {
  height: 100%;
  border-radius: 0;
}
.gallery-cta__media .media-placeholder::before {
  padding-bottom: 0;
  height: 100%;
}
.gallery-cta__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(121, 18, 14, 0.72), rgba(108, 9, 4, 0.84));
}
.gallery-cta h2,
.gallery-cta .lead { color: #fffaf4; }
.gallery-cta .lead { margin-inline: auto; }
.gallery-cta .container,
.gallery-cta .parallax-section__content { position: relative; z-index: 1; }
.gallery-cta.heritage-emblem--watermark::before {
  inset: auto auto -12% 50%;
  width: 260px;
  height: 260px;
  transform: translateX(-50%);
  opacity: 0.1;
  z-index: 1;
}
.gallery-cta__links {
  margin: 1.35rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 248, 242, 0.7);
}
.gallery-cta__links a { color: var(--text-gold); }

/* -------------------------------------------------------------------------- */
/* Lightbox + video modal
/* -------------------------------------------------------------------------- */

.gallery-lightbox,
.gallery-video {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.gallery-lightbox[hidden],
.gallery-video[hidden] { display: none !important; }
.gallery-lightbox:not([hidden]),
.gallery-video:not([hidden]) { animation: fadeIn 0.28s ease; }
.gallery-lightbox__backdrop,
.gallery-video__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 10, 8, 0.82);
}
.gallery-lightbox__dialog,
.gallery-video__dialog {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  max-height: min(92vh, 56rem);
  overflow: auto;
  outline: none;
}
.gallery-video__dialog { width: min(960px, 100%); }
.gallery-lightbox__media .media-placeholder {
  background-color: #2a1612;
  border-radius: var(--radius-lg);
  max-height: 78vh;
}
.gallery-lightbox__media img { object-fit: contain; }
.gallery-lightbox__caption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  align-items: baseline;
  margin-top: 0.85rem;
  color: #fffaf4;
}
.gallery-lightbox__category {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-gold);
  margin: 0;
}
.gallery-lightbox__title,
.gallery-lightbox__desc { margin: 0; }
.gallery-lightbox__desc {
  width: 100%;
  color: rgba(255, 248, 242, 0.78);
}
.gallery-lightbox__close,
.gallery-lightbox__prev,
.gallery-lightbox__next,
.gallery-video__close {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 248, 242, 0.94);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.gallery-lightbox__close,
.gallery-video__close { top: 0.35rem; right: 0.35rem; }
.gallery-lightbox__prev,
.gallery-lightbox__next { top: 46%; transform: translateY(-50%); }
.gallery-lightbox__prev { left: 0.35rem; }
.gallery-lightbox__next { right: 0.35rem; }

.gallery-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #140a08;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.gallery-video__frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #140a08;
}

.gallery-modal-open { overflow: hidden; }
.gallery-modal-open .floating-actions,
.gallery-modal-open .scroll-top {
  opacity: 0;
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Breakpoints
/* -------------------------------------------------------------------------- */

@media (min-width: 576px) {
  .gallery-grid,
  .gallery-featured__grid {
    grid-template-columns: 1fr 1fr;
  }
  .gallery-card--lead { grid-column: span 2; }
  .gallery-grid--videos { grid-template-columns: 1fr; }
}

@media (min-width: 768px) {
  .gallery-grid--videos { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 992px) {
  .gallery-hero { min-height: 88vh; }
  .gallery-nav__scroller {
    gap: 0.75rem;
    overflow: visible;
    scroll-snap-type: none;
    flex-wrap: wrap;
    padding-right: 0;
  }
  .gallery-featured__grid {
    grid-template-columns: 1.55fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
  }
  .gallery-featured__grid .gallery-card--lead {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
  }
  .gallery-featured__grid .gallery-card--lead .media-placeholder { height: 100%; }
  .gallery-featured__grid .gallery-card--lead .media-placeholder::before {
    padding-bottom: 0;
    height: 100%;
    min-height: 420px;
  }
  .gallery-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: 0.9rem;
  }
  .gallery-grid .gallery-card:nth-child(1) { grid-column: 1 / 8; }
  .gallery-grid .gallery-card:nth-child(2) { grid-column: 8 / 13; }
  .gallery-grid .gallery-card:nth-child(3) { grid-column: 1 / 5; }
  .gallery-grid .gallery-card:nth-child(4) { grid-column: 5 / 9; }
  .gallery-grid .gallery-card:nth-child(5) { grid-column: 9 / 13; }
  .gallery-grid .gallery-card:nth-child(6) { grid-column: 1 / 7; }
  .gallery-grid .gallery-card:nth-child(n + 7) { grid-column: span 4; }
  .gallery-grid--compact .gallery-card:nth-child(1) { grid-column: 1 / 7; }
  .gallery-grid--compact .gallery-card:nth-child(2) { grid-column: 7 / 13; }
  .gallery-grid--compact .gallery-card:nth-child(3) { grid-column: 1 / 5; }
  .gallery-grid--compact .gallery-card:nth-child(4) { grid-column: 5 / 9; }
  .gallery-grid--compact .gallery-card:nth-child(5) { grid-column: 9 / 13; }
  .gallery-grid--videos { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767.98px) {
  .page-gallery .section,
  .page-gallery .gallery-video-block { padding: 4.5rem 0; }
  .page-gallery .gallery-hero h1 {
    font-size: clamp(2.25rem, 9.6vw, 2.8rem);
    line-height: 1.16;
    max-width: 14ch;
  }
  .page-gallery h2 {
    font-size: clamp(1.75rem, 6.4vw, 2rem);
    line-height: 1.24;
  }
  .page-gallery .section-copy,
  .page-gallery .lead {
    font-size: 1rem;
    line-height: 1.75;
  }
  .gallery-hero {
    min-height: min(78svh, 44rem);
  }
  .gallery-hero__content { padding: 6.8rem 0 2.8rem; }
  .gallery-hero__emblem {
    width: 150px;
    opacity: 0.045;
    top: 10%;
    right: -6%;
  }
  .page-gallery .cta-row { padding-right: 4.25rem; }
  .gallery-nav__scroller { padding-right: 4.5rem; }
  .gallery-card__overlay { opacity: 0.35; }
  .gallery-lightbox,
  .gallery-video {
    padding: 0.65rem;
    align-items: stretch;
  }
  .gallery-lightbox__dialog,
  .gallery-video__dialog {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-height: 100%;
  }
  .gallery-lightbox__prev,
  .gallery-lightbox__next { top: auto; bottom: 5.5rem; transform: none; }
}

@media (max-width: 479.98px) {
  .gallery-grid,
  .gallery-featured__grid {
    grid-template-columns: 1fr;
  }
  .gallery-card--lead { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-anim,
  .gallery-lightbox:not([hidden]),
  .gallery-video:not([hidden]),
  .gallery-card {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .gallery-card__open:hover .media-placeholder,
  .gallery-card__open:focus-visible .media-placeholder {
    transform: none;
  }
}
