/* ============================================================
   GALLERY PAGE — Cinematic Luxury (extends styles.css)
   ============================================================ */

/* ===================== NAV OVERRIDE (always solid on gallery page) ===================== */

.nav-gallery {
  background: rgba(248, 245, 240, 0.85);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

/* ===================== GALLERY HERO ===================== */

.gal-hero {
  position: relative;
  min-height: 70vh;
  padding: 160px var(--pad) 80px;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.gal-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.gal-hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(217, 190, 133, 0.5), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(200, 169, 107, 0.25), transparent 60%),
    linear-gradient(180deg, var(--cream-warm) 0%, var(--cream) 100%);
}
.gal-hero-orb {
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: var(--sage);
  filter: blur(110px);
  opacity: 0.35;
  top: -120px; right: -120px;
  animation: orbDrift 22s ease-in-out infinite;
}

.gal-hero-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.gal-hero-title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--forest);
  margin-bottom: 28px;
  max-width: 14ch;
}
.gal-hero-title .italic {
  font-style: italic;
  font-weight: 400;
  color: var(--sage);
}

.gal-hero-sub {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--ink-soft);
  max-width: 580px;
  line-height: 1.65;
}

.gal-scroll-hint {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  animation: scrollHint 2.5s ease-in-out infinite;
}
@keyframes scrollHint {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
  50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* ===================== CATEGORY TABS ===================== */

.gal-tabs-wrap {
  position: sticky;
  top: 70px;
  z-index: 50;
  background: rgba(248, 245, 240, 0.92);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid rgba(17, 17, 17, 0.06);
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}
.gal-tabs-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--pad);
}
.gal-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding-bottom: 2px;
}
.gal-tabs::-webkit-scrollbar { display: none; }

.gal-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
  font-family: var(--f-sans);
}
.gal-tab:hover {
  background: rgba(217, 190, 133, 0.25);
  color: var(--forest);
}
.gal-tab.active {
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
  box-shadow: 0 6px 16px -6px rgba(17, 17, 17, 0.4);
}
.gal-tab .tab-num {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 11px;
  opacity: 0.6;
}
.gal-tab.active .tab-num {
  color: var(--olive);
  opacity: 0.9;
}

/* ===================== GALLERY SECTION ===================== */

.gal-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px var(--pad) 100px;
}

.gal-meta {
  margin-bottom: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(12px);
  animation: metaIn 0.6s var(--ease-out) forwards;
}
@keyframes metaIn {
  to { opacity: 1; transform: translateY(0); }
}
.gal-meta-left { flex: 1; min-width: 280px; }
.gal-meta-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
}
.gal-meta-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage);
}
.gal-meta-title {
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--forest);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.gal-meta-title .italic {
  font-style: italic;
  color: var(--sage);
}
.gal-meta-desc {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 560px;
}
.gal-meta-count {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
}
.gal-meta-count strong {
  font-family: var(--f-display);
  font-style: normal;
  font-weight: 500;
  color: var(--forest);
  font-size: 18px;
  margin-right: 4px;
}

/* ----------- Masonry grid (CSS columns) ----------- */

.gal-masonry {
  column-count: 3;
  column-gap: 16px;
}

.gal-item {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream-warm);
  cursor: zoom-in;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  opacity: 0;
  transform: translateY(20px);
  animation: itemIn 0.7s var(--ease-out) forwards;
  display: block;
}
@keyframes itemIn {
  to { opacity: 1; transform: translateY(0); }
}

.gal-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -18px rgba(17, 17, 17, 0.4);
}

.gal-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 1s var(--ease);
}
.gal-item:hover img {
  transform: scale(1.04);
}

/* Hover overlay */
.gal-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(17, 17, 17, 0.5) 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.gal-item:hover::after { opacity: 1; }

.gal-item-tag {
  position: absolute;
  bottom: 14px; left: 14px;
  padding: 6px 12px;
  background: rgba(248, 245, 240, 0.95);
  backdrop-filter: blur(10px);
  color: var(--forest);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s var(--ease);
  z-index: 2;
}
.gal-item:hover .gal-item-tag {
  opacity: 1;
  transform: translateY(0);
}

