/* ==========================================================================
   GALLERY PAGE SPECIFIC STYLES
   Light Luxury Theme (#F9F8F6)
   ========================================================================== */

:root {
  --gal-bg: #F9F8F6;
  --gal-ink: #1A1A1A;
  --gal-gold: #C9A96E;
}

body.gallery-page {
  background-color: var(--gal-bg);
  color: var(--gal-ink);
}

/* ─────────────────────────────────────────────────
   HEADER OVERRIDES (Dark Text)
───────────────────────────────────────────────── */
.gal-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 40px clamp(24px, 5vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.gal-header .nav-group {
  mix-blend-mode: normal;
}

.gal-header .nav-link {
  color: var(--gal-ink);
}

.gal-header .nav-link::after {
  background: var(--gal-ink);
}

/* Active link styling */
.gallery-page .nav-link.active {
  color: var(--gal-ink);
}

/* ─────────────────────────────────────────────────
   HERO SECTION (50vh)
───────────────────────────────────────────────── */
#gal-hero {
  height: 50vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 clamp(24px, 5vw, 60px);
  padding-top: 100px; /* Offset for header */
}

.gal-hero-content {
  max-width: 900px;
}

.gal-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gal-gold);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(15px);
}

.gal-headline {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 84px);
  font-weight: 400;
  color: var(--gal-ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(25px);
}

/* ─────────────────────────────────────────────────
   STICKY FILTER BAR
───────────────────────────────────────────────── */
.gal-filter-bar {
  position: sticky;
  top: 62px; /* Height of the sticky navigation header */
  width: 100%;
  padding: 24px 0;
  background: rgba(249, 248, 246, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 90;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(26, 26, 26, 0.05);
}

.gal-filters {
  display: flex;
  gap: clamp(16px, 3vw, 48px);
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 24px;
}

.gal-filter-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.5);
  cursor: pointer;
  padding-bottom: 6px;
  position: relative;
  transition: color 0.3s ease;
}

.gal-filter-btn:hover {
  color: var(--gal-ink);
}

.gal-filter-btn.active {
  color: var(--gal-ink);
}

.gal-filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--gal-ink);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.gal-filter-btn.active::after {
  transform: scaleX(1);
}

/* ─────────────────────────────────────────────────
   THE BENTO GALLERY GRID 
───────────────────────────────────────────────── */
#gal-grid-section {
  padding: clamp(60px, 10vh, 120px) clamp(24px, 5vw, 60px);
  min-height: 100vh;
}

.gal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 320px;
  grid-auto-flow: dense; /* Fill in gaps */
  gap: 24px; /* Structured uniform gap */
}

/* Base Bento Item */
.gal-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background-color: #ededed;
   /* Prominent rounded corners */
  /* Scroll Entrance Initial State */
  opacity: 0;
  transform: translateY(40px);
}

/* Bento Sizes (Spanning columns and rows) */
.gal-item.portrait {
  grid-column: span 1;
  grid-row: span 2;
}

.gal-item.square {
  grid-column: span 1;
  grid-row: span 1;
}

.gal-item.landscape {
  grid-column: span 2;
  grid-row: span 1;
}

.gal-item.wide {
  grid-column: span 3;
  grid-row: span 1;
}

.gal-grid.gal-grid--aurora {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
}

.gal-grid.gal-grid--aurora .gal-item[data-category="eivaa-aurora"] {
  grid-column: span 1;
  grid-row: span 1;
  aspect-ratio: 1 / 1;
}

/* Responsive Grid adjustment */
@media (max-width: 1024px) {
  .gal-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 250px;
  }
  .gal-grid.gal-grid--aurora {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }
}

@media (max-width: 600px) {
  .gal-grid { 
    grid-template-columns: repeat(1, 1fr); 
    grid-auto-rows: 300px;
  }
  .gal-grid.gal-grid--aurora {
    grid-template-columns: repeat(1, 1fr);
    grid-auto-rows: auto;
  }
  .gal-item { 
    grid-column: span 1 !important; 
    grid-row: span 1 !important; /* Stack vertically on mobile */
  }
  .gal-item.portrait {
    grid-row: span 2 !important; /* Keep portrait tall on mobile */
  }
  .gal-grid.gal-grid--aurora .gal-item[data-category="eivaa-aurora"] {
    aspect-ratio: 1 / 1;
  }
}

