/* ============================================================
   CHIANTI VINTAGE EXPEDITIONS — Gallery Page Styles
   css/pages/gallery.css
   ============================================================ */

/* ── Gallery Grid ─────────────────────────────────────────── */
.gallery-section .section-header--center {
  margin-bottom: var(--space-12);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
}

.gallery-item {
  overflow: hidden;
  position: relative;
  aspect-ratio: 1 / 1;
  background: #2a1f18;
}

.gallery-item--wide {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

.gallery-item--tall {
  grid-row: span 2;
  aspect-ratio: auto;
}

@media (max-width: 767px) {
  .gallery-item--wide  { grid-column: span 1; aspect-ratio: 1/1; }
  .gallery-item--tall  { grid-row: span 1; }
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease, opacity 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a1f18 0%, #3d2e24 100%);
  color: rgba(201, 160, 82, 0.35);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Hover overlay */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(28, 23, 20, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  background: rgba(28, 23, 20, 0.25);
}

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.is-open {
  display: flex;
}

.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 8, 0.93);
  cursor: pointer;
}

.lightbox__content {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 8px 64px rgba(0,0,0,0.6);
}

.lightbox__caption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-base);
  color: rgba(245, 240, 232, 0.6);
  text-align: center;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: fixed;
  background: rgba(28, 23, 20, 0.7);
  border: 1px solid rgba(201, 160, 82, 0.3);
  color: var(--color-cream);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  line-height: 1;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: var(--color-gold);
  color: var(--color-black);
  border-color: var(--color-gold);
}

.lightbox__close {
  top: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  font-size: var(--text-2xl);
}

.lightbox__prev {
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
}

.lightbox__next {
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
}

@media (min-width: 768px) {
  .lightbox__prev { left: var(--space-8); }
  .lightbox__next { right: var(--space-8); }
}
