/* ==========================================================================
   0. Polices de la charte (fichiers dans assets/fonts/)
   Stretch Pro n'existe qu'en une graisse : la plage 100–900 déclarée ci-dessous
   empêche le navigateur de fabriquer un faux gras, qui déformerait le dessin.
   ========================================================================== */

@font-face {
  font-family: "Stretch Pro";
  src: url("../fonts/stretchpro-regular.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Athelas ECL";
  src: url("../fonts/athelas-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Athelas ECL";
  src: url("../fonts/athelas-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Athelas ECL";
  src: url("../fonts/athelas-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Athelas ECL";
  src: url("../fonts/athelas-bolditalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Titre de la page rendu par le thème (« Services »).
   Adapter le sélecteur si le thème utilise une autre classe. */
.entry-title,
.page-title,
.wp-block-post-title {
  font-family: "Stretch Pro", "Trebuchet MS", sans-serif;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Endurance Core Lab — Page Services
   Tout est préfixé .ecl-* et scopé sous .ecl-services pour ne pas
   interférer avec le thème.
   ========================================================================== */

.ecl-services,
.ecl-modal {
  /* --- Polices -----------------------------------------------------------
     display = titres, étiquettes et pastilles de prix (Stretch Pro)
     body    = tous les autres textes (Athelas)
     Mettre `inherit` pour revenir aux polices du thème.
  --------------------------------------------------------------------- */
  --ecl-font-display: "Stretch Pro", "Trebuchet MS", sans-serif;
  --ecl-font-body: "Athelas ECL", Georgia, "Times New Roman", serif;

  /* --- Couleurs (relevées sur les maquettes) --------------------------- */
  --ecl-dark: #3d3634;
  --ecl-dark-soft: #6f6764;
  --ecl-red: #c1321a;
  --ecl-red-deep: #a33207;
  --ecl-green: #a8c686;
  --ecl-bg: #ffffff;
  --ecl-line: #3d3634;

  /* --- Mesures ---------------------------------------------------------- */
  --ecl-radius: 22px;
  --ecl-border: 2px;
  --ecl-gap: 28px;
}

.ecl-services {
  font-family: var(--ecl-font-body);
  color: var(--ecl-dark);
  background: var(--ecl-bg);
  max-width: 1120px;
  margin-inline: auto;
  padding: 8px 0 24px;
  line-height: 1.55;
}

.ecl-services *,
.ecl-services *::before,
.ecl-services *::after,
.ecl-modal *,
.ecl-modal *::before,
.ecl-modal *::after { box-sizing: border-box; }

/* ==========================================================================
   1. Ligne d'offre (état fermé)
   ========================================================================== */

.ecl-svc {
  border-top: 1px solid var(--ecl-line);
}
.ecl-svc:last-of-type { border-bottom: 1px solid var(--ecl-line); }

.ecl-svc__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "title   badge chevron"
    "tagline badge chevron";
  align-items: center;
  gap: 8px 24px;
  width: 100%;
  padding: 26px 8px 26px 4px;
  margin: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.ecl-svc__head:hover .ecl-svc__title { color: var(--ecl-red-deep); }
.ecl-svc__head:focus-visible {
  outline: 3px solid var(--ecl-red);
  outline-offset: 2px;
}

.ecl-svc__title {
  grid-area: title;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--ecl-font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 0.8rem + 0.55vw, 1.2rem);
  letter-spacing: 0.01em;
  line-height: 1.25;
  margin: 0;
  transition: color 0.18s ease;
}

.ecl-svc__terrain { display: inline-flex; align-items: flex-end; gap: 8px; }
.ecl-svc__terrain img {
  display: block;
  width: auto;
  height: 0.85em;
  max-height: 26px;
}
.ecl-svc__terrain img.is-route { height: 0.78em; }

.ecl-svc__tagline {
  grid-area: tagline;
  display: block;
  margin: 2px 0 0;
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ecl-dark);
  max-width: 84ch;
}

/* Pastille de prix -------------------------------------------------------- */
.ecl-price {
  grid-area: badge;
  position: relative;
  flex: none;
  width: 108px;
  height: 103px;
  display: grid;
  place-items: center;
}
.ecl-price__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.ecl-price__value {
  position: relative;
  transform: translate(-4%, -3%);
  text-align: center;
  font-family: var(--ecl-font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: -0.01em;
  color: var(--ecl-red);
  line-height: 1.05;
}
.ecl-price__unit { display: block; font-size: 0.78em; }

/* Chevron ----------------------------------------------------------------- */
.ecl-svc__chevron {
  grid-area: chevron;
  flex: none;
  width: 46px;
  height: 26px;
  color: var(--ecl-dark);
  transition: transform 0.3s ease;
}
.ecl-svc__chevron svg { display: block; width: 100%; height: 100%; }
.ecl-svc[data-open="true"] .ecl-svc__chevron { transform: rotate(180deg); }

/* ==========================================================================
   2. Panneau déplié
   ========================================================================== */

.ecl-svc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.ecl-svc[data-open="true"] .ecl-svc__panel { grid-template-rows: 1fr; }
.ecl-svc__panelinner { overflow: hidden; min-height: 0; }
.ecl-svc__body { padding: 6px 4px 44px; }

.ecl-row + .ecl-row { margin-top: 46px; }

.ecl-row--split {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: var(--ecl-gap);
}
.ecl-row--split.is-reversed { grid-template-columns: 1.05fr 1fr; }

/* Bloc encadré + étiquette en pastille ----------------------------------- */
.ecl-block {
  position: relative;
  border: var(--ecl-border) solid var(--ecl-line);
  border-radius: var(--ecl-radius);
  padding: 30px 28px 24px;
  margin-top: 18px;
}
.ecl-block__label {
  position: absolute;
  top: 0;
  left: 26px;
  transform: translateY(-50%);
  background: var(--ecl-bg);
  border: var(--ecl-border) solid var(--ecl-line);
  border-radius: 999px;
  padding: 7px 22px;
  font-family: var(--ecl-font-display);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ecl-block > p { margin: 0; }
.ecl-block > p + p { margin-top: 12px; }

.ecl-block ul {
  margin: 0;
  padding-left: 1.15em;
  list-style: disc;
}
.ecl-block li + li { margin-top: 12px; }

/* Figures ----------------------------------------------------------------- */
.ecl-figure { margin: 0; }
.ecl-figure img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply; /* efface le fond blanc des visuels */
}

/* Pied d'offre : prérequis + appel à l'action ---------------------------- */
.ecl-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--ecl-gap);
  margin-top: 46px;
}
.ecl-prereq {
  border: 1.5px solid var(--ecl-dark-soft);
  border-radius: 18px;
  padding: 16px 20px;
  font-size: 0.94rem;
  color: var(--ecl-dark-soft);
  max-width: 46ch;
}
.ecl-prereq strong {
  color: var(--ecl-dark);
}
.ecl-prereq ul { margin: 8px 0 0; padding-left: 1.15em; }
.ecl-prereq li + li { margin-top: 4px; }

.ecl-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.ecl-cta__hook {
  font-weight: 700;
  font-size: 0.98rem;
  max-width: 27ch;
  text-align: right;
  text-wrap: balance;
  line-height: 1.35;
}

.ecl-btn {
  display: inline-block;
  background: var(--ecl-red-deep);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 15px 30px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}
.ecl-btn:hover { background: var(--ecl-red); transform: translateY(-1px); color: #fff; }
.ecl-btn:focus-visible { outline: 3px solid var(--ecl-dark); outline-offset: 3px; }
.ecl-btn[disabled] { opacity: 0.55; cursor: progress; transform: none; }

/* ==========================================================================
   3. Fenêtre de contact
   ========================================================================== */

.ecl-modal[hidden] { display: none; }
.ecl-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(61, 54, 52, 0.55);
  backdrop-filter: blur(2px);
  animation: ecl-fade 0.2s ease;
}
@keyframes ecl-fade { from { opacity: 0; } to { opacity: 1; } }

.ecl-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  background: var(--ecl-bg);
  color: var(--ecl-dark);
  font-family: var(--ecl-font-body);
  border: var(--ecl-border) solid var(--ecl-line);
  border-radius: var(--ecl-radius);
  padding: 30px 30px 28px;
}

.ecl-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 1.5px solid var(--ecl-dark-soft);
  border-radius: 50%;
  color: var(--ecl-dark);
  line-height: 0;
  cursor: pointer;
}
/* Croix tracée en CSS : ni glyphe ni SVG, donc rien que le thème puisse neutraliser. */
.ecl-modal .ecl-modal__x {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}
.ecl-modal .ecl-modal__x::before,
.ecl-modal .ecl-modal__x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.ecl-modal .ecl-modal__x::before { transform: translate(-50%, -50%) rotate(45deg); }
.ecl-modal .ecl-modal__x::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.ecl-modal__close:hover { background: var(--ecl-dark); color: #fff; }

.ecl-modal__eyebrow {
  font-family: var(--ecl-font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ecl-red);
  margin: 0 0 6px;
}
.ecl-modal__title {
  font-family: var(--ecl-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  margin: 0 0 22px;
  padding-right: 40px;
  line-height: 1.25;
}

.ecl-field { margin-bottom: 16px; }
.ecl-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ecl-field input,
.ecl-field textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1.5px solid var(--ecl-dark-soft);
  border-radius: 12px;
  padding: 11px 14px;
}
.ecl-field textarea { min-height: 130px; resize: vertical; }
.ecl-field input:focus,
.ecl-field textarea:focus {
  outline: 0;
  border-color: var(--ecl-red);
  box-shadow: 0 0 0 3px rgba(193, 50, 26, 0.18);
}
.ecl-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* Pot de miel anti-robots : invisible mais pas display:none */
.ecl-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ecl-modal__legal {
  font-size: 0.78rem;
  color: var(--ecl-dark-soft);
  margin: 4px 0 18px;
}
.ecl-modal__actions { display: flex; justify-content: flex-end; }

.ecl-alert {
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}
.ecl-alert--ok { background: rgba(168, 198, 134, 0.28); border: 1.5px solid var(--ecl-green); }
.ecl-alert--ko { background: rgba(193, 50, 26, 0.1); border: 1.5px solid var(--ecl-red); }
.ecl-alert[hidden] { display: none; }

/* ==========================================================================
   4. Adaptations écrans réduits
   ========================================================================== */

@media (max-width: 900px) {
  .ecl-row--split,
  .ecl-row--split.is-reversed { grid-template-columns: 1fr; }
  /* le texte passe toujours avant l'illustration */
  .ecl-row--split > .ecl-figure { order: 2; }
  .ecl-row--split > .ecl-block { order: 1; }
  .ecl-foot { grid-template-columns: 1fr; }
  .ecl-prereq { max-width: none; }
  .ecl-cta { justify-content: flex-start; }
  .ecl-cta__hook { text-align: left; }
}

@media (max-width: 640px) {
  .ecl-svc__head {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title   badge"
      "tagline tagline"
      "chevron chevron";
    padding: 22px 4px;
    gap: 6px 16px;
  }
  .ecl-svc__chevron { justify-self: center; margin-top: 6px; }
  .ecl-price { width: 84px; height: 80px; }
  .ecl-price__value { font-size: 0.7rem; }
  .ecl-block { padding: 28px 18px 20px; }
  .ecl-block__label { left: 16px; font-size: 0.66rem; padding: 6px 14px; }
  .ecl-grid2 { grid-template-columns: 1fr; }
  .ecl-modal__dialog { padding: 26px 20px 24px; }
  .ecl-row + .ecl-row { margin-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .ecl-services *,
  .ecl-modal * { transition: none !important; animation: none !important; }
}
