/*
   ==========================================================================
   COMPONENTE: Galería de Nosotros (app/Views/nosotros.php)
   Carrusel de 8 fotos fijas del vivero, debajo de la intro + cifras.
   Scroll-snap nativo (se desliza con el dedo en mobile); las flechas y los
   puntos solo mueven el scroll de la pista (JS inline en la vista).
   1 foto por vista en mobile, 2 desde 640px, 3 desde 980px.
   ========================================================================== */

.about-gallery { margin-top: 2.5rem; }

.about-gallery-viewport { position: relative; }

.about-gallery-track {
  position: relative; /* offsetLeft de cada slide se mide contra la pista */
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.about-gallery-track::-webkit-scrollbar { display: none; }

.about-gallery-slide {
  position: relative;
  scroll-snap-align: start;
  aspect-ratio: 4 / 3; /* tamaño fijo del recuadro: la foto se adapta adentro */
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--color-bg-alt);
}
/* Fondo: la misma foto difuminada (--slide-bg, inline en la vista). Con la
   foto estirada (object-fit: fill) queda tapado; solo se ve mientras carga. */
.about-gallery-slide::before {
  content: "";
  position: absolute;
  inset: -1rem;
  background-image: var(--slide-bg);
  background-size: cover;
  background-position: center;
  filter: blur(18px) brightness(0.85);
}
.about-gallery-slide img {
  position: relative; /* por encima del ::before */
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill; /* estirada al recuadro 4:3: la foto se deforma, el slide no cambia */
  transition: transform 0.4s ease;
}
.about-gallery-slide:hover img { transform: scale(1.04); }

/* Flechas: ocultas en mobile (se desliza con el dedo) */
.about-gallery-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background-color: var(--color-bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.about-gallery-arrow svg { width: 1.2rem; height: 1.2rem; }
.about-gallery-arrow:hover:not(:disabled) {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}
.about-gallery-arrow:disabled { opacity: 0; pointer-events: none; }
.about-gallery-arrow--prev { left: 0.75rem; }
.about-gallery-arrow--next { right: 0.75rem; }

/* Puntos */
.about-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.about-gallery-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background-color: var(--border-color);
  cursor: pointer;
  transition: background-color 0.18s ease, width 0.18s ease;
}
.about-gallery-dot.is-active {
  width: 1.4rem;
  background-color: var(--color-primary);
}

@media (min-width: 640px) {
  .about-gallery-track { grid-auto-columns: calc((100% - 1rem) / 2); }
  .about-gallery-arrow { display: inline-flex; }
}

@media (min-width: 980px) {
  .about-gallery-track { grid-auto-columns: calc((100% - 2rem) / 3); }
}

@media (prefers-reduced-motion: reduce) {
  .about-gallery-track { scroll-behavior: auto; }
  .about-gallery-slide img,
  .about-gallery-dot { transition: none; }
  .about-gallery-slide:hover img { transform: none; }
}
