/* ===================================================================
   Gallery Stylesheet — Premium Luxury Catering Mosaic Redesign
   8-image mixed-size masonry: 4 horizontal cards of varying width,
   4 vertical cards of varying height. Functionality preserved:
   fancybox lightbox.
=================================================================== */

:root {
  --gallery-gold: #D4AF37;
  --gallery-gold-soft: rgba(212, 175, 55, 0.55);
  --gallery-ink: #14120f;
  --gallery-bg: #ffffff;
  --gallery-muted: #6b6558;
  --gallery-radius: 22px;
  --gallery-row: 8px;
  /* masonry row unit — JS computes span from this */
  --gallery-gap: 26px;
}

/* Gallery Section Wrapper */
.gallery-section {
  padding: 100px 0 110px;
  background-color: var(--gallery-bg);
  position: relative;
  overflow: hidden;
}

.gallery-section::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gallery-gold-soft) 0%, rgba(212, 175, 55, 0) 70%);
  pointer-events: none;
}

/* Section title accents */
.gallery-section .sub-title2 {
  color: var(--gallery-gold) !important;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: var(--gallery-row);
  grid-auto-flow: dense;
  gap: var(--gallery-gap);
  margin: 0;
  transition: opacity 0.3s ease;
}

.gallery-grid.is-filtering {
  opacity: 0.35;
}

.gallery-item {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1), transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item.is-hidden {
  display: none;
}

/* Stagger the entrance slightly across the grid */
.gallery-item:nth-child(1) {
  transition-delay: 0.02s;
}

.gallery-item:nth-child(2) {
  transition-delay: 0.08s;
}

.gallery-item:nth-child(3) {
  transition-delay: 0.14s;
}

.gallery-item:nth-child(4) {
  transition-delay: 0.20s;
}

.gallery-item:nth-child(5) {
  transition-delay: 0.26s;
}

.gallery-item:nth-child(6) {
  transition-delay: 0.32s;
}

.gallery-item:nth-child(7) {
  transition-delay: 0.38s;
}

.gallery-item:nth-child(8) {
  transition-delay: 0.44s;
}

/* Column span utility — creates hero / wide double-width cards */
.gallery-item.span-2 {
  grid-column: span 2;
}

/* ---------------------------------------------------------
   Aspect-ratio utilities — mixed, non-uniform sizing
   HORIZONTAL set (items 1-4): each a different width/height feel
--------------------------------------------------------- */
.gallery-item.ar-hero .gallery-card {
  aspect-ratio: 16 / 8;
}

.gallery-item.ar-wide .gallery-card {
  aspect-ratio: 16 / 9;
}

.gallery-item.ar-wide-short .gallery-card {
  aspect-ratio: 16 / 7;
}

/* ---------------------------------------------------------
   VERTICAL set (items 5-8): each a different height
--------------------------------------------------------- */
.gallery-item.ar-tall-xl .gallery-card {
  aspect-ratio: 3 / 5.2;
}

.gallery-item.ar-tall .gallery-card {
  aspect-ratio: 3 / 4.4;
}

.gallery-item.ar-portrait .gallery-card {
  aspect-ratio: 3 / 3.8;
}

/* ---------------------------------------------------------
   Card
--------------------------------------------------------- */
.gallery-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(20, 18, 15, 0.06);
  background: #f4f2ec;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.5s ease;
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 46px rgba(20, 18, 15, 0.16);
}

/* Animated gold border ring on hover */
.gallery-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--gallery-radius);
  border: 2px solid transparent;
  transition: border-color 0.5s ease;
  pointer-events: none;
  z-index: 3;
}

.gallery-card:hover::after {
  border-color: var(--gallery-gold-soft);
}

.gallery-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* .gallery-card:hover .gallery-card-img {
  transform: scale(1.08);
} */

/* Zoom button on overlay */
.gallery-card-action {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--gallery-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 4;
}

.gallery-card:hover .gallery-card-action {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.gallery-card-action:hover {
  background: var(--gallery-gold);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.5);
}

/* ---------------------------------------------------------
   Responsive: Desktop 4-col / Tablet 3-col / Mobile 2-col
--------------------------------------------------------- */
@media (max-width: 991px) {
  .gallery-section {
    padding: 80px 0 90px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (max-width: 575px) {
  .gallery-section {
    padding: 56px 0 64px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .gallery-item.span-2 {
    grid-column: span 2;
  }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {

  .gallery-item,
  .gallery-card,
  .gallery-card-img,
  .gallery-card-action {
    transition: none !important;
    animation: none !important;
  }

  .gallery-item {
    opacity: 1;
    transform: none;
  }
}

.text-white {
  color: white;
}

.text-black {
  color: rgb(0, 0, 0);
}