/* ============================================================
   gallery.css — Gallery Page Dedicated Stylesheet
   Loaded AFTER style.css to ensure all rules take priority.
   Overrides conflicting .gallery-grid from home page slide.
============================================================ */

/* ── Reset any home-page gallery-grid rules ── */
#gallery-grid-section .gallery-grid {
  position: relative !important;
  inset: auto !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  grid-template-rows: none !important;
  grid-auto-rows: 260px !important;
  gap: 0.75rem !important;
  width: 100%;
  height: auto !important;
}

/* ── Grid items ── */
#gallery-grid-section .g-item {
  position: relative !important;
  overflow: hidden !important;
  cursor: pointer;
  background: #1a3a1d;
  height: 100%;
}

#gallery-grid-section .g-item.span-2w { grid-column: span 2 !important; }
#gallery-grid-section .g-item.span-2h { grid-row: span 2 !important; }
#gallery-grid-section .g-item.span-2b { grid-column: span 2 !important; grid-row: span 2 !important; }
#gallery-grid-section .g-item.hidden  { display: none !important; }

#gallery-grid-section .g-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  filter: brightness(0.9) saturate(0.95);
  transition: transform 0.7s ease, filter 0.7s ease;
}

#gallery-grid-section .g-item:hover img {
  transform: scale(1.07);
  filter: brightness(0.65) saturate(1.1);
}

/* ── Item overlays ── */
#gallery-grid-section .g-overlay {
  position: absolute !important;
  inset: 0;
  background: linear-gradient(to top, rgba(10,26,12,0.92) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.35s;
  display: flex !important;
  align-items: flex-end;
  z-index: 2;
}
#gallery-grid-section .g-item:hover .g-overlay { opacity: 1; }
#gallery-grid-section .g-overlay-content { padding: 1rem 1.2rem; }
#gallery-grid-section .g-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 700;
  color: #fdfaf4; line-height: 1.3;
}

/* ── Expand icon ── */
#gallery-grid-section .g-expand {
  position: absolute !important;
  top: 0.8rem; right: 0.8rem;
  width: 32px; height: 32px;
  background: rgba(10,26,12,0.75);
  border: 1px solid rgba(201,168,76,0.35);
  color: #c9a84c; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s;
  z-index: 3;
}
#gallery-grid-section .g-item:hover .g-expand { opacity: 1; }

/* ── Hide view toggle ── */
.view-toggle { display: none !important; }

/* ── Section wrapper ── */
#gallery-grid-section {
  position: relative;
  padding: 80px 0 100px;
  background: #0a1a0c;
  overflow: visible;
  z-index: 1;
}

.gallery-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem;
  position: relative;
  z-index: 2;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  #gallery-grid-section .gallery-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    grid-auto-rows: 240px !important;
  }
}

@media (max-width: 768px) {
  #gallery-grid-section .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: 200px !important;
  }
  #gallery-grid-section .g-item.span-2b {
    grid-column: span 2 !important;
    grid-row: span 1 !important;
  }
  .gallery-inner { padding: 0 1.2rem; }
  #gallery-grid-section { padding: 60px 0 80px; }
}

@media (max-width: 480px) {
  #gallery-grid-section .gallery-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: 220px !important;
  }
  #gallery-grid-section .g-item.span-2w,
  #gallery-grid-section .g-item.span-2b {
    grid-column: span 1 !important;
  }
}
