/* Section Avant / après — intro, carrousel (3 visibles desktop), layouts vertical / horizontal */

.before-after__intro {
  text-align: left;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.ba-heading {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  font-weight: 400;
  margin: 0 0 0.4rem;
  color: var(--color-text);
}

@media (min-width: 901px) {
  .ba-heading {
    font-size: 3.125rem;
    margin: 0;
    color: #68523f;
  }
}

.before-after__subtitle {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: normal;
  font-size: 0.85rem;
  color: #917c6a;
  margin: 0;
}

/* ——— Carrousel : piste + flèches ——— */
.before-after__carousel {
  --ba-gap: clamp(0.65rem, 1.8vw, 1.25rem);
  --ba-nav: clamp(2.25rem, 5vw, 3rem);
  display: flex;
  align-items: stretch;
  gap: clamp(0.35rem, 1.2vw, 0.75rem);
  position: relative;
}

.before-after__carousel.is-nav-hidden .ba-nav {
  display: none;
}

.before-after__track-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  overscroll-behavior-x: contain;
}

.ba-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: var(--ba-gap);
  width: max-content;
  min-height: 0;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

/* Flèches : uniquement le chevron brun, sans cadre ni fond */
.ba-nav {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: none;
  color: #68523f;
  cursor: pointer;
  transition: opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.ba-nav:hover:not(:disabled) {
  opacity: 0.75;
}

.ba-nav:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

.ba-nav:focus-visible {
  outline: 2px solid #68523f;
  outline-offset: 4px;
}

.ba-nav__icon {
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  display: block;
}

.ba-nav--prev .ba-nav__icon {
  transform: rotate(135deg);
  margin-left: 0.2rem;
}

.ba-nav--next .ba-nav__icon {
  transform: rotate(-45deg);
  margin-right: 0.2rem;
}

/* Une carte = une colonne visible — requête de conteneur pour hauteur d’images identique h/v */
.ba-col {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Libellés sur l’image (haut gauche, blanc) — horizontal & vertical identiques */
.ba-col__figure {
  position: relative;
  margin: 0;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 2px;
}

.ba-col__badge {
  position: absolute;
  top: clamp(0.35rem, 1.8cqw, 0.65rem);
  left: clamp(0.35rem, 1.8cqw, 0.65rem);
  z-index: 2;
  font-family: var(--font-sans);
  font-size: clamp(0.55rem, 1.6cqw, 0.72rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  line-height: 1;
  pointer-events: none;
}

/*
  Hauteur du bloc photos : 75cqw = deux demi-vignettes 2:3 côte à côte.
  Même hauteur pour vertical et horizontal (plus de ligne de titres au-dessus).
*/
.ba-col__pair--horizontal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  width: 100%;
  height: 75cqw;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.ba-col__pair--horizontal .ba-col__figure {
  height: 100%;
  min-height: 0;
}

.ba-col__pair--vertical {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
  height: 75cqw;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.ba-col__pair--vertical .ba-col__figure {
  flex: 1 1 0;
  min-height: 0;
}

.ba-col__figure .ba-col__img,
.ba-col__figure .ba-col__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: unset;
  object-fit: cover;
  object-position: center top;
  border-radius: inherit;
}

.ba-col__img {
  background: var(--color-line);
}

.ba-col__placeholder {
  background: linear-gradient(135deg, #ebe4dc 0%, #ddd4ca 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.ba-col__name {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-top: 0.65rem;
  text-align: center;
}

@media (max-width: 900px) {
  .before-after__carousel {
    gap: 0.35rem;
  }

  /* Remonte la section : moins d'écart après le bloc prestations (centré plein écran) */
  .section.before-after {
    padding-top: clamp(0.25rem, 2vw, 1rem);
  }
}

@media (max-width: 600px) {
  .before-after__carousel {
    --ba-gap: 0.75rem;
    gap: 0.25rem;
  }

  .ba-nav {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }

  .ba-nav__icon {
    width: 0.55rem;
    height: 0.55rem;
    border-right-width: 2px;
    border-bottom-width: 2px;
  }
}

/* Navigateurs sans unités cq* : repli proche du ratio horizontal */
@supports not (height: 75cqw) {
  .ba-col__pair--horizontal,
  .ba-col__pair--vertical {
    height: auto;
    aspect-ratio: 2 / 3;
  }

  .ba-col__pair--vertical {
    max-height: min(70vw, 28rem);
  }

  .ba-col__figure .ba-col__img,
  .ba-col__figure .ba-col__placeholder {
    aspect-ratio: 2 / 3;
    height: auto;
  }

  .ba-col__pair--vertical .ba-col__figure {
    flex: none;
    min-height: 8rem;
  }
}
