/* ===== Expertise — habillage (prototype) ===== */

/* --- Titre : natif Divi, statique. Uniquement le rond 11px au-dessus
   de la première ligne, comme Histoire / Agence. --- */
.ah-expertises .ah-titre-l1::before {
  content: "";
  display: block;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--ah-terre, #b07030);
  margin-bottom: 18px;
}
.ah-expertises .ah-titre-l1,
.ah-expertises .ah-titre-l1 h1,
.ah-expertises .ah-titre-l1 h2,
.ah-expertises .ah-titre-l1 h3,
.ah-expertises .ah-titre-l1 p {
  color: var(--ah-encre, #3e2716) !important;
}
.ah-expertises .ah-titre-l2,
.ah-expertises .ah-titre-l2 h1,
.ah-expertises .ah-titre-l2 h2,
.ah-expertises .ah-titre-l2 h3,
.ah-expertises .ah-titre-l2 p {
  color: var(--ah-tan, #a87d43) !important;
}
/* Un peu d'air entre le titre et la liste / la photo. */
.ah-expertises .et_pb_row:has(.ah-titre-l1),
.ah-expertises .et_pb_row:has(.titre) {
  margin-bottom: clamp(28px, 3.2vw, 48px) !important;
}

/* Liste : même corps que le poème d'Histoire (casse normale, 15–18 px,
   interligne 1,45). Plus de filet perlé sous les lignes. */
.ah-expertises .ah-exp-liste {
  position: relative;
}
/* Colonne de la liste : centrée verticalement sur la hauteur de la photo
   (posée par la ligne Divi, voir ah-exp-row-aligne plus bas). */
.ah-expertises .ah-exp-row-aligne {
  display: flex !important;
  align-items: center !important;
}
.ah-expertises .ah-exp-ligne {
  --ah-exp-taille: clamp(15px, 1.15vw, 18px); /* même corps que le poème d'Histoire */
  display: block;
  position: relative;
  margin-top: clamp(18px, 2vw, 28px);
  padding: 0 0 0 24px;
  text-transform: none !important;
  letter-spacing: normal;
  font-size: var(--ah-exp-taille) !important;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ah-encre, #3e2716);
  text-decoration: none;
  cursor: pointer;
  transition:
    font-size .7s cubic-bezier(.22,1,.36,1),
    font-weight .7s cubic-bezier(.22,1,.36,1),
    color .7s cubic-bezier(.22,1,.36,1);
}
.ah-expertises .ah-exp-ligne:first-child {
  margin-top: 0;
}
.ah-expertises .ah-exp-ligne.ah-ligne-active {
  font-size: calc(var(--ah-exp-taille) + 5px) !important;
  font-weight: 600 !important;
  color: var(--ah-terre, #b07030) !important;
}
/* Filet vague coloré, comme .motsclés li::after (Histoire/Agence) :
   masqué (mask-image) par le même motif de vague, invisible au repos,
   révélé au survol ou quand la ligne est active. */
.ah-expertises .ah-exp-ligne::after {
  content: none;
}
.ah-expertises .ah-exp-puce {
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ah-terre, #b07030);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: top .45s cubic-bezier(.16,1,.3,1), opacity .5s cubic-bezier(.16,1,.3,1);
}
.ah-expertises .ah-exp-puce.ah-in {
  opacity: 1;
}

/* --- Photo découpée par le masque emblème AH, 3 images en fondu ---
   Le masque est sur le CADRE (taille fixe). Les photos remplissent ce
   cadre ; Divi met width:auto / max-width:100% sur les img, ce qui
   faisait varier la taille du logo au changement de photo. --- */
.ah-expertises .et_pb_image .et_pb_image_wrap.ah-exp-photo,
.ah-expertises .ah-exp-photo {
  position: relative;
  display: block;
  width: 100%;
  max-width: 560px;
  min-height: 0;
  aspect-ratio: 122.53 / 73.88;
  margin: 0 auto;
  overflow: hidden;
  -webkit-mask-image: var(--ah-exp-masque);
          mask-image: var(--ah-exp-masque);
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}
.ah-expertises .et_pb_image .ah-exp-photo img,
.ah-expertises .ah-exp-photo img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  opacity: 0;
  transition: opacity 1s cubic-bezier(.16,1,.3,1);
  -webkit-mask-image: none !important;
          mask-image: none !important;
}
.ah-expertises .ah-exp-photo img.ah-actif {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .ah-expertises * { transition: none !important; }
  .ah-expertises .ah-exp-puce { opacity: 1 !important; }
}

/* --- Sous-catégories : la description de l'entrée active ---------
   Elle vit à côté de l'entrée, pas dedans : sinon le filet perlé
   (posé en ::after au bas de l'entrée) descendrait sous la
   description au lieu de souligner le titre. --- */
.ah-expertises .ah-exp-sous {
  display: block;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin: 0;
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.6;
  letter-spacing: normal;
  text-transform: none;
  color: rgba(45, 29, 18, .68);
  max-width: 46ch;
  transition: max-height .55s cubic-bezier(.22,1,.36,1),
              opacity .45s ease,
              margin .55s cubic-bezier(.22,1,.36,1);
}
.ah-expertises .ah-exp-sous.ah-actif {
  max-height: 160px;
  opacity: 1;
  margin: 10px 0 18px;
}
@media (max-width: 980px) {
  .ah-expertises .et_pb_row:has(.titre),
  .ah-expertises .et_pb_row:has(.ah-titre-l1) {
    padding-top: 32px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    text-align: center !important;
  }
  .ah-expertises .et_pb_row:has(.titre) .titre,
  .ah-expertises .et_pb_row:has(.titre) .titre *,
  .ah-expertises .ah-titre-l1,
  .ah-expertises .ah-titre-l1 h1,
  .ah-expertises .ah-titre-l1 h2,
  .ah-expertises .ah-titre-l1 h3,
  .ah-expertises .ah-titre-l1 p,
  .ah-expertises .ah-titre-l2,
  .ah-expertises .ah-titre-l2 h1,
  .ah-expertises .ah-titre-l2 h2,
  .ah-expertises .ah-titre-l2 h3,
  .ah-expertises .ah-titre-l2 p {
    text-align: center !important;
    font-size: clamp(28px, 8vw, 32px) !important;
    line-height: 1.15 !important;
  }
  .ah-expertises .ah-titre-l1::before {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 14px;
  }

  /* Masque AH : une seule colonne, pleine largeur, logo centré. */
  .ah-expertises .ah-exp-row-aligne,
  .ah-expertises .ah-exp-row-masque,
  .ah-expertises .et_pb_row:has(.et_pb_image),
  .ah-expertises .et_pb_row:has(.ah-exp-photo) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .ah-expertises .ah-exp-row-masque > .et_pb_column,
  .ah-expertises .ah-exp-row-aligne > .et_pb_column,
  .ah-expertises .ah-exp-col-masque,
  .ah-expertises .et_pb_column:has(.et_pb_image),
  .ah-expertises .et_pb_column:has(.ah-exp-photo) {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .ah-expertises .ah-exp-col-cachee {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  .ah-expertises .et_pb_image {
    display: block !important;
    float: none !important;
    width: 92vw !important;
    max-width: 92vw !important;
    margin: 12px auto 40px !important;
    text-align: center !important;
  }
  .ah-expertises .ah-exp-photo {
    display: block !important;
    float: none !important;
    width: 92vw !important;
    max-width: 92vw !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 122.53 / 73.88;
    margin: 0 auto !important;
  }
  .ah-expertises .ah-exp-liste {
    display: block !important;
    width: 100%;
    padding: 0 8px;
    overflow: visible !important;
  }
  .ah-expertises .ah-exp-ligne {
    display: block !important;
    --ah-exp-taille: 18px;
    font-size: 18px !important;
    line-height: 1.45;
    margin-top: 16px;
    padding: 0 0 0 28px;
    text-transform: none !important;
    letter-spacing: normal;
    color: var(--ah-encre, #3e2716) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  .ah-expertises .ah-exp-ligne:first-child {
    margin-top: 0;
  }
  .ah-expertises .ah-exp-ligne.ah-ligne-active {
    font-size: 23px !important;
  }
  .ah-expertises .ah-exp-sous {
    font-size: 16px;
    line-height: 1.55;
    padding-left: 28px;
    max-width: none;
  }
  .ah-expertises .ah-exp-sous.ah-actif {
    max-height: none;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ah-expertises .ah-exp-sous { transition: none; }
}
