/* =====================================================
   SUITO — GALLERY STYLESHEET
   File: client/css/gallery.css
===================================================== */

.gallery-section {
  padding: 200px 0 120px;
}

.gallery-header {
  text-align: center;
  margin-bottom: 64px;
}

/* Masonry-style grid using CSS grid with variable row spans */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 12px;
  gap: 18px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(160deg, #ecdfc7, #ddc9a6);
  border: 1px solid var(--border);
}

.gallery-item.size-sm { grid-row: span 20; }
.gallery-item.size-md { grid-row: span 26; }
.gallery-item.size-lg { grid-row: span 34; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.gallery-item:hover img { transform: scale(1.08); }

.gallery-item-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 16px;
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(42,10,18,0.72) 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  font-size: 0.82rem;
  color: var(--text);
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

.gallery-zoom-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(42,10,18,0.6);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.gallery-item:hover .gallery-zoom-icon { opacity: 1; transform: translateY(0); }
.gallery-zoom-icon svg { width: 15px; height: 15px; stroke: var(--text); }

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item.size-sm, .gallery-item.size-md, .gallery-item.size-lg { grid-row: span 26; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 6, 10, 0.94);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox-image-wrap {
  width: min(880px, 88vw);
  max-height: 82vh;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(160deg, #5c1622, #2a0a12);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.88);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
  position: relative;
}
.lightbox.is-open .lightbox-image-wrap { transform: scale(1); opacity: 1; }
.lightbox-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.lightbox-image-wrap span { color: var(--text-on-dark-muted); font-size: 0.9rem; }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-on-dark-strong);
  background: rgba(42,10,18,0.55);
  color: var(--text-on-dark);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  border-color: var(--accent-light);
  background: rgba(168, 50, 70, 0.22);
}

.lightbox-close { top: -60px; right: 0; }
.lightbox-prev { left: -66px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: -66px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

@media (max-width: 800px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 8px; right: 8px; }
}
