/* ============================================================
   company-gallery.css — aurelio travels
   Premium gallery page styles — v2.0
   All values reference main.css variables only.
   NO hardcoded colors, fonts, or spacing.
   NO hero section overrides — hero is handled by template.
   ============================================================ */

/* ── LOADING OVERLAY ───────────────────────────────────────── */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: opacity 0.6s ease;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(251, 191, 36, 0.15);
  border-top-color: var(--primary-gold);
  border-radius: 50%;
  animation: gallerySpinRing 0.8s linear infinite;
}

@keyframes gallerySpinRing {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-heading);
  color: var(--primary-gold);
  font-size: var(--text-xs, 0.8rem);
  letter-spacing: var(--ls-widest, 0.2em);
  text-transform: uppercase;
}

/* ── FILTER BUTTONS (hero section — functional styles only) ── */
.filter-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn-filter {
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-white-80, rgba(255,255,255,0.80));
  background: var(--color-white-05, rgba(255,255,255,0.06));
  border: 1px solid var(--color-white-20, rgba(255,255,255,0.20));
  border-radius: var(--radius-full, 100px);
  padding: 0.45rem 1.25rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-filter:hover,
.btn-filter.active {
  background: var(--primary-gold);
  color: var(--bg-primary);
  border-color: var(--primary-gold);
  transform: translateY(-1px);
}

/* ── SECTION DIVIDER LINE ──────────────────────────────────── */
.gallery-divider {
  width: var(--spacing-16, 4rem);
  height: 2px;
  background: var(--gradient-gold);
  border-radius: var(--radius-full, 100px);
  margin: 0.75rem auto 0;
}

/* ── GALLERY SECTION ───────────────────────────────────────── */
.gallery-main {
  background: var(--bg-primary);
  padding-top: 3rem;
  padding-bottom: 4rem;
}

/* Section header */
.gallery-section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.gallery-section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--ls-widest, 0.2em);
  text-transform: uppercase;
  color: var(--primary-gold);
  border: 1px solid var(--border-gold, rgba(251,191,36,0.3));
  background: var(--color-gold-bg, rgba(251,191,36,0.06));
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full, 100px);
  margin-bottom: 0.75rem;
}

.gallery-section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: var(--leading-tight, 1.2);
}

.gallery-section-sub {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  color: var(--color-white-50, rgba(255,255,255,0.5));
  margin-bottom: 0;
}

/* Gallery count badge */
.gallery-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold);
  color: var(--primary-gold);
  background: var(--color-gold-bg, rgba(251,191,36,0.06));
  border: 1px solid var(--border-gold, rgba(251,191,36,0.25));
  border-radius: var(--radius-full, 100px);
  padding: 0.25rem 0.85rem;
  margin-top: 0.75rem;
}

/* ── EDITORIAL MIXED GRID ──────────────────────────────────── */
#gallery-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}

/* Gallery item base */
.gallery-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Featured items — span 2 columns */
.gallery-item.featured {
  grid-column: span 2;
}

/* ── GALLERY CARD ──────────────────────────────────────────── */
.gallery-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-luxury);
}

/* Image */
.gallery-card img {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:not(.featured) .gallery-card img {
  height: 210px;
}

.gallery-item.featured .gallery-card img {
  height: 280px;
}

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

/* Gold shimmer skeleton while loading */
.gallery-card.skeleton img {
  visibility: hidden;
}

.gallery-card.skeleton::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    rgba(251,191,36,0.06) 40%,
    var(--bg-secondary) 80%
  );
  background-size: 200% 100%;
  animation: galleryShimmer 1.6s ease-in-out infinite;
  z-index: 1;
}

@keyframes galleryShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── CARD OVERLAY ──────────────────────────────────────────── */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.30) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.1rem;
  pointer-events: none;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-info {
  transform: translateY(8px);
  transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-info {
  transform: translateY(0);
}

.gallery-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: var(--font-weight-bold);
  color: var(--white);
  margin-bottom: 0.2rem;
  line-height: var(--leading-snug, 1.35);
}

