/*
 * Maison Plus Libre — UX & accessibilité globale
 * Cette couche passe après les feuilles de direction artistique.
 * Objectif : compréhension, lisibilité, navigation et confort avant micro-effets graphiques.
 */

:root {
  --mpl-ux-text: #14362e;
  --mpl-ux-muted: #52635d;
  --mpl-ux-muted-strong: #43564f;
  --mpl-ux-dark-text: #d8e1de;
  --mpl-ux-focus-light: #ffffff;
  --mpl-ux-focus-dark: #102d27;
  --mpl-ux-target: 44px;
}

html {
  font-size: 100%;
  scroll-padding-top: 104px;
}

body {
  font-size: 1rem;
  line-height: 1.68;
}

#main-content,
[id] {
  scroll-margin-top: 104px;
}

/* Focus visible sur fond clair comme foncé. */
:focus-visible {
  outline: 3px solid var(--mpl-ux-focus-light) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px var(--mpl-ux-focus-dark) !important;
}

/* -----------------------------------------------------------------
   HEADER / NAVIGATION
   ----------------------------------------------------------------- */

body.mpl-design-v4 .mpl-header-inner,
.mpl-header-inner {
  min-height: 80px;
  gap: clamp(18px, 2.4vw, 34px);
}

body.mpl-design-v4 .mpl-brand__copy strong,
.mpl-brand__copy strong {
  font-size: 1rem;
  line-height: 1.08;
}

body.mpl-design-v4 .mpl-brand__copy small,
.mpl-brand__copy small {
  color: #53635e;
  font-size: .8125rem;
  line-height: 1.2;
  letter-spacing: .045em;
  text-transform: none;
}

body.mpl-design-v4 .mpl-primary-nav ul,
.mpl-primary-nav ul {
  gap: 4px;
}

body.mpl-design-v4 .mpl-primary-nav a,
.mpl-primary-nav a {
  min-height: var(--mpl-ux-target);
  align-items: center;
  padding: 0 12px;
  color: #354b43;
  font-size: .9375rem;
  font-weight: 730;
  line-height: 1.2;
}

body.mpl-design-v4 .mpl-primary-nav a:hover,
.mpl-primary-nav a:hover {
  color: #102d27;
  background: rgba(20,54,46,.075);
}

