/* SERVICES 14 - FAMILLES ET SOINS
   Un sommaire de familles a gauche, le panneau de la famille ouverte a
   droite : son image, sa description et la liste de ses soins, chacun lie a
   sa page. La variante qui montre le mieux l'etendue d'une offre.
   Les panneaux sont superposes dans la meme cellule de grille : la hauteur
   est celle du plus grand, donc aucun saut au changement d'onglet. */

.services-14 {
  background: var(--white);
  color: var(--black);
  padding: clamp(4rem, 9vw, 8rem) 5%;
}

.services-14__inner {
  max-width: 1320px;
  margin: 0 auto;
}

/* ── En-tete ─────────────────────────────────────────────────────────── */
.services-14__head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.services-14__surtitre {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray-dark);
}

.services-14__titre {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  font-weight: 400;
  line-height: 1.06;
  color: var(--black);
}

.services-14__titre:hover {
  color: var(--black);
}

.services-14__titre .mcl-accent {
  font-style: italic;
  color: inherit;
}

.services-14__intro {
  margin: 0;
  max-width: 46ch;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gray-dark);
}

/* ── Etage des metiers (multi-metiers seulement) ─────────────────────────
   LA COULEUR : rampe --secondary -> --primary, ancree sur l'accent de la
   variante. Le bouton actif pose la teinte en aplat et son texte suit la
   rampe des --on-* correspondantes (§4.17). */
.services-14__metiers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.services-14__metier,
.services-14__onglet[data-metier],
.services-14__panneau[data-metier] {
  --m-couleur: color-mix(in oklab, var(--secondary), var(--primary) var(--m-melange, 0%));
  --m-texte: color-mix(in oklab, var(--on-secondary), var(--on-primary) var(--m-melange, 0%));
}

.services-14__metier {
  padding: 10px 20px;
  border: 1px solid var(--m-couleur);
  border-radius: 999px;
  background: none;
  /* Le texte au repos reste en --black : la terre cuite, en texte, descend
     sous 4,5:1 sur l'ivoire. La teinte du metier est portee par le contour,
     puis par l'aplat du bouton actif. */
  color: var(--black);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.services-14__metier:hover,
.services-14__metier:focus-visible,
.services-14__metier.is-active {
  background: var(--m-couleur);
  color: var(--m-texte);
}

.services-14__metier:focus-visible {
  outline: 2px solid var(--m-couleur);
  outline-offset: 3px;
}

/* ── Corps : sommaire + panneaux ─────────────────────────────────────── */
.services-14__corps {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2.2fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

.services-14__onglets {
  display: flex;
  flex-direction: column;
  border-top: 1px solid color-mix(in srgb, var(--black) 14%, transparent);
}

.services-14__onglet {
  --m-couleur: var(--secondary);
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  padding: 18px 0 18px 18px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--black) 14%, transparent);
  background: none;
  color: var(--gray-dark);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: color 0.3s ease, padding-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* `display: flex` annulerait l'attribut `hidden` que pose le filtre de metier. */
.services-14__onglet[hidden] {
  display: none;
}

/* Le repere de l'onglet actif : un trait vertical dans la teinte du metier. */
.services-14__onglet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--m-couleur);
  transform: scaleY(0);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.services-14__onglet-num {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1;
  color: inherit;
}

.services-14__onglet-nom {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.25;
  color: inherit;
}

.services-14__onglet:hover,
.services-14__onglet:focus-visible {
  color: var(--black);
}

.services-14__onglet.is-active {
  padding-left: 26px;
  color: var(--black);
}

.services-14__onglet.is-active::before {
  transform: scaleY(1);
}

.services-14__onglet:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}

.services-14__panneaux {
  display: grid;
}

.services-14__panneau {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  /* La cellule a la hauteur du plus grand panneau : sans cela, les rangees
     d'un panneau plus court s'etirent et ouvrent un vide sous l'image. */
  align-content: start;
  min-width: 0;
}

/* Sans JS, les panneaux restent visibles les uns sous les autres : rien
   n'est cache tant que les onglets ne fonctionnent pas. */
.services-14--js .services-14__panneau {
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.45s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.45s;
}

.services-14--js .services-14__panneau.is-active {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition:
    opacity 0.55s ease 0.1s,
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s,
    visibility 0s linear 0s;
}

.services-14:not(.services-14--js) .services-14__panneau + .services-14__panneau {
  grid-area: auto;
  margin-top: 48px;
}

.services-14__panneau:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 8px;
}

.services-14__visuel {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 1.25rem;
  background: var(--gray-light);
}

.services-14__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.services-14__contenu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 6px;
}

.services-14__nom {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--black);
}

.services-14__nom:hover {
  color: var(--black);
}

.services-14__desc {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gray-dark);
}

/* ── Liste elegante des soins ────────────────────────────────────────── */
.services-14__soins {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--black) 12%, transparent);
}

.services-14__soin {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--black) 12%, transparent);
}

.services-14__soin-lien,
.services-14__soin-libelle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--black);
}

.services-14__soin-lien {
  background: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease, padding-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.services-14__soin-nom {
  color: inherit;
}

.services-14__soin-svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--secondary);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.services-14__soin-lien:hover,
.services-14__soin-lien:focus-visible {
  padding-left: 8px;
  color: var(--black);
}

.services-14__soin-lien:hover .services-14__soin-svg,
.services-14__soin-lien:focus-visible .services-14__soin-svg {
  transform: translateX(4px);
}

.services-14__soin-lien:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* ── Actions ─────────────────────────────────────────────────────────── */
.services-14__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 12px;
}

.services-14__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--on-secondary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.services-14__cta:hover,
.services-14__cta:focus-visible {
  background: var(--primary);
  color: var(--on-primary);
}

.services-14__cta:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
}

.services-14__plus {
  padding: 0 0 2px;
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--black);
  cursor: pointer;
  transition: color 0.3s ease;
}

.services-14__plus:hover,
.services-14__plus:focus-visible {
  color: var(--black);
  border-bottom-color: var(--secondary);
}

.services-14__plus:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .services-14--js .services-14__panneau,
  .services-14--js .services-14__panneau.is-active {
    transform: none;
    transition: none;
  }

  .services-14__onglet,
  .services-14__onglet::before,
  .services-14__soin-lien,
  .services-14__soin-svg {
    transition: none;
  }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .services-14__panneau {
    grid-template-columns: minmax(0, 1fr);
  }

  .services-14__visuel {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 1024px) {
  .services-14__corps {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Le sommaire devient une bande defilante de pastilles. */
  .services-14__onglets {
    flex-direction: row;
    gap: 8px;
    margin: 0 -5vw;
    padding: 0 5vw 6px;
    overflow-x: auto;
    border-top: 0;
    scrollbar-width: none;
  }

  .services-14__onglets::-webkit-scrollbar {
    display: none;
  }

  .services-14__onglet {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 18px;
    border: 1px solid color-mix(in srgb, var(--black) 16%, transparent);
    border-radius: 999px;
    white-space: nowrap;
  }

  .services-14__onglet::before,
  .services-14__onglet-num {
    display: none;
  }

  .services-14__onglet.is-active {
    padding-left: 18px;
    border-color: var(--m-couleur);
    background: var(--m-couleur);
    color: var(--on-secondary);
  }

  .services-14__onglet[data-metier].is-active {
    color: var(--m-texte);
  }

  .services-14__onglet-nom {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: inherit;
  }
}

@media (max-width: 768px) {
  .services-14__head {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .services-14__actions {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .services-14__plus {
    align-self: center;
  }
}
