/*
 * Cap Portage V12.4.1 — cohérence et visibilité des icônes.
 * Chargé après toutes les couches historiques.
 */

/* Une icône placée dans un bouton doit toujours suivre la couleur du texte. */
.btn .dashicons,
.btn [class^="dashicons-"],
.btn [class*=" dashicons-"],
.btn svg,
a[role="button"] svg,
button svg {
  color: currentColor !important;
  fill: currentColor;
  stroke: currentColor;
  opacity: 1 !important;
  visibility: visible !important;
  flex: 0 0 auto;
}

.btn .dashicons {
  display: inline-flex;
  width: 1.2em;
  height: 1.2em;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  line-height: 1;
}

/* Le bouton clair sur fond sombre garde un contraste stable. */
.bg-navy .btn--white,
.bg-gradient-navy .btn--white,
section[style*="background:var(--cp-navy)"] .btn--white {
  background: #fff !important;
  border-color: #fff !important;
  color: #071529 !important;
}

.bg-navy .btn--white:hover,
.bg-gradient-navy .btn--white:hover,
section[style*="background:var(--cp-navy)"] .btn--white:hover {
  background: #f8f5ee !important;
  border-color: #f8f5ee !important;
  color: #071529 !important;
}

/* Icônes de cartes : contraste lisible sur fond clair et sombre. */
.card-icon,
.feature-card__icon,
.metier-card__icon,
.cp-audience-icon,
.v6-sector__icon,
.v6-benefit__icon {
  opacity: 1 !important;
  visibility: visible !important;
}

.card-icon--blue,
.v6-sector__icon,
.v6-benefit__icon {
  color: #1d4ed8 !important;
}

.card--navy .card-icon,
.card--navy .dashicons,
.bg-navy .dashicons,
.bg-gradient-navy .dashicons {
  color: #E7C878 !important;
}

/* Les liens sociaux conservent une couleur visible au repos et au survol. */
.footer a[aria-label] {
  color: rgba(255, 255, 255, .78) !important;
}

.footer a[aria-label]:hover,
.footer a[aria-label]:focus-visible {
  color: #E7C878 !important;
}

.footer a[aria-label] svg {
  fill: currentColor !important;
  stroke: none;
}

.footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  min-height: 44px;
  margin-top: 1.5rem;
}

.footer__social:empty {
  display: none;
}

.footer__social a {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .82) !important;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.footer__social a:hover,
.footer__social a:focus-visible {
  border-color: #E7C878;
  background: rgba(231, 200, 120, .14);
  color: #E7C878 !important;
}

/* Sécurité d'affichage : aucun contenu essentiel ne doit dépendre du bon
   démarrage de l'animation JavaScript reveal-on-scroll. */
.reveal,
.reveal.visible,
.reveal--left,
.reveal--right {
  opacity: 1 !important;
  transform: none !important;
}

/* Hero commun aux pages internes : même hauteur utile, titres capables de
   revenir à la ligne et aucune zone qui dépasse horizontalement. */
.hero:not(.hero--home) {
  min-height: 0 !important;
  padding-top: calc(var(--navbar-h) + clamp(2.25rem, 4vw, 3.5rem)) !important;
  padding-bottom: clamp(2.75rem, 5vw, 4rem) !important;
  overflow: hidden !important;
}

.hero:not(.hero--home) .hero__inner {
  width: 100%;
  min-width: 0;
  max-width: 1240px !important;
  margin-inline: auto !important;
  padding-right: min(46vw, 620px) !important;
}

.hero:not(.hero--home) .hero__title {
  width: 100%;
  max-width: 650px;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 4.45vw, 4rem) !important;
  line-height: 1.04;
  letter-spacing: -.04em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.hero:not(.hero--home) .hero__subtitle {
  width: 100%;
  max-width: 600px;
  font-family: var(--font-body);
  font-size: 1rem !important;
  line-height: 1.65;
}

/* Échelle typographique commune : mêmes familles et mêmes proportions sur
   toutes les pages, sans modifier la hiérarchie éditoriale. */
body:not(.home) main h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -.025em;
}

body:not(.home) main h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.2;
}

body:not(.home) main :where(p, li, label, input, select, textarea, button) {
  font-family: var(--font-body);
}

.hero:not(.hero--home) .gradient-text {
  white-space: normal !important;
}

@media (max-width: 600px) {
  .hero:not(.hero--home) {
    padding-top: calc(var(--navbar-h) + 2rem) !important;
    padding-bottom: 2.5rem !important;
  }

  .hero:not(.hero--home) .hero__title {
    font-size: clamp(2rem, 11vw, 3rem) !important;
  }
}