/* Image Wrapper and Parallax Setup */
.gal-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Slow cubic ease for scale down effect */
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gal-img {
  width: 100%;
  height: 115%; /* Extra height for inner parallax */
  object-fit: cover;
  transform: translateY(-7.5%); /* Center the starting point */
  will-change: transform;
  display: block;
}

/* ─────────────────────────────────────────────────
   HOVER STATE (Image Card)
───────────────────────────────────────────────── */
.gal-img-wrap:hover {
  transform: scale(0.98);
}

.gal-hover-overlay {
  position: absolute;
  inset: 0;
  /* Subtle warm gradient overlay */
  background: linear-gradient(
    to top,
    rgba(26, 26, 26, 0.6) 0%,
    rgba(26, 26, 26, 0.1) 40%,
    rgba(26, 26, 26, 0) 100%
  );
  opacity: 0;
  transition: opacity 0.6s ease;
}

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

.gal-desc {
  position: absolute;
  bottom: 30px;
  left: 30px;
  right: 30px;
  font-family: var(--font-body);
  font-size: clamp(14px, 1.2vw, 18px);
  color: #fff;
  font-weight: 300;
  margin: 0;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.gal-img-wrap:hover .gal-desc {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────────────────────────
   LUXURY LIGHTBOX MODAL
───────────────────────────────────────────────── */
.gal-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.gal-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gal-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(249, 248, 246, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: -1;
}

/* Top bar (Close) */
.gal-modal-top {
  display: flex;
  justify-content: flex-end;
  padding: 40px clamp(24px, 5vw, 60px);
}

.gal-modal-close {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  font-weight: 400;
  color: var(--gal-ink);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gal-close-line {
  width: 1px;
  height: 24px;
  background: var(--gal-ink);
  transition: height 0.4s ease;
}

.gal-modal-close:hover .gal-close-line {
  height: 36px;
}

/* Center Image Area */
.gal-modal-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 40px);
  overflow: hidden;
}

/* Nav arrows spanning the height */
.gal-nav-area {
  width: 10vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(26, 26, 26, 0.3);
  transition: color 0.4s ease;
}

.gal-nav-area:hover {
  color: var(--gal-ink);
}

.gal-nav-arrow {
  width: 40px;
  height: 40px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gal-prev:hover .gal-nav-arrow {
  transform: scaleX(1.5) translateX(-10px);
}

.gal-next:hover .gal-nav-arrow {
  transform: scaleX(1.5) translateX(10px);
}

/* Image Container */
.gal-modal-img-container {
  flex: 1;
  height: 80vh; /* restrict height */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* important for sliding */
  position: relative;
}

.gal-modal-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* Will be animated by JS */
  will-change: transform, opacity;
}

/* Bottom bar */
.gal-modal-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  gap: 12px;
}

.gal-modal-counter {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--gal-ink);
  margin: 0;
}

.gal-modal-caption {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: rgba(26, 26, 26, 0.6);
  margin: 0;
}

/* ─────────────────────────────────────────────────
   FOOTER (Re-coloring light elements to match Light Theme)
───────────────────────────────────────────────── */
.gallery-page #site-footer {
  background: var(--gal-bg);
  color: var(--gal-ink);
  border-top: 1px solid rgba(26, 26, 26, 0.1);
}
.gallery-page .ft-col-label,
.gallery-page .ft-col-subtext,
.gallery-page .ft-nav-list a,
.gallery-page .ft-form input {
  color: var(--gal-ink);
}
.gallery-page .ft-form input {
  border-bottom: 1px solid rgba(26, 26, 26, 0.2);
}
.gallery-page .ft-form input::placeholder {
  color: rgba(26, 26, 26, 0.4);
}
.gallery-page .ft-form input:focus {
  border-bottom-color: var(--gal-gold);
}
.gallery-page .ft-submit {
  color: var(--gal-ink);
}
.gallery-page .ft-submit-line {
  background: var(--gal-ink);
}
.gallery-page .ft-divider {
  background: rgba(26, 26, 26, 0.1);
}

.gallery-page .ft-legal {
  color: rgba(26, 26, 26, 0.5);
}