.gal-item-zoom {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(248, 245, 240, 0.95);
  backdrop-filter: blur(10px);
  color: var(--forest);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.4s var(--ease);
  z-index: 2;
}
.gal-item:hover .gal-item-zoom {
  opacity: 1;
  transform: scale(1);
}

/* Empty state (no images in folder yet) */
.gal-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  background: var(--cream-warm);
  border: 1.5px dashed rgba(17, 17, 17, 0.15);
  border-radius: var(--radius-lg);
  column-span: all;
  -webkit-column-span: all;
}
.gal-empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  background: var(--olive);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--forest);
}
.gal-empty h4 {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--forest);
  margin-bottom: 8px;
}
.gal-empty p {
  font-size: 14px;
  color: var(--muted);
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.6;
}

/* CTA block */
.gal-cta {
  margin-top: 80px;
  padding: 60px clamp(28px, 5vw, 60px);
  background: var(--forest);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.gal-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(200, 169, 107, 0.35), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(42, 42, 42, 0.4), transparent 50%);
}
.gal-cta h3 {
  position: relative;
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  color: var(--cream);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.gal-cta p {
  position: relative;
  font-size: 16px;
  color: var(--olive);
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.gal-cta .btn {
  position: relative;
  background: var(--cream);
  color: var(--forest);
}
.gal-cta .btn:hover {
  background: var(--olive);
  box-shadow: 0 16px 32px -10px rgba(200, 169, 107, 0.5);
}

/* ===================== LIGHTBOX ===================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.open {
  display: flex;
  animation: lbFade 0.35s var(--ease);
}
@keyframes lbFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-stage {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-stage img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 40px 80px -10px rgba(0, 0, 0, 0.6);
  animation: lbZoom 0.45s var(--ease-out);
}
@keyframes lbZoom {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.lb-close {
  position: absolute;
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(248, 245, 240, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(248, 245, 240, 0.18);
  color: var(--cream);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  z-index: 10;
}
.lb-close:hover {
  background: var(--cream);
  color: var(--forest);
  transform: rotate(90deg);
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(248, 245, 240, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(248, 245, 240, 0.18);
  color: var(--cream);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  z-index: 10;
}
.lb-nav:hover {
  background: var(--cream);
  color: var(--forest);
}
.lb-prev { left: 24px; }
.lb-next { right: 24px; }

.lb-info {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(248, 245, 240, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(248, 245, 240, 0.14);
  border-radius: 999px;
  color: var(--cream);
}
.lb-cat {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--olive);
}
.lb-counter {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  color: rgba(248, 245, 240, 0.8);
  padding-left: 16px;
  border-left: 1px solid rgba(248, 245, 240, 0.2);
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 1024px) {
  .gal-masonry { column-count: 2; }
}

@media (max-width: 768px) {
  .gal-hero {
    min-height: 56vh;
    padding: 130px var(--pad) 60px;
  }
  .gal-scroll-hint { display: none; }

  .gal-tabs-wrap {
    top: 64px;
  }
  .gal-tabs-inner {
    padding: 14px var(--pad);
  }
  .gal-tab {
    padding: 9px 16px;
    font-size: 12.5px;
  }
  .gal-tab .tab-num { display: none; }

  .gal-section { padding: 40px var(--pad) 70px; }
  .gal-masonry { column-count: 2; column-gap: 12px; }
  .gal-item { margin-bottom: 12px; border-radius: 12px; }
  .gal-item-tag { font-size: 9px; padding: 5px 10px; }
  .gal-item-zoom { width: 32px; height: 32px; }

  .gal-meta { margin-bottom: 28px; }

  .gal-cta {
    margin-top: 60px;
    padding: 50px 28px;
  }

  .lightbox { padding: 20px; }
  .lb-close { top: 16px; right: 16px; width: 40px; height: 40px; }
  .lb-nav { width: 42px; height: 42px; }
  .lb-prev { left: 12px; }
  .lb-next { right: 12px; }
  .lb-info {
    bottom: 16px;
    padding: 8px 16px;
    gap: 12px;
  }
  .lb-cat { font-size: 10px; }
  .lb-counter { font-size: 13px; padding-left: 12px; }
}

@media (max-width: 480px) {
  .gal-masonry { column-count: 1; }
  .gal-item { margin-bottom: 14px; }
}
