/* ================================================
   IL GUSTO RISTOBAR — Galerie (galerie.css)
   ================================================ */

/* ------------------------------------------------
   Gallery Category Title
   ------------------------------------------------ */
.gallery-category {
  margin-bottom: 3rem;
}

.gallery-category-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-style: italic;
  color: var(--color-cream);
  margin-bottom: 0.4rem;
}

.gallery-category-title::after {
  content: '';
  display: block;
  width: 36px;
  height: 1px;
  background: var(--color-gold);
  margin-top: 0.6rem;
}

.gallery-category-subtitle {
  font-size: 0.83rem;
  color: var(--color-cream-dim);
  margin-bottom: 1.5rem;
}

/* ------------------------------------------------
   Gallery Grid
   ------------------------------------------------ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.85rem;
}

/* ------------------------------------------------
   Gallery Item
   ------------------------------------------------ */
.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  background: var(--color-bg-card);
  border-radius: var(--radius);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.07);
  filter: brightness(1.08);
}

/* Gold overlay on hover */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(201, 168, 76, 0.0);
  display: grid;
  place-items: center;
  transition: background 0.35s ease;
}

.gallery-item:hover .gallery-item-overlay {
  background: rgba(201, 168, 76, 0.15);
}

.gallery-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(245, 240, 232, 0.7);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover .gallery-item-icon {
  opacity: 1;
  transform: scale(1);
}

.gallery-item-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-cream);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  font-size: 0.78rem;
  color: var(--color-cream);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------
   Section gap
   ------------------------------------------------ */
.gallery-section {
  padding-block: var(--section-pad);
}

.gallery-section .gallery-category + .gallery-category {
  margin-top: 4rem;
  padding-top: 4rem;
  border-top: 1px solid var(--color-border);
}

/* ------------------------------------------------
   Lightbox
   ------------------------------------------------ */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 1999;
  display: none;
  transition: background 0.3s ease;
}

.lightbox-backdrop.is-visible {
  display: block;
  background: rgba(0, 0, 0, 0.93);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.lightbox-figure {
  position: relative;
  max-width: min(90vw, 1200px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: scaleIn 0.3s ease;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}

.lightbox-figure figcaption {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--color-cream-dim);
  letter-spacing: 0.06em;
  text-align: center;
}

/* Close button */
.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2001;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--color-cream);
  font-size: 1.5rem;
  line-height: 1;
  transition: background var(--transition), transform var(--transition);
  backdrop-filter: blur(8px);
}

.lightbox-close:hover {
  background: rgba(201, 168, 76, 0.3);
  transform: scale(1.1);
}

/* Prev / Next */
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2001;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: var(--color-cream);
  font-size: 1.75rem;
  line-height: 1;
  transition: background var(--transition), transform var(--transition);
  backdrop-filter: blur(8px);
}

.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(201, 168, 76, 0.25);
}

.lightbox-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(2px); }

/* Counter */
.lightbox-counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: rgba(245, 240, 232, 0.5);
  letter-spacing: 0.15em;
  z-index: 2001;
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */
@media (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
  }

  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }

  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }
}