@media (max-width: 900px) {
  .hero:not(.hero--home) .hero__inner {
    max-width: 720px !important;
    padding-right: 0 !important;
  }

  body:not(.home) :where(.hero,.page-hero)::after {
    opacity: .12;
  }
}

/* Grille et géométrie communes pour les icônes de contenu. */
:where(.card-icon,.feature-card__icon,.metier-card__icon,.cp-audience-icon,.v6-sector__icon,.v6-benefit__icon) {
  display: inline-flex !important;
  width: clamp(38px, 3.2vw, 44px) !important;
  height: clamp(38px, 3.2vw, 44px) !important;
  flex: 0 0 clamp(38px, 3.2vw, 44px);
  align-items: center;
  justify-content: center;
  margin: 0 0 1rem !important;
  border-radius: 50% !important;
  font-size: clamp(18px, 1.7vw, 21px) !important;
  line-height: 1 !important;
}

:where(.grid-3,.grid-4,.features-grid,.cp-audience-grid) {
  align-items: stretch;
}

:where(.card,.feature-card,.metier-card,.cp-audience-card) {
  min-width: 0;
}

:where(.card,.feature-card,.metier-card,.cp-audience-card) > :where(.card-icon,.feature-card__icon,.metier-card__icon,.cp-audience-icon) {
  align-self: flex-start;
}

/* Formulaire de rappel : libellés et valeurs toujours lisibles. */
.sim-cta {
  background: rgba(255, 255, 255, .07) !important;
  color: #fff !important;
}

.sim-cta-teaser {
  color: rgba(255, 255, 255, .76) !important;
}

.sim-lead-fields {
  gap: .8rem !important;
}

.sim-lead-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  color: #fff !important;
}

.sim-lead-field__label {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: #fff !important;
  font-size: .78rem;
  font-weight: 700;
}

.sim-lead-field__label .dashicons {
  width: 20px;
  height: 20px;
  color: #E7C878 !important;
  font-size: 18px;
}

.sim-lead-field__label strong {
  color: #E7C878;
}

.sim-lead-fields .sim-lead-field input {
  min-height: 50px;
  padding: .75rem .9rem !important;
  border: 1.5px solid rgba(255, 255, 255, .34) !important;
  background: #fff !important;
  color: #071529 !important;
  -webkit-text-fill-color: #071529 !important;
  opacity: 1 !important;
}

.sim-lead-fields .sim-lead-field input::placeholder {
  color: #687386 !important;
  -webkit-text-fill-color: #687386 !important;
  opacity: 1 !important;
}

.sim-lead-fields .sim-lead-field input:focus {
  border-color: #E7C878 !important;
  outline: 3px solid rgba(231, 200, 120, .28) !important;
  outline-offset: 1px;
}

.sim-cta .sim-consent,
.sim-cta .sim-consent span {
  color: rgba(255, 255, 255, .9) !important;
}

.sim-cta .btn--blue {
  background: linear-gradient(135deg, #C8A96B, #E7C878) !important;
  border-color: #E7C878 !important;
  color: #071529 !important;
  -webkit-text-fill-color: #071529 !important;
  font-weight: 800;
}

.sim-cta .btn--blue:hover,
.sim-cta .btn--blue:focus-visible {
  background: #fff !important;
  border-color: #fff !important;
  color: #071529 !important;
}

/* Résultat du simulateur visible immédiatement : aucune action requise. */
.sim-result-details--visible {
  display: block !important;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, .18);
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}

.sim-total-heading {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin-bottom: .9rem;
  color: #fff;
  font-weight: 800;
}

.sim-total-heading small {
  color: rgba(255, 255, 255, .66);
  font-size: .72rem;
  font-weight: 500;
}

.sim-result-details--visible .sim-result-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 !important;
}

.sim-result-details--visible .sim-result-item--emphasis {
  order: -1;
  padding: 1.2rem !important;
  border: 1px solid rgba(231, 200, 120, .7) !important;
  background: rgba(231, 200, 120, .13) !important;
}

.sim-result-details--visible .sim-result-item--emphasis .sim-result-item-label {
  color: #fff !important;
  font-weight: 700;
}

.sim-result-details--visible .sim-result-item--emphasis .sim-result-item-val {
  color: #E7C878 !important;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
}

.sim-total-legal {
  margin: .9rem 0 0;
  color: rgba(255, 255, 255, .62);
  font-size: .7rem;
  line-height: 1.55;
}

