/* =========================================================
   GALERIA — Dona i Essència
   ========================================================= */


/* Entrada principal de la galeria */

.gallery-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}


.gallery-category {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-paper);

  transition:
    transform var(--dur-base) var(--ease-out-quart),
    box-shadow var(--dur-base) var(--ease-out-quart),
    border-color var(--dur-fast) var(--ease-out-quart);
}


.gallery-category:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}


.gallery-category__visual {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
}


.gallery-category__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;

  transition:
    transform 0.6s var(--ease-out-quart);
}


.gallery-category:hover .gallery-category__visual img {
  transform: scale(1.035);
}


.gallery-category__visual--brand {
  display: flex;
  align-items: center;
  justify-content: center;
}


.gallery-category__visual--brand img {
  width: 34%;
  height: auto;
  object-fit: contain;
}


.gallery-category:hover .gallery-category__visual--brand img {
  transform: scale(1.05);
}


.gallery-category__body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;

  padding: var(--space-6);
}


.gallery-category__body .tag {
  align-self: flex-start;
  margin-bottom: var(--space-4);
}


.gallery-category__body h2 {
  font-size: var(--fs-h4);
  margin-bottom: var(--space-3);
}


.gallery-category__body p {
  color: var(--color-ink-soft);
  font-size: var(--fs-small);
}


.gallery-category__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);

  margin-top: auto;
  padding-top: var(--space-5);

  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-primary);
}


/* =========================================================
   GALERIA D'IMATGES
   ========================================================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}


.gallery-photo {
  position: relative;

  overflow: hidden;

  margin: 0;

  border-radius: var(--radius-md);

  background: var(--color-bg-alt);

  box-shadow: var(--shadow-sm);
}


.gallery-photo img {
  display: block;

  width: 100%;
  aspect-ratio: 4 / 3;

  object-fit: cover;

  transition:
    transform 0.6s var(--ease-out-quart);
}


.gallery-photo:hover img {
  transform: scale(1.035);
}


.gallery-photo figcaption {
  position: absolute;

  left: 0;
  right: 0;
  bottom: 0;

  padding:
    var(--space-6)
    var(--space-4)
    var(--space-4);

  color: white;

  font-size: var(--fs-small);
  font-weight: 600;

  background:
    linear-gradient(
      to top,
      rgba(32, 23, 22, 0.72),
      transparent
    );
}


/* Bloc provisional */

.gallery-note {
  max-width: 760px;

  margin-inline: auto;

  padding: var(--space-8);

  text-align: center;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);

  background: var(--color-bg-alt);
}


.gallery-note .tag {
  margin-bottom: var(--space-4);
}


.gallery-note h2 {
  font-size: var(--fs-h3);
  margin-bottom: var(--space-4);
}


.gallery-note p {
  max-width: 58ch;
  margin-inline: auto;

  color: var(--color-ink-soft);
}


/* =========================================================
   CARRUSEL
   ========================================================= */

.gallery-carousel {
  max-width: 1050px;
  margin-inline: auto;
}


.gallery-carousel__viewport {
  overflow: hidden;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);

  background: var(--color-paper);

  box-shadow: var(--shadow-md);
}


.gallery-carousel__track {
  position: relative;
}


.gallery-carousel__slide {
  display: none;

  grid-template-columns: 1.25fr 0.75fr;

  min-height: 520px;
}


.gallery-carousel__slide.is-active {
  display: grid;
}


.gallery-carousel__image {
  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  background: var(--color-bg-alt);
}


.gallery-carousel__image img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}


.gallery-carousel__image--logo img {
  width: 35%;
  height: auto;

  object-fit: contain;
}


.gallery-carousel__caption {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;

  padding: var(--space-8);
}


.gallery-carousel__caption .tag {
  margin-bottom: var(--space-4);
}


.gallery-carousel__caption h2 {
  font-size: var(--fs-h3);
  margin-bottom: var(--space-4);
}


.gallery-carousel__caption p {
  color: var(--color-ink-soft);
}


.gallery-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: var(--space-4);

  margin-top: var(--space-5);
}


.gallery-carousel__button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 46px;
  height: 46px;

  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);

  color: var(--color-ink);

  transition:
    background-color var(--dur-fast) var(--ease-out-quart),
    color var(--dur-fast) var(--ease-out-quart),
    border-color var(--dur-fast) var(--ease-out-quart);
}


.gallery-carousel__button:hover {
  color: white;
  background: var(--color-primary);
  border-color: var(--color-primary);
}


.gallery-carousel__dots {
  display: flex;
  gap: 8px;
}


.gallery-carousel__dot {
  width: 9px;
  height: 9px;

  padding: 0;

  border: 0;
  border-radius: var(--radius-full);

  background: var(--color-border-strong);

  cursor: pointer;

  transition:
    width var(--dur-fast) var(--ease-out-quart),
    background-color var(--dur-fast) var(--ease-out-quart);
}


.gallery-carousel__dot.is-active {
  width: 26px;
  background: var(--color-primary);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 980px) {

  .gallery-categories {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-carousel__slide,
  .gallery-carousel__slide.is-active {
    grid-template-columns: 1fr;
  }

  .gallery-carousel__image {
    min-height: 380px;
  }

}


@media (max-width: 640px) {

  .gallery-categories {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-carousel__slide {
    min-height: auto;
  }

  .gallery-carousel__image {
    min-height: 280px;
  }

  .gallery-carousel__caption {
    padding: var(--space-6);
  }

  .gallery-note {
    padding: var(--space-6);
  }

}