body.mpl-design-v4 .mpl-primary-nav a[aria-current="page"],
.mpl-primary-nav a[aria-current="page"] {
  color: #fff;
  background: #173f35;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

body.mpl-design-v4 .mpl-header-cta,
.mpl-header-cta {
  min-height: 46px;
  padding-inline: 18px;
  font-size: .9375rem;
  line-height: 1.2;
}

.mpl-mobile-nav summary {
  width: 46px;
  height: 46px;
}

.mpl-mobile-nav__panel {
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mpl-mobile-nav__head {
  display: grid;
  gap: 7px;
}

.mpl-mobile-nav__head strong {
  font-size: 1.12rem;
  line-height: 1.3;
}

.mpl-mobile-nav__head small {
  color: #c3cfcc;
  font-size: .9375rem;
  line-height: 1.45;
}

.mpl-mobile-nav__panel nav a {
  min-height: 56px;
  align-items: center;
  padding: 14px 4px;
  font-size: 1.08rem;
  line-height: 1.3;
}

.mpl-mobile-nav__panel nav a span {
  min-width: 28px;
  color: #aebdb9;
  font-size: .8125rem;
}

.mpl-mobile-nav__panel nav a[aria-current="page"] {
  color: #ffca72;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.mpl-mobile-nav__cta {
  min-height: 50px;
  align-items: center;
  font-size: 1rem;
}

/* Les libellés plus explicites nécessitent un passage au menu mobile plus tôt. */
@media (max-width: 1240px) {
  .mpl-primary-nav,
  .mpl-header-cta {
    display: none !important;
  }

  .mpl-mobile-nav {
    display: block !important;
    justify-self: end;
  }

  .mpl-header-inner {
    grid-template-columns: auto 1fr auto !important;
  }
}

/* -----------------------------------------------------------------
   HOMEPAGE : tailles utiles, pas de micro-textes décoratifs
   ----------------------------------------------------------------- */

body.mpl-is-front-page .mpl4-kicker {
  font-size: .875rem;
  line-height: 1.35;
  letter-spacing: .075em;
}

body.mpl-is-front-page .mpl4-hero__lead {
  color: var(--mpl-ux-muted);
  font-size: clamp(1.05rem, 1.35vw, 1.18rem);
  line-height: 1.62;
}

body.mpl-is-front-page .mpl4-btn {
  min-height: 48px;
  padding-inline: 20px;
  font-size: .9375rem;
}

body.mpl-is-front-page .mpl4-proof {
  gap: 12px 22px;
  color: #53635e;
  font-size: .875rem;
  line-height: 1.4;
  letter-spacing: .015em;
  text-transform: none;
}

body.mpl-is-front-page .mpl4-system__label {
  font-size: .875rem;
}

body.mpl-is-front-page .mpl4-system__label b {
  width: 30px;
  height: 30px;
  font-size: .75rem;
}

body.mpl-is-front-page .mpl4-system__caption span {
  color: rgba(255,255,255,.72);
  font-size: .8125rem;
  letter-spacing: .04em;
}

body.mpl-is-front-page .mpl4-system__caption strong {
  font-size: 1.05rem;
  line-height: 1.35;
}

body.mpl-is-front-page .mpl4-flow-tab {
  min-height: 112px;
}

body.mpl-is-front-page .mpl4-flow-tab > span {
  font-size: .8125rem;
}

body.mpl-is-front-page .mpl4-flow-tab strong {
  font-size: 1rem;
  line-height: 1.25;
}

body.mpl-is-front-page .mpl4-flow-tab small {
  font-size: .875rem;
  line-height: 1.4;
}

body.mpl-is-front-page .mpl4-lever__index,
body.mpl-is-front-page .mpl4-lever__name small,
body.mpl-is-front-page .mpl4-compass__steps span,
body.mpl-is-front-page .mpl4-guide-list small,
body.mpl-is-front-page .mpl4-featured__copy > span,
body.mpl-is-front-page .mpl4-score__criteria span {
  font-size: .8125rem;
}

body.mpl-is-front-page .mpl4-lever > p,
body.mpl-is-front-page .mpl4-budget-line article p {
  font-size: .9375rem;
  line-height: 1.55;
}

/* -----------------------------------------------------------------
   PAGES STATIQUES : hero, parcours, lecture
   ----------------------------------------------------------------- */

.mpl-static-hero {
  padding-top: clamp(62px, 6vw, 88px);
  padding-bottom: clamp(58px, 6vw, 86px);
}

.mpl-static-hero__grid {
  grid-template-columns: minmax(0, 720px) minmax(320px, 420px);
  justify-content: space-between;
  gap: clamp(42px, 5vw, 72px);
  align-items: center;
}

.mpl-static-kicker {
  margin-bottom: 18px;
  color: var(--mpl-ux-muted-strong);
  font-size: .875rem;
  line-height: 1.35;
  letter-spacing: .06em;
}

.mpl-static-hero h1 {
  max-width: 780px;
  font-size: clamp(2.8rem, 4.7vw, 4.8rem);
  font-weight: 760;
  line-height: .98;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.mpl-static-hero__lead {
  max-width: 700px;
  margin-top: 24px;
  color: var(--mpl-ux-muted);
  font-size: clamp(1.18rem, 1.8vw, 1.55rem);
  line-height: 1.47;
}

.mpl-static-hero__trust {
  gap: 10px 22px;
  margin-top: 30px;
  color: #53635e;
  font-size: .875rem;
  line-height: 1.4;
  letter-spacing: .01em;
  text-transform: none;
}

.mpl-static-system {
  width: min(100%, 420px);
  min-height: 370px;
  justify-self: end;
  padding: 28px;
}

.mpl-static-system__legend span {
  font-size: .8125rem;
  line-height: 1.3;
  letter-spacing: .025em;
  text-transform: none;
}

.mpl-static-system > small {
  color: rgba(255,255,255,.72);
  font-size: .875rem;
  line-height: 1.5;
}

.mpl-pillar-map {
  padding: 30px 0 32px;
}

.mpl-pillar-map .mpl-shell {
  grid-template-columns: minmax(210px,.7fr) minmax(0,2fr);
  gap: 26px 48px;
}

.mpl-pillar-map__intro span {
  color: #53635e;
  font-size: .8125rem;
  line-height: 1.35;
  letter-spacing: .06em;
}

.mpl-pillar-map__intro strong {
  font-size: 1.22rem;
  line-height: 1.35;
}

.mpl-pillar-map__steps li {
  min-height: 104px;
  padding-top: 17px;
}

.mpl-pillar-map__steps b {
  color: #64736e;
  font-size: .8125rem;
}

.mpl-pillar-map__steps span {
  font-size: .9375rem;
  line-height: 1.45;
}

.mpl-pillar-map__nav {
  gap: 9px;
}

.mpl-pillar-map__nav a {
  min-height: var(--mpl-ux-target);
  padding: 0 16px;
  color: #354b43;
  font-size: .9375rem;
  font-weight: 740;
}

.mpl-pillar-map__nav a.is-active {
  color: #102d27;
  border-color: var(--page-signal);
  background: var(--page-signal-soft);
  box-shadow: inset 0 0 0 2px var(--page-signal);
}

.mpl-static-layout {
  grid-template-columns: minmax(220px,250px) minmax(0,760px);
  gap: clamp(48px, 6vw, 90px);
  padding-top: clamp(62px, 7vw, 96px);
  padding-bottom: clamp(76px, 8vw, 120px);
}

.mpl-static-aside span {
  color: #53635e;
  font-size: .8125rem;
  line-height: 1.35;
  letter-spacing: .055em;
}

.mpl-static-aside strong {
  font-size: 1.42rem;
  line-height: 1.2;
}

.mpl-static-aside p {
  color: #52635d;
  font-size: 1rem;
  line-height: 1.62;
}

.mpl-static-content {
  max-width: 760px;
  overflow-wrap: break-word;
}

.mpl-static-content > p:first-child {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.5;
}

.mpl-static-content p,
.mpl-static-content li {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.mpl-static-content h2 {
  margin-top: 2em;
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.mpl-static-content h3 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.18;
}

.mpl-static-content blockquote {
  font-size: 1.3rem;
  line-height: 1.5;
}

.mpl-static-content table {
  font-size: 1rem;
  line-height: 1.5;
}

.mpl-static-content th {
  font-size: .875rem;
  line-height: 1.35;
  letter-spacing: .025em;
  text-transform: none;
}

.mpl-static-content th,
.mpl-static-content td {
  padding: 15px 13px;
}

.mpl-static-next span {
  color: rgba(255,255,255,.72);
  font-size: .875rem;
  letter-spacing: .04em;
}

.mpl-static-next a {
  min-height: 48px;
  font-size: .9375rem;
}

/* -----------------------------------------------------------------
   ARTICLES / LISTES FUTURES
   ----------------------------------------------------------------- */

.mpl-reading h1 {
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.05em;
  text-wrap: balance;
}

.mpl-article-lead,
.mpl-article-content {
  font-size: 1.0625rem;
  line-height: 1.72;
}

.mpl-overline,
.mpl-section-index,
.mpl-need__head,
.mpl-axis-index,
.mpl-home-console__top small,
.mpl-home-console__axis small,
.mpl-home-console__foot,
.mpl-budget-step > span:last-child,
.mpl-editorial-row__index,
.mpl-editorial-row__meta,
.mpl-score-criteria span {
  font-size: .8125rem;
  line-height: 1.4;
}

.mpl-button,
.mpl-text-link,
.mpl-need__link {
  font-size: .9375rem;
}

.mpl-editorial-row__arrow,
.nav-links .page-numbers {
  min-width: var(--mpl-ux-target);
  min-height: var(--mpl-ux-target);
  align-items: center;
  justify-content: center;
}

.nav-links .page-numbers {
  display: inline-flex;
}

/* -----------------------------------------------------------------
   FOOTER
   ----------------------------------------------------------------- */

.mpl-footer-label {
  color: rgba(255,255,255,.72) !important;
  font-size: .875rem !important;
  line-height: 1.35;
  letter-spacing: .045em;
}

.mpl-footer-nav-wrap ul {
  gap: 4px !important;
}

.mpl-footer-nav-wrap a,
.mpl-site-footer nav a {
  display: inline-flex;
  min-height: var(--mpl-ux-target);
  align-items: center;
  color: #d3dcda;
  font-size: 1rem;
  line-height: 1.35;
}

.mpl-footer-note strong {
  max-width: 280px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.mpl-footer-note > p:not(.mpl-footer-label) {
  margin: 14px 0 0;
  color: #c3cfcc;
  font-size: .9375rem;
  line-height: 1.55;
}

.mpl-footer-note a {
  color: #fff;
  text-underline-offset: 4px;
}

.mpl-footer-bottom {
  color: #aebdb9;
  font-size: .875rem;
  line-height: 1.4;
  letter-spacing: .025em;
  text-transform: none;
}

/* -----------------------------------------------------------------
   REFLOW / MOBILE
   ----------------------------------------------------------------- */

@media (max-width: 980px) {
  .mpl-static-hero__grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .mpl-static-hero__copy {
    max-width: 760px;
  }

  .mpl-static-system {
    width: min(100%, 520px);
    justify-self: start;
  }

  .mpl-pillar-map .mpl-shell,
  .mpl-static-layout {
    grid-template-columns: 1fr;
  }

  .mpl-pillar-map__nav {
    grid-column: 1;
  }

  .mpl-static-aside {
    position: static;
    max-width: 700px;
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 84px;
  }

  #main-content,
  [id] {
    scroll-margin-top: 84px;
  }

  .mpl-shell,
  body.mpl-design-v4 .mpl-shell,
  .mpl-reading {
    width: min(calc(100% - 32px), var(--mpl-wide));
  }

  .mpl-header-inner {
    min-height: 70px;
  }

  .mpl-brand__copy strong,
  body.mpl-design-v4 .mpl-brand__copy strong {
    font-size: .9375rem;
  }

  .mpl-static-hero {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .mpl-static-hero h1 {
    font-size: clamp(2.35rem, 10.5vw, 3.45rem);
    line-height: 1.02;
  }

  .mpl-static-hero__lead {
    font-size: 1.15rem;
  }

  /* Le schéma est décoratif. Sur petit écran, le contenu passe avant. */
  .mpl-static-system {
    display: none;
  }

  .mpl-pillar-map__steps {
    grid-template-columns: 1fr;
    border-top: 0;
  }

  .mpl-pillar-map__steps li,
  .mpl-pillar-map__steps li:not(:first-child) {
    min-height: 0;
    padding: 14px 0;
    border-top: 1px solid rgba(20,54,46,.14);
    border-right: 0;
  }

  .mpl-pillar-map__steps li::before,
  .mpl-pillar-map__steps li:not(:first-child)::before {
    display: none;
  }

  .mpl-pillar-map__steps b {
    margin-bottom: 5px;
  }

  .mpl-pillar-map__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mpl-pillar-map__nav a {
    justify-content: center;
    text-align: center;
  }

  .mpl-static-layout {
    gap: 38px;
    padding-top: 52px;
    padding-bottom: 72px;
  }

  .mpl-static-aside {
    padding: 18px 0 18px 18px;
  }

  .mpl-static-content p,
  .mpl-static-content li {
    font-size: 1rem;
    line-height: 1.72;
  }

  .mpl-static-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mpl-static-next__inner {
    align-items: flex-start;
  }

  .mpl-static-next a {
    width: 100%;
    justify-content: space-between;
  }

  .mpl-footer-bottom {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .mpl-pillar-map__nav {
    grid-template-columns: 1fr;
  }

  body.mpl-is-front-page .mpl4-proof {
    display: grid;
    gap: 10px;
  }

  body.mpl-is-front-page .mpl4-flow-tab {
    min-height: 102px;
    padding-inline: 18px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --mpl-ux-muted: #314740;
    --mpl-ux-muted-strong: #243c34;
  }

  .mpl-static-content a,
  .mpl-footer-note a {
    text-decoration-thickness: 2px;
  }
}