.gallery-item.featured .gallery-title {
  font-size: 1rem;
}

.gallery-description {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  color: var(--color-white-70, rgba(255,255,255,0.70));
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Zoom icon */
.gallery-zoom-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-gold);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.gallery-card:hover .gallery-zoom-icon {
  opacity: 1;
  transform: scale(1);
}

/* Featured badge */
.gallery-featured-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--ls-wider, 0.08em);
  text-transform: uppercase;
  color: var(--bg-primary);
  background: var(--gradient-gold);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full, 100px);
  pointer-events: none;
  z-index: 2;
}

/* Category tags on overlay */
.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.gallery-tag {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-gold);
  background: rgba(251,191,36,0.18);
  border: 1px solid rgba(251,191,36,0.35);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full, 100px);
}

/* ── GALLERY EMPTY STATE ───────────────────────────────────── */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-white-50, rgba(255,255,255,0.5));
  font-family: var(--font-primary);
}

.gallery-empty i {
  font-size: 2.5rem;
  color: var(--primary-gold);
  margin-bottom: 1rem;
  display: block;
  opacity: 0.5;
}

/* ── FILTER TRANSITION STATES ──────────────────────────────── */
.gallery-item.hiding {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ── INSTAGRAM SECTION ─────────────────────────────────────── */
.instagram-feed {
  background: var(--bg-secondary);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

/* Subtle gold glow background accent */
.instagram-feed::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, var(--color-gold-bg, rgba(251,191,36,0.05)) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.instagram-feed .container {
  position: relative;
  z-index: 1;
}

.instagram-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.section-subtitle {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
  color: var(--primary-gold);
  letter-spacing: var(--ls-wide, 0.05em);
}

.instagram-intro {
  font-family: var(--font-primary);
  font-size: 0.92rem;
  color: var(--color-white-50, rgba(255,255,255,0.5));
  max-width: 500px;
  margin: 0.5rem auto 1.25rem;
  line-height: 1.6;
}

.btn-gallery-instagram {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  font-size: 0.82rem;
  color: var(--primary-gold);
  border: 1.5px solid var(--primary-gold);
  background: transparent;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
  letter-spacing: var(--ls-wide, 0.05em);
}

.btn-gallery-instagram:hover {
  background: var(--primary-gold);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

/* Instagram grid items */
.instagram-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: var(--shadow-md);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.instagram-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-luxury);
}

.instagram-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.instagram-item:hover img {
  transform: scale(1.1);
}

.instagram-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(251,191,36,0.25) 0%,
    rgba(0,0,0,0.55) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-decoration: none;
}

.instagram-item:hover .instagram-item-overlay {
  opacity: 1;
}

.instagram-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--primary-gold);
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.7);
  transition: transform 0.3s ease;
}

.instagram-item:hover .instagram-icon-wrap {
  transform: scale(1);
}

.instagram-icon {
  font-size: 1.2rem;
  color: var(--primary-gold);
}

/* ── CTA SECTION ───────────────────────────────────────────── */
.gallery-cta {
  background: var(--bg-primary);
  padding: 4rem 0;
}

.cta-card {
  background: var(--gradient-luxury);
  border-radius: 16px;
  padding: 2.5rem 3rem;
  position: relative;
  overflow: hidden;
}

/* Decorative gold ring */
.cta-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 40px solid rgba(251,191,36,0.06);
  pointer-events: none;
}

.cta-card::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 50px solid rgba(251,191,36,0.04);
  pointer-events: none;
}

.cta-card h2 {
  font-family: var(--font-heading);
  color: var(--white);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.5rem;
  line-height: var(--leading-tight, 1.2);
  position: relative;
  z-index: 1;
}

