/* ============================================================
   company-gallery.css — Finwin Travels
   Destination-grouped editorial gallery — v3.1
   All values reference main.css variables only.
   NO hardcoded colors, fonts, or spacing.
   NO hero section overrides — hero is handled by template.
   v3.1: removed legacy amber (#fbbf24-style) literals left over from
   the pre-v4.0 palette; all gold tones now build from --color-gold-rgb.
   Fixed GLightbox slide description panel (white text on the light
   --bg-secondary panel was unreadable) to use --text-primary /
   --text-secondary, matching the site's ivory/dark-text theme.
   ============================================================ */

/* ── 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: var(--spacing-4);
  transition: opacity 0.6s ease;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(var(--color-gold-rgb), 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);
  text-transform: uppercase;
}

/* ── FILTER BUTTONS (hero section — destinations) ──────────── */
.filter-buttons {
  display: flex;
  gap: var(--spacing-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--spacing-6);
}

.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.05));
  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-count {
  opacity: 0.65;
  font-size: 0.75em;
}

.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);
  height: 2px;
  background: var(--gradient-gold);
  border-radius: var(--radius-full, 100px);
  margin: var(--spacing-3) auto 0;
}

/* ── GALLERY SECTION ───────────────────────────────────────── */
.gallery-main {
  background: var(--bg-primary);
  padding-top: var(--spacing-12);
  padding-bottom: var(--spacing-16);
}

/* Section header */
.gallery-section-header {
  text-align: center;
  margin-bottom: var(--spacing-10);
}

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

.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: var(--spacing-2);
}

.gallery-section-sub {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

.gallery-count-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  color: var(--primary-gold);
  background: var(--color-gold-bg, rgba(var(--color-gold-rgb), 0.06));
  border: 1px solid var(--border-gold, rgba(var(--color-gold-rgb), 0.25));
  border-radius: var(--radius-full, 100px);
  padding: 0.25rem 0.85rem;
  margin-top: var(--spacing-3);
}

/* ── GALLERY CONTAINER (holds destination sections) ────────── */
#gallery-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-16);
}

/* ── DESTINATION SECTION ───────────────────────────────────── */
.gallery-destination-section {
  border-top: 1px solid var(--color-white-10, rgba(255,255,255,0.08));
  padding-top: var(--spacing-10);
}

.gallery-destination-section:first-child {
  border-top: none;
  padding-top: 0;
}

.gallery-destination-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-8);
  padding-bottom: var(--spacing-4);
  border-bottom: 1px solid var(--border-gold, rgba(var(--color-gold-rgb), 0.18));
}

.gallery-destination-name {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: 0;
}

.gallery-destination-tagline {
  font-family: var(--font-primary);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  flex: 1 1 auto;
}

.gallery-destination-count {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--primary-gold);
  white-space: nowrap;
}

/* ── ACTIVITY GROUP (within a destination) ─────────────────── */
.gallery-activity-group {
  margin-bottom: var(--spacing-10);
}

.gallery-activity-group:last-child {
  margin-bottom: 0;
}

.gallery-activity-heading {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-4);
}

.gallery-activity-heading i {
  font-size: 0.4rem;
  color: var(--primary-gold);
}

/* ── ACTIVITY GRID ──────────────────────────────────────────── */
.gallery-activity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-6);
  align-items: start;
}

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

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

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

/* ── GALLERY CARD (image only — caption lives outside) ─────── */
.gallery-card {
  position: relative;
  border-radius: var(--radius-lg);
  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);
}

.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);
}

/* Zoom icon */
.gallery-zoom-icon {
  position: absolute;
  top: var(--spacing-3);
  right: var(--spacing-3);
  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: var(--spacing-3);
  left: var(--spacing-3);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--ls-wider);
  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;
}

/* ── ALWAYS-VISIBLE CAPTION (sits below the image, not a hover overlay) ── */
.gallery-caption {
  padding: var(--spacing-3) var(--spacing-1) 0;
}

.gallery-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: var(--leading-snug);
}

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

.gallery-description {
  font-family: var(--font-primary);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: var(--leading-normal);
}

/* ── GALLERY EMPTY STATE ───────────────────────────────────── */
.gallery-empty {
  text-align: center;
  padding: var(--spacing-16) var(--spacing-8);
  color: var(--text-secondary);
  font-family: var(--font-primary);
}

.gallery-empty i {
  font-size: 2.5rem;
  color: var(--primary-gold);
  margin-bottom: var(--spacing-4);
  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;
}

.gallery-destination-section.hiding {
  opacity: 0;
}

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

.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(var(--color-gold-rgb), 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: var(--spacing-8);
}

.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);
}

.instagram-intro {
  font-family: var(--font-primary);
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: var(--spacing-2) auto var(--spacing-5);
  line-height: var(--leading-relaxed);
}

.social-handle-divider {
  margin: 0 var(--spacing-2);
  opacity: 0.5;
}

.gallery-social-links {
  display: flex;
  gap: var(--spacing-3);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-gallery-instagram,
.btn-gallery-facebook {
  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);
}

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

.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(var(--color-gold-rgb), 0.25) 0%,
    rgba(var(--color-navy-rgb), 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: var(--bg-overlay-light);
  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: var(--spacing-16) 0;
}

.cta-card {
  background: var(--gradient-luxury);
  border-radius: var(--radius-xl);
  padding: var(--spacing-10) var(--spacing-12);
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 40px solid rgba(var(--color-gold-rgb), 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(var(--color-gold-rgb), 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: var(--spacing-2);
  line-height: var(--leading-tight);
  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);
}

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

/* ── GLIGHTBOX PREMIUM OVERRIDES ───────────────────────────── */
.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev {
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold, rgba(var(--color-gold-rgb), 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);
  border-color: var(--primary-gold);
}

.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);
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.glightbox-clean .gdesc-inner .gslide-desc {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.glightbox-clean .gslide-description {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-gold, rgba(var(--color-gold-rgb), 0.25));
}

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

/* ── LOADING GALLERY SKELETON ──────────────────────────────── */
#loading-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-16) 0;
  gap: var(--spacing-4);
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.88rem;
}
.gallery-error-icon {
  color: var(--primary-gold);
  font-size: 2rem;
  margin-bottom: var(--spacing-3);
  display: block;
}
.gallery-error-text {
  color: var(--text-secondary);
  font-family: var(--font-primary);
}

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

@media (max-width: 767px) {
  .gallery-activity-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
  }
  .gallery-item.featured {
    grid-column: span 2;
  }
  .gallery-item:not(.featured) .gallery-card img {
    height: 160px;
  }
  .gallery-item.featured .gallery-card img {
    height: 220px;
  }
  .gallery-destination-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-1);
  }
  .cta-card {
    padding: var(--spacing-7) var(--spacing-6);
  }
}

@media (max-width: 479px) {
  .gallery-activity-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-3);
  }
  .gallery-item.featured {
    grid-column: span 2;
  }
  .gallery-item:not(.featured) .gallery-card img {
    height: 140px;
  }
  .gallery-item.featured .gallery-card img {
    height: 190px;
  }
  .gallery-title {
    font-size: 0.85rem;
  }
  .gallery-description {
    font-size: 0.75rem;
  }
}

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