.sim-contact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.sim-contact-action {
  display: flex;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: .7rem;
  padding: .8rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  color: #fff !important;
  text-decoration: none;
}

.sim-contact-action:hover,
.sim-contact-action:focus-visible {
  border-color: #E7C878;
  background: rgba(231, 200, 120, .12);
}

.sim-contact-action--identity {
  cursor: default;
}

.cp-contact-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #E7C878;
  color: #071529 !important;
  font-size: 18px;
}

.sim-contact-action span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sim-contact-action small {
  display: block;
  margin-bottom: .12rem;
  color: rgba(255, 255, 255, .62);
  font-size: .68rem;
}

.footer__links .cp-contact-icon {
  width: 24px;
  height: 24px;
  margin-right: .45rem;
  vertical-align: middle;
  font-size: 14px;
}

@media (max-width: 600px) {
  :where(.card-icon,.feature-card__icon,.metier-card__icon,.cp-audience-icon,.v6-sector__icon,.v6-benefit__icon) {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px;
    margin-bottom: .75rem !important;
    font-size: 18px !important;
  }

  .sim-result-details--visible .sim-result-grid {
    grid-template-columns: 1fr;
  }

  .sim-contact-actions {
    grid-template-columns: 1fr;
  }
}

/* V12.4.11 — garde-fou global Hero.
   Objectif : supprimer définitivement les lettres coupées / titres trop
   étroits sur FAQ, SASU, pages secteurs, villes, métiers et pages éditoriales.
   Cette couche est chargée en dernier et neutralise les anciens conflits entre
   max-width, padding-right d'illustration et styles inline historiques. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body:not(.home) :where(.hero,.page-hero,.sector-hero,.city-hero,.metier-hero,.cp-v3-hero) {
  min-height: 0 !important;
  padding-top: calc(var(--navbar-h) + clamp(2rem, 3.3vw, 3rem)) !important;
  padding-bottom: clamp(2.4rem, 4vw, 3.35rem) !important;
  overflow: hidden !important;
}

body:not(.home) :where(
  .hero__inner,
  .page-hero > .container,
  .page-hero .container,
  .sector-hero__layout,
  .city-hero > .container,
  .city-hero .container,
  .metier-hero__inner,
  .cp-v3-hero > .container,
  .cp-v3-hero .container
) {
  width: 100% !important;
  max-width: 1240px !important;
  min-width: 0 !important;
  margin-inline: auto !important;
  padding-right: clamp(380px, 43vw, 600px) !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

body:not(.home) :where(
  .hero__title,
  .page-hero h1,
  .sector-hero h1,
  .city-hero h1,
  .metier-hero h1,
  .cp-v3-hero h1
) {
  display: block !important;
  width: min(100%, 650px) !important;
  max-width: 650px !important;
  margin-inline: 0 !important;
  font-size: clamp(2.25rem, 3.45vw, 3.1rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -.035em !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  hyphens: auto !important;
  text-wrap: balance;
}

body:not(.home) :where(.hero__title,.page-hero h1,.sector-hero h1,.city-hero h1,.metier-hero h1,.cp-v3-hero h1) :where(span,strong,em) {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body:not(.home) :where(
  .hero__subtitle,
  .page-hero p,
  .sector-hero p,
  .city-hero p,
  .metier-hero p,
  .cp-v3-hero p
) {
  width: min(100%, 610px) !important;
  max-width: 610px !important;
  margin-inline: 0 !important;
  font-size: 1rem !important;
  line-height: 1.62 !important;
}

body:not(.home) :where(.hero__ctas,.sector-hero__actions,.city-hero__actions) {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

body:not(.home) main h2 {
  font-size: clamp(1.7rem, 2.35vw, 2.25rem) !important;
  line-height: 1.14 !important;
  text-wrap: balance;
}

body:not(.home) main h3 {
  font-size: clamp(1.2rem, 1.75vw, 1.48rem) !important;
}

@media (min-width: 981px) and (max-width: 1120px) {
  body:not(.home) :where(
    .hero__inner,
    .page-hero > .container,
    .page-hero .container,
    .sector-hero__layout,
    .city-hero > .container,
    .city-hero .container,
    .metier-hero__inner,
    .cp-v3-hero > .container,
    .cp-v3-hero .container
  ) {
    padding-right: clamp(300px, 38vw, 430px) !important;
  }
}

@media (max-width: 980px) {
  body:not(.home) :where(
    .hero__inner,
    .page-hero > .container,
    .page-hero .container,
    .sector-hero__layout,
    .city-hero > .container,
    .city-hero .container,
    .metier-hero__inner,
    .cp-v3-hero > .container,
    .cp-v3-hero .container
  ) {
    max-width: 760px !important;
    padding-right: 0 !important;
    text-align: center !important;
  }

  body:not(.home) :where(.hero__title,.page-hero h1,.sector-hero h1,.city-hero h1,.metier-hero h1,.cp-v3-hero h1),
  body:not(.home) :where(.hero__subtitle,.page-hero p,.sector-hero p,.city-hero p,.metier-hero p,.cp-v3-hero p) {
    margin-inline: auto !important;
  }

  body:not(.home) :where(.hero,.page-hero,.sector-hero,.city-hero,.metier-hero,.cp-v3-hero)::after {
    right: 50% !important;
    transform: translateX(50%) !important;
    width: min(62vw, 420px) !important;
    opacity: .1 !important;
  }
}

@media (max-width: 760px) {
  body:not(.home) :where(.hero,.page-hero,.sector-hero,.city-hero,.metier-hero,.cp-v3-hero) {
    padding-top: calc(var(--navbar-h) + 1.65rem) !important;
    padding-bottom: 2.15rem !important;
  }

  body:not(.home) :where(.hero,.page-hero,.sector-hero,.city-hero,.metier-hero,.cp-v3-hero)::after {
    display: none !important;
  }

  body:not(.home) :where(.hero__title,.page-hero h1,.sector-hero h1,.city-hero h1,.metier-hero h1,.cp-v3-hero h1) {
    font-size: clamp(2rem, 9.4vw, 2.8rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -.03em !important;
    overflow-wrap: anywhere !important;
  }
}

/* V12.4.11 — Hero accueil légèrement plus dense et plus confortable à lire. */
body.home .cp-v3-hero__content h1 {
  max-width: 620px !important;
  font-size: clamp(2.75rem, 4.15vw, 3.9rem) !important;
  line-height: 1.03 !important;
  letter-spacing: -.045em !important;
  overflow-wrap: anywhere !important;
  text-wrap: balance;
}

body.home .cp-v3-hero__lead {
  max-width: 560px !important;
  font-size: 1rem !important;
  line-height: 1.6 !important;
}

@media (max-width: 760px) {
  body.home .cp-v3-hero__content h1 {
    font-size: clamp(2.35rem, 11vw, 3.25rem) !important;
  }
}

/* V12.4.11 — menu déroulant : sur tablette/mobile, le bloc reste dans le flux
   normal afin de pousser le contenu au lieu de masquer le centre de page. */
@media (max-width: 1024px) {
  .navbar__mobile:not([hidden]),
  .navbar__mobile.open {
    position: static !important;
    max-height: calc(100dvh - var(--navbar-h, 72px));
    overflow-y: auto;
  }

  .navbar__dropdown-menu,
  .navbar__dropdown-menu.open {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: .35rem 0 .65rem !important;
    opacity: 1;
    visibility: visible;
    transform: none !important;
    box-shadow: none !important;
  }

  .navbar__dropdown-menu:not(.open) {
    display: none !important;
  }
}

/* V12.4.11 — formulaire de rappel simulateur : labels visibles, champs plus
   compacts et contraste renforcé sur fond sombre. */
.sim-cta {
  padding: clamp(1rem, 2vw, 1.35rem) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  border-radius: 18px !important;
}

.sim-cta-teaser {
  margin: 0 0 .9rem !important;
  font-size: clamp(1rem, 1.7vw, 1.25rem) !important;
  line-height: 1.35 !important;
  color: rgba(255, 255, 255, .88) !important;
}

.sim-lead-form {
  gap: .7rem !important;
}

.sim-lead-fields {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: .65rem !important;
}

.sim-lead-field {
  gap: .3rem !important;
}

.sim-lead-field__label {
  min-height: 22px;
  color: #fff !important;
  font-size: .82rem !important;
  line-height: 1.2 !important;
}

.sim-lead-fields .sim-lead-field input {
  min-height: 46px !important;
  border-radius: 11px !important;
}

.sim-cta .sim-consent {
  align-items: flex-start;
  gap: .65rem !important;
  margin-top: .2rem !important;
  font-size: .88rem !important;
  line-height: 1.45 !important;
}

.sim-cta .sim-consent input {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  margin-top: .1rem !important;
}

.sim-cta .btn--blue {
  min-height: 50px !important;
  margin-top: .35rem !important;
  border-radius: 999px !important;
}

@media (min-width: 860px) {
  .sim-lead-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
