/* Gallery Section Styles */
.gallery-section {
  padding: 80px 0;
}

.gallery-title {
  font-family: var(--font-primary-bold);
  font-size: 32px;
  color: var(--black);
  margin-bottom: 30px;
}

/* Carousel layout */
.gallery-carousel {
  position: relative;
}

.gallery-viewport {
  overflow: hidden;
}

.gallery-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(50% - 12px); /* show 2 slides on desktop */
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.gallery-track::-webkit-scrollbar { display: none; }

.gallery-slide {
  scroll-snap-align: start;
}

.gallery-slide img {
  width: 100%;
  height: auto; /* Preserve aspect ratio */
  aspect-ratio: 16 / 9; /* Reserve space; avoids CLS while keeping ratio */
  object-fit: cover; /* do not crop or distort */
  background: #f3f3f3;
  border-radius: 10px;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--black);
  opacity: 0.8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-nav.prev { left: -12px; }
.gallery-nav.next { right: -12px; }

.gallery-nav::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background: #ffffff;
  mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
}
.gallery-nav.prev::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>');
}
.gallery-nav.next::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>');
}

/* Responsive tweaks */
@media (max-width: 1024px) {
  .gallery-track { grid-auto-columns: 100%; } /* one slide per view */
  .gallery-slide img { aspect-ratio: 16 / 9; }
}

@media (max-width: 768px) {
  .gallery-section { padding: 40px 20px; }
  .gallery-nav.prev { left: 4px; }
  .gallery-nav.next { right: 4px; }
}
