/* ============================================
   CASA DE LUCA — Gallery Page
   Swiper carousels, hover effects
   ============================================ */

.gallery-main {
  padding-top: var(--header-height);
}

.gallery-intro {
  position: relative;
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 2px solid var(--accent-secondary);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 400px;
  display: flex;
  align-items: center;
}

.gallery-intro-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(155, 76, 110, 0.65) 0%, rgba(155, 76, 110, 0.75) 100%);
  pointer-events: none;
}

.gallery-intro .container {
  position: relative;
  z-index: 1;
}

.gallery-intro .section-heading,
.gallery-intro h1,
.gallery-intro .lead {
  color: var(--white);
}

.gallery-intro .lead {
  margin-top: var(--space-sm);
}

.gallery-section {
  padding: var(--space-2xl) 0;
  border-bottom: 1px solid var(--border);
}

.gallery-section:last-of-type {
  border-bottom: none;
}

.gallery-section h2 {
  margin-bottom: var(--space-lg);
}

.gallery-section-header {
  margin-bottom: var(--space-2xl);
}

.section-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 65ch;
  margin-top: var(--space-sm);
}

/* --- Swiper overrides --- */
.gallery-swiper {
  overflow: hidden;
  padding: var(--space-sm) 0;
}

.gallery-swiper .swiper-wrapper {
  align-items: stretch;
}

.gallery-swiper .swiper-slide {
  height: auto;
}

.slide-inner {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--border);
}

.slide-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.5s var(--ease);
}

/* Grayscale → color on hover */
.slide-inner img {
  filter: grayscale(0.3);
}

.slide-inner:hover img {
  transform: scale(1.05);
  filter: grayscale(0);
}

.gallery-swiper .swiper-button-prev,
.gallery-swiper .swiper-button-next {
  color: var(--text);
  --swiper-navigation-size: 28px;
}

.gallery-swiper .swiper-button-prev::after,
.gallery-swiper .swiper-button-next::after {
  font-weight: 600;
}

.gallery-swiper .swiper-button-prev:hover,
.gallery-swiper .swiper-button-next:hover {
  color: var(--accent);
}

/* Swiper transition: slow and smooth */
.gallery-swiper .swiper-slide {
  transition: opacity 0.4s var(--ease);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration) var(--ease), visibility var(--duration) var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 48px;
  height: 48px;
  font-size: 2rem;
  line-height: 1;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.lightbox-close:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
