/* ============================================================
   Takaful-hibah.com — gallery.css
   Gallery page styles: Hero · Filters · Masonry · Lightbox
   ============================================================ */


/* ── GALLERY HERO ───────────────────────────────────────── */
.gal-hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 80px;
  overflow: hidden;
  background: var(--navy);
  text-align: center;
}

.gal-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 15% 20%, rgba(201,168,76,0.13) 0%, transparent 70%),
    radial-gradient(ellipse 55% 55% at 85% 80%, rgba(13,27,42,0.85) 0%, transparent 65%),
    linear-gradient(160deg, #0d1b2a 0%, #112135 45%, #0d1b2a 100%);
}

.gal-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.gal-hero-inner {
  position: relative;
  z-index: 2;
}

.gal-hero-inner .section-label {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 100px;
  padding: 6px 18px;
  background: rgba(201,168,76,0.07);
}

.gal-hero-inner h1 {
  margin-bottom: 18px;
  color: var(--white);
}

.gal-hero-sub {
  max-width: 560px;
  margin: 0 auto 44px;
  color: var(--body);
  font-size: 1.02rem;
  line-height: 1.75;
}

/* Hero stats row */
.gal-hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--navy-bdr);
  border-radius: 16px;
  padding: 22px 40px;
  max-width: 600px;
  margin: 0 auto;
  backdrop-filter: blur(6px);
}

.gal-hero-stat {
  flex: 1;
  text-align: center;
}

.gal-hero-stat strong {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.gal-hero-stat span {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.gal-hero-divider {
  width: 1px;
  height: 40px;
  background: var(--navy-bdr);
  flex-shrink: 0;
  margin: 0 24px;
}


/* ── FILTER PILLS ───────────────────────────────────────── */
.gal-section {
  background: var(--navy);
  padding-top: 56px;
}

.gal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 48px;
}

.gal-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--tx);
  font-family: inherit;
}

.gal-filter:hover {
  border-color: rgba(201,168,76,0.4);
  color: var(--gold-lt);
  background: rgba(201,168,76,0.07);
}

.gal-filter.active {
  border-color: var(--gold);
  background: rgba(201,168,76,0.14);
  color: var(--gold);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.08);
}

.gf-icon {
  font-size: 1rem;
}


/* ── MASONRY GRID ───────────────────────────────────────── */
.gal-masonry {
  columns: 3;
  column-gap: 18px;
}

.gal-item {
  break-inside: avoid;
  margin-bottom: 18px;
  border-radius: 14px;
  overflow: hidden;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.gal-item.hidden {
  display: none;
}

.gal-item-tall .gal-img-wrap img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* Image wrapper */
.gal-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  cursor: pointer;
  background: var(--navy2);
  display: block;
}

.gal-img-wrap img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.55s var(--ease);
}

.gal-img-wrap:hover img {
  transform: scale(1.06);
}


/* ── HOVER OVERLAY ──────────────────────────────────────── */
.gal-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10,18,30,0.97) 0%,
    rgba(10,18,30,0.65) 45%,
    rgba(10,18,30,0.1) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.gal-img-wrap:hover .gal-overlay,
.gal-img-wrap:focus-within .gal-overlay {
  opacity: 1;
}

/* Category badge inside overlay */
.gal-cat-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 100px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.gal-badge-pelanggan {
  background: rgba(201,168,76,0.18);
  border: 1px solid rgba(201,168,76,0.4);
  color: var(--gold-lt);
}

.gal-badge-ejen {
  background: rgba(30,100,220,0.2);
  border: 1px solid rgba(80,140,255,0.35);
  color: #8ab4ff;
}

.gal-badge-pencapaian {
  background: rgba(29,185,84,0.15);
  border: 1px solid rgba(29,185,84,0.35);
  color: #4de08a;
}

/* Caption text */
.gal-caption {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gal-cap-text {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.88);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gal-cap-loc {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}


/* ── PLACEHOLDER CARDS ──────────────────────────────────── */
.gal-placeholder-wrap {
  cursor: default;
}

.gal-placeholder-wrap:hover img {
  transform: none;
}

.gal-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--navy2) 0%, var(--navy3) 100%);
  border: 1.5px dashed rgba(255,255,255,0.1);
  border-radius: 14px;
  text-align: center;
  padding: 24px;
}

.gal-placeholder p {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}

.gal-placeholder span {
  font-size: 0.75rem;
  color: var(--muted);
}

.gal-ph-icon {
  font-size: 2rem;
  line-height: 1;
}

/* Gold variant for achievements */
.gal-placeholder-gold {
  background: linear-gradient(135deg, rgba(201,168,76,0.08) 0%, rgba(201,168,76,0.04) 100%);
  border-color: rgba(201,168,76,0.2);
}

.gal-placeholder-gold .gal-ph-icon { filter: drop-shadow(0 0 8px rgba(201,168,76,0.5)); }
.gal-placeholder-gold p { color: var(--gold-lt); }

/* Tall placeholder */
.gal-item-tall .gal-placeholder,
.gal-item-tall .gal-placeholder-wrap .gal-placeholder {
  aspect-ratio: 3 / 4;
}


/* ── UPLOAD NOTE ────────────────────────────────────────── */
.gal-upload-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 52px;
  padding: 20px 28px;
  border-radius: 14px;
  border: 1px solid rgba(201,168,76,0.15);
  background: rgba(201,168,76,0.04);
}

.gal-upload-note span {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.gal-upload-note p {
  font-size: 0.87rem;
  color: var(--muted);
  margin: 0;
}


/* ── LIGHTBOX ───────────────────────────────────────────── */
.gal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.gal-lightbox.lb-open {
  opacity: 1;
  pointer-events: auto;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,10,18,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lb-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(820px, 90vw);
  width: 100%;
  gap: 18px;
}

.lb-img-wrap {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7);
  background: var(--navy2);
}

.lb-img-wrap img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.lb-info {
  text-align: center;
  padding: 0 16px;
}

.lb-cap-text {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.65;
  margin: 0 0 6px;
}

.lb-cap-loc {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Close button */
.lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--tx);
  font-family: inherit;
}

.lb-close:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

/* Prev / Next buttons */
.lb-prev,
.lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--tx);
  font-family: inherit;
}

.lb-prev { left: 20px; }
.lb-next { right: 20px; }

.lb-prev:hover,
.lb-next:hover {
  background: rgba(201,168,76,0.2);
  border-color: rgba(201,168,76,0.4);
  color: var(--gold);
}

.lb-prev:active,
.lb-next:active {
  transform: translateY(-50%) scale(0.95);
}


/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .gal-masonry {
    columns: 2;
  }
}

@media (max-width: 640px) {
  .gal-hero {
    padding: calc(var(--nav-h) + 48px) 0 56px;
  }

  .gal-hero-stats {
    padding: 18px 24px;
    gap: 0;
  }

  .gal-hero-divider {
    margin: 0 14px;
  }

  .gal-filters {
    gap: 8px;
    margin-bottom: 32px;
  }

  .gal-filter {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  .gal-masonry {
    columns: 1;
  }

  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }

  .lb-prev,
  .lb-next {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }

  .lb-content {
    max-width: 95vw;
  }

  .lb-img-wrap img {
    max-height: 60vh;
  }
}