.cta-card p {
  font-family: var(--font-primary);
  color: var(--color-white-70, rgba(255,255,255,0.70));
  margin: 0;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.btn-gallery-cta {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  font-size: 0.9rem;
  color: var(--bg-primary);
  background: var(--gradient-gold);
  border: none;
  box-shadow: var(--shadow-gold);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  position: relative;
  z-index: 1;
  letter-spacing: var(--ls-wide, 0.05em);
}

.btn-gallery-cta:hover {
  box-shadow: 0 8px 30px rgba(251,191,36,0.50);
  transform: translateY(-2px);
  color: var(--bg-primary);
}

/* ── GLIGHTBOX PREMIUM OVERRIDES ───────────────────────────── */
/* These only style the GLightbox modal — not any page section */
.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev {
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border-gold, rgba(251,191,36,0.3));
  border-radius: 50%;
}

.glightbox-clean .gclose svg,
.glightbox-clean .gnext svg,
.glightbox-clean .gprev svg {
  filter: invert(75%) sepia(50%) saturate(500%) hue-rotate(5deg) brightness(1.1);
}

.glightbox-clean .gclose:hover,
.glightbox-clean .gnext:hover,
.glightbox-clean .gprev:hover {
  background: var(--primary-gold, #fbbf24);
  border-color: var(--primary-gold, #fbbf24);
}

.glightbox-clean .gclose:hover svg,
.glightbox-clean .gnext:hover svg,
.glightbox-clean .gprev:hover svg {
  filter: invert(0%) brightness(0);
}

.glightbox-clean .gdesc-inner .gslide-title {
  font-family: var(--font-heading, serif);
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--white, #ffffff);
  margin-bottom: 0.25rem;
}

.glightbox-clean .gdesc-inner .gslide-desc {
  font-family: var(--font-primary, sans-serif);
  font-size: 0.85rem;
  color: var(--color-white-70, rgba(255,255,255,0.7));
}

.glightbox-clean .gslide-description {
  background: var(--bg-secondary, #1a1a2e);
  border-top: 1px solid var(--border-gold, rgba(251,191,36,0.25));
}

/* Counter pill */
.glightbox-clean .gbtn.gprev,
.glightbox-clean .gbtn.gnext {
  width: 44px;
  height: 44px;
}

/* ── LOADING GALLERY SKELETON ──────────────────────────────── */
#loading-gallery {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  gap: 1rem;
  color: var(--color-white-50, rgba(255,255,255,0.5));
  font-family: var(--font-primary);
  font-size: 0.88rem;
}

/* ── SCROLL REVEAL STAGGER ─────────────────────────────────── */
.gallery-item:nth-child(1)  { transition-delay: 0.05s; }
.gallery-item:nth-child(2)  { transition-delay: 0.10s; }
.gallery-item:nth-child(3)  { transition-delay: 0.15s; }
.gallery-item:nth-child(4)  { transition-delay: 0.20s; }
.gallery-item:nth-child(5)  { transition-delay: 0.25s; }
.gallery-item:nth-child(6)  { transition-delay: 0.30s; }
.gallery-item:nth-child(7)  { transition-delay: 0.35s; }
.gallery-item:nth-child(8)  { transition-delay: 0.40s; }
.gallery-item:nth-child(9)  { transition-delay: 0.45s; }
.gallery-item:nth-child(10) { transition-delay: 0.50s; }
.gallery-item:nth-child(n+11) { transition-delay: 0.55s; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1199px) {
  #gallery-container {
    grid-template-columns: repeat(3, 1fr);
  }
  .gallery-item.featured {
    grid-column: span 2;
  }
}

@media (max-width: 767px) {
  #gallery-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .gallery-item.featured {
    grid-column: span 2;
  }
  .gallery-item:not(.featured) .gallery-card img {
    height: 160px;
  }
  .gallery-item.featured .gallery-card img {
    height: 220px;
  }
  .cta-card {
    padding: 1.75rem 1.5rem;
  }
}

@media (max-width: 479px) {
  #gallery-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .gallery-item.featured {
    grid-column: span 2;
  }
  .gallery-item:not(.featured) .gallery-card img {
    height: 140px;
  }
  .gallery-item.featured .gallery-card img {
    height: 190px;
  }
}

/* ── REDUCED MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-card img,
  .gallery-item,
  .instagram-item,
  .instagram-item img {
    transition: none;
    animation: none;
  }
  .gallery-card.skeleton::before {
    animation: none;
  }
}
