/* Bloc des solutions de l'accueil (src/lib/solutions.ts). */
.esl-solutions {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) 20px 24px;
  font-family: "Montserrat", sans-serif;
}

.esl-solutions__tete {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  align-items: end;
  gap: 24px 48px;
  margin-bottom: 36px;
}

.esl-solutions__titre {
  margin: 0;
  color: #000;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.esl-solutions__titre span {
  color: #e8482f;
}

.esl-solutions__intro {
  margin: 0;
  color: #54595f;
  font-size: 1rem;
  line-height: 1.55;
}

.esl-solutions__liste {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.esl-solutions__legende {
  margin: 12px 0 0;
  color: #6b7076;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

/* Carte */
.esl-sol {
  position: relative;
  min-height: 340px;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  background: #252f61;
}

.esl-sol:last-child {
  grid-column: 1 / -1;
}

.esl-sol::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(10, 14, 34, 0.86) 0%, rgba(10, 14, 34, 0.3) 50%, rgba(10, 14, 34, 0.05) 100%);
}

/* Spécificité renforcée : Elementor impose `.elementor img { height: auto }`. */
.esl-solutions .esl-sol__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.esl-sol__numero {
  position: absolute;
  top: 20px;
  left: 22px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.esl-sol__numero::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--couleur);
  vertical-align: 1px;
}

.esl-sol__vertical {
  display: none;
}

.esl-sol__corps {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px 16px;
  padding: 24px;
}

.esl-sol__titre {
  grid-column: 1;
  margin: 0;
  color: #fff;
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.esl-solutions a.esl-sol__lien {
  color: inherit;
  text-decoration: none;
}

/* Toute la carte est cliquable, via le lien du titre. */
.esl-sol__lien::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.esl-sol__lien:focus-visible {
  outline: none;
}

.esl-sol:has(.esl-sol__lien:focus-visible) {
  outline: 3px solid var(--couleur);
  outline-offset: 3px;
}

.esl-sol__texte {
  grid-column: 1;
  margin: 0;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  line-height: 1.5;
}

.esl-sol__fleche {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--couleur);
  color: #000;
  transition: transform 200ms var(--ease-out);
}

.esl-sol__fleche svg {
  width: 18px;
  height: 18px;
}

.esl-sol__choix {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.esl-solutions a.esl-sol__pastille {
  position: relative;
  z-index: 2;
  padding: 10px 18px;
  border-radius: 16px;
  background: var(--couleur);
  color: #000;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}

.esl-sol__pastille:active {
  transform: scale(0.97);
}

.esl-sol__pastille:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .esl-sol:hover .esl-sol__fleche {
    transform: translate(2px, -2px);
  }

  .esl-solutions a.esl-sol__pastille:hover {
    background: #fff;
  }
}

/* Ordinateur : accordéon. La carte survolée (ou atteinte au clavier) s'ouvre. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .esl-solutions__liste {
    display: flex;
    height: 560px;
  }

  .esl-sol {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    transition: flex-grow 600ms var(--ease-in-out);
  }

  .esl-sol__image {
    transform: scale(1.06);
    transition: transform 900ms var(--ease-out);
  }

  .esl-sol__vertical {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 28px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: translateX(-50%) rotate(180deg);
    transition: opacity 200ms ease;
  }

  .esl-sol__corps {
    min-width: 420px;
    opacity: 0;
    transform: translateY(12px);
    visibility: hidden;
    transition: opacity 120ms ease, transform 120ms ease, visibility 0s 120ms;
  }

  .esl-sol:hover,
  .esl-sol:focus-within {
    flex-grow: 4;
  }

  .esl-sol:hover .esl-sol__image,
  .esl-sol:focus-within .esl-sol__image {
    transform: scale(1);
  }

  .esl-sol:hover .esl-sol__vertical,
  .esl-sol:focus-within .esl-sol__vertical {
    opacity: 0;
  }

  .esl-sol:hover .esl-sol__corps,
  .esl-sol:focus-within .esl-sol__corps {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition: opacity 400ms var(--ease-out) 220ms, transform 500ms var(--ease-out) 220ms, visibility 0s;
  }

  /* Sans survol ni focus, la première carte reste ouverte. */
  .esl-solutions__liste:not(:has(.esl-sol:hover, .esl-sol:focus-within)) .esl-sol:first-child {
    flex-grow: 4;
  }

  .esl-solutions__liste:not(:has(.esl-sol:hover, .esl-sol:focus-within)) .esl-sol:first-child .esl-sol__image {
    transform: scale(1);
  }

  .esl-solutions__liste:not(:has(.esl-sol:hover, .esl-sol:focus-within)) .esl-sol:first-child .esl-sol__vertical {
    opacity: 0;
  }

  .esl-solutions__liste:not(:has(.esl-sol:hover, .esl-sol:focus-within)) .esl-sol:first-child .esl-sol__corps {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition: opacity 400ms var(--ease-out) 220ms, transform 500ms var(--ease-out) 220ms, visibility 0s;
  }
}

@media (max-width: 767px) {
  .esl-solutions__tete {
    grid-template-columns: 1fr;
  }

  .esl-solutions__liste {
    grid-template-columns: 1fr;
  }

  .esl-sol {
    min-height: 300px;
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .esl-sol,
  .esl-sol__image,
  .esl-sol__corps,
  .esl-sol__fleche {
    transition: none !important;
  }
}
