/* ==========================================================================
   B1NG — Styles du template « prix-pose » (money pages) pour Twenty Twenty-Four
   --------------------------------------------------------------------------
   Installation : soit Apparence → Éditeur → Styles → CSS additionnel (coller tout),
   soit déposer ce fichier dans /wp-content/uploads/b1ng/ (enfilé automatiquement
   par le snippet b1ng-shortcodes.php sur les pages et articles).

   Structure HTML attendue dans le contenu de la page (bloc HTML personnalisé) :

   <div class="mp alignwide">
     <header class="mp-hero">
       <p class="mp-hero__kicker">Guide des prix 2026</p>
       <h1 class="mp-hero__title">Prix de l’étanchéité d’un toit-terrasse : tarifs 2026 au m²</h1>
       <p class="mp-hero__byline">Par <a href="/a-propos/">la rédaction Prix Étanchéité</a> · Mis à jour le 24 septembre 2026 · <a href="#methode">Méthode</a></p>
       [b1ng_essentiel] … [/b1ng_essentiel]
     </header>
     <div class="mp-layout">
       <div class="mp-main"> … contenu, tableaux, [b1ng_jauge], FAQ, bloc auteur … </div>
       <aside class="mp-sidebar">[b1ng_devis_form variant="sidebar"]</aside>
     </div>
     [b1ng_sticky_cta]
   </div>

   Mobile-first, aucune police externe, palette bleu profond + accent orange.
   ========================================================================== */

:root {
  --mp-bleu: #14345c;
  --mp-bleu-fonce: #0d2340;
  --mp-bleu-clair: #e8eef7;
  --mp-orange: #e8792b;
  --mp-orange-fonce: #c9621b;
  --mp-orange-clair: #fff3e9;
  --mp-texte: #1f2933;
  --mp-muted: #5f6b7a;
  --mp-bord: #d6dde6;
  --mp-fond-doux: #f5f7fa;
  --mp-ok: #1b7f4b;
  --mp-radius: 12px;
  --mp-ombre: 0 6px 24px rgba(20, 52, 92, 0.08);
  --mp-gutter: 16px;
  --mp-sidebar-w: 340px;
}

/* --------------------------------------------------------------------------
   Conteneur : largeur « wide » du thème, gouttière 16 px sur mobile
   -------------------------------------------------------------------------- */
.mp {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wp--style--global--wide-size, 1200px);
  margin-inline: auto;
  color: var(--mp-texte);
  line-height: 1.6;
  font-size: 1.0625rem;
}
.mp *, .mp *::before, .mp *::after { box-sizing: inherit; }
.mp img { max-width: 100%; height: auto; }
.mp a { color: var(--mp-bleu); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.mp a:hover { color: var(--mp-orange-fonce); }

.mp h2 {
  font-size: clamp(1.45rem, 1.2rem + 1.2vw, 1.9rem);
  line-height: 1.25;
  color: var(--mp-bleu);
  margin: 2.25rem 0 0.9rem;
  scroll-margin-top: 80px;
}
.mp h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  line-height: 1.3;
  color: var(--mp-bleu);
  margin: 1.6rem 0 0.6rem;
  scroll-margin-top: 80px;
}
.mp p, .mp ul, .mp ol { margin: 0 0 1rem; }
.mp ul, .mp ol { padding-left: 1.4rem; }
.mp li + li { margin-top: 0.3rem; }
.mp strong { color: var(--mp-bleu-fonce); }

/* --------------------------------------------------------------------------
   Hero : H1 + byline + encadré « L'essentiel »
   -------------------------------------------------------------------------- */
.mp-hero {
  padding: 1.25rem 0 0.5rem;
  border-bottom: 1px solid var(--mp-bord);
  margin-bottom: 1.5rem;
}
.mp-hero__kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mp-orange-fonce);
  background: var(--mp-orange-clair);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin: 0 0 0.75rem;
}
.mp-hero__title {
  font-size: clamp(1.75rem, 1.3rem + 2.4vw, 2.6rem);
  line-height: 1.15;
  font-weight: 800;
  color: var(--mp-bleu-fonce);
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}
.mp-hero__lead {
  font-size: 1.125rem;
  color: var(--mp-texte);
  margin: 0 0 0.75rem;
}
.mp-hero__byline {
  font-size: 0.9rem;
  color: var(--mp-muted);
  margin: 0 0 1.25rem;
}
.mp-hero__byline a { color: var(--mp-bleu); }

/* Encadré « L'essentiel » (shortcode [b1ng_essentiel]) */
.mp-essentiel {
  background: var(--mp-bleu-clair);
  border-left: 5px solid var(--mp-bleu);
  border-radius: 0 var(--mp-radius) var(--mp-radius) 0;
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem;
}
.mp-essentiel__title {
  font-weight: 800;
  color: var(--mp-bleu);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}
.mp-essentiel__body p:last-child, .mp-essentiel__body ul:last-child { margin-bottom: 0; }
.mp-essentiel__body li { margin-bottom: 0.35rem; }

/* --------------------------------------------------------------------------
   Mise en page : colonne principale + sidebar sticky (≥ 1024 px)
   -------------------------------------------------------------------------- */
.mp-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.mp-main { min-width: 0; }
.mp-sidebar { min-width: 0; }
.mp-sidebar__inner { position: static; }

@media (min-width: 1024px) {
  .mp-layout { grid-template-columns: minmax(0, 1fr) var(--mp-sidebar-w); gap: 2.5rem; align-items: start; }
  .mp-sidebar { position: sticky; top: 24px; }
  .mp-sidebar .b1ng-form { margin: 0; }
}

/* --------------------------------------------------------------------------
   Tableaux de prix : scroll horizontal + première colonne fixe sur mobile
   -------------------------------------------------------------------------- */
.mp-table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0 1.5rem;
  border: 1px solid var(--mp-bord);
  border-radius: var(--mp-radius);
  background: #fff;
  scrollbar-width: thin;
}
.mp-table-wrap table, .mp table.mp-table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  margin: 0;
}
.mp-table-wrap caption, .mp-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  color: var(--mp-bleu);
  padding: 0.75rem 0.9rem 0.25rem;
}
.mp-table-wrap th, .mp-table-wrap td, .mp-table th, .mp-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--mp-bord);
}
.mp-table-wrap thead th, .mp-table thead th {
  background: var(--mp-bleu);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.mp-table-wrap tbody tr:nth-child(even) td, .mp-table tbody tr:nth-child(even) td { background: var(--mp-fond-doux); }
.mp-table-wrap tbody tr:last-child td, .mp-table tbody tr:last-child td { border-bottom: 0; }
/* Première colonne fixe : reste lisible pendant le défilement horizontal */
.mp-table-wrap th:first-child, .mp-table-wrap td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  font-weight: 600;
  box-shadow: 2px 0 0 var(--mp-bord);
  min-width: 140px;
}
.mp-table-wrap thead th:first-child { background: var(--mp-bleu); z-index: 2; }
.mp-table-wrap tbody tr:nth-child(even) td:first-child { background: var(--mp-fond-doux); }
.mp-table-wrap td.mp-prix, .mp-table td.mp-prix { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--mp-bleu-fonce); font-weight: 700; }
.mp-table-hint {
  font-size: 0.85rem;
  color: var(--mp-muted);
  margin: -1rem 0 1.5rem;
}
@media (max-width: 640px) {
  .mp-table-hint::before { content: "→ Faites défiler le tableau horizontalement. "; }
}

/* --------------------------------------------------------------------------
   Encadré chiffre (chiffre clé + libellé + source)
   -------------------------------------------------------------------------- */
.mp-chiffres { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin: 1.25rem 0 1.5rem; }
@media (min-width: 600px) { .mp-chiffres { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.mp-chiffre {
  background: #fff;
  border: 1px solid var(--mp-bord);
  border-top: 4px solid var(--mp-orange);
  border-radius: var(--mp-radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--mp-ombre);
}
.mp-chiffre__valeur {
  display: block;
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  font-weight: 800;
  color: var(--mp-bleu-fonce);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.mp-chiffre__label { display: block; font-weight: 600; margin-top: 0.3rem; }
.mp-chiffre__source { display: block; font-size: 0.8rem; color: var(--mp-muted); margin-top: 0.25rem; }

/* --------------------------------------------------------------------------
   Jauge de prix (shortcode [b1ng_jauge])
   -------------------------------------------------------------------------- */
.mp-jauge { margin: 1.5rem 0 1.75rem; padding: 0; }
.mp-jauge__label { font-weight: 700; color: var(--mp-bleu); margin-bottom: 1.9rem; }
.mp-jauge__track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #cfe3d6 0%, #f8d9a0 55%, #f0a37a 100%);
  border: 1px solid var(--mp-bord);
}
.mp-jauge__marker {
  position: absolute;
  top: 50%;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--mp-orange);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
}
.mp-jauge__marker-value {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--mp-bleu);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}
.mp-jauge__marker-value::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--mp-bleu);
}
.mp-jauge__scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--mp-muted);
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.mp-jauge__moy { font-style: italic; }

/* --------------------------------------------------------------------------
   Blocs facteur → effet
   -------------------------------------------------------------------------- */
.mp-facteurs { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin: 1.25rem 0 1.5rem; padding: 0; list-style: none; }
@media (min-width: 720px) { .mp-facteurs { grid-template-columns: 1fr 1fr; } }
.mp-facteur {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  background: var(--mp-fond-doux);
  border: 1px solid var(--mp-bord);
  border-radius: var(--mp-radius);
  padding: 0.85rem 1rem;
  margin: 0;
}
.mp-facteur__nom { font-weight: 700; color: var(--mp-bleu); }
.mp-facteur__effet { color: var(--mp-texte); }
.mp-facteur__effet::before { content: "→ "; color: var(--mp-orange-fonce); font-weight: 700; }
.mp-facteur__impact {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mp-orange-fonce);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mp-facteur--baisse .mp-facteur__impact { color: var(--mp-ok); }

/* --------------------------------------------------------------------------
   Encadrés génériques : conseil, attention, citation
   -------------------------------------------------------------------------- */
.mp-note {
  border-left: 4px solid var(--mp-orange);
  background: var(--mp-orange-clair);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--mp-radius) var(--mp-radius) 0;
  margin: 1.25rem 0;
}
.mp-note--info { border-left-color: var(--mp-bleu); background: var(--mp-bleu-clair); }
.mp-note p:last-child { margin-bottom: 0; }
.mp-note__titre { font-weight: 700; display: block; margin-bottom: 0.25rem; }

/* CTA inline (dans le corps de texte) */
.mp-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  background: var(--mp-bleu);
  color: #fff;
  padding: 1rem 1.1rem;
  border-radius: var(--mp-radius);
  margin: 1.5rem 0;
}
.mp-cta p { margin: 0; flex: 1 1 240px; }
.mp-btn {
  display: inline-block;
  background: var(--mp-orange);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  padding: 0.8rem 1.25rem;
  border-radius: 8px;
  min-height: 48px;
  line-height: 1.5;
  transition: background 0.15s;
}
.mp-btn:hover { background: var(--mp-orange-fonce); }
.mp-btn:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.6); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   FAQ (complément à b1ng-faq.php : titre de section)
   -------------------------------------------------------------------------- */
.faq-vdl > h2 { margin-top: 2.25rem; }

/* --------------------------------------------------------------------------
   Bloc auteur / méthode
   -------------------------------------------------------------------------- */
.mp-auteur {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--mp-bord);
  border-radius: var(--mp-radius);
  padding: 1.1rem 1.2rem;
  margin: 2rem 0 1rem;
  scroll-margin-top: 80px;
}
@media (min-width: 600px) { .mp-auteur--avatar { grid-template-columns: 72px 1fr; } }
.mp-auteur__avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.mp-auteur__nom { font-weight: 800; color: var(--mp-bleu); margin: 0; font-size: 1.05rem; }
.mp-auteur__role { color: var(--mp-muted); font-size: 0.9rem; margin: 0 0 0.5rem; }
.mp-auteur__methode { font-size: 0.95rem; }
.mp-auteur__methode ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.mp-auteur__maj { font-size: 0.85rem; color: var(--mp-muted); margin: 0.5rem 0 0; }

/* Sources */
.mp-sources { font-size: 0.9rem; color: var(--mp-muted); }
.mp-sources ol { padding-left: 1.2rem; }

/* --------------------------------------------------------------------------
   Barre sticky mobile (shortcode [b1ng_sticky_cta]) — masquée sur desktop
   -------------------------------------------------------------------------- */
.mp-sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.6rem var(--mp-gutter) calc(0.6rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--mp-bord);
  box-shadow: 0 -6px 20px rgba(20, 52, 92, 0.12);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.mp-sticky-cta.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
.mp-sticky-cta__btn {
  display: block;
  width: 100%;
  max-width: 480px;
  text-align: center;
  background: var(--mp-orange);
  color: #fff !important;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none !important;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  min-height: 48px;
}
.mp-sticky-cta__btn:hover { background: var(--mp-orange-fonce); }
.mp-sticky-cta__note { font-size: 0.75rem; color: var(--mp-muted); }
/* Réserve l'espace en bas de page pour que la barre ne masque pas le pied de page */
@media (max-width: 1023px) {
  body:has(.mp-sticky-cta) { padding-bottom: 96px; }
  body:has(.b1ng-consent:not([hidden])) .mp-sticky-cta { display: none; } /* pas deux barres empilées */
}
@media (min-width: 1024px) { .mp-sticky-cta { display: none; } }

/* --------------------------------------------------------------------------
   Utilitaires
   -------------------------------------------------------------------------- */
.mp-muted { color: var(--mp-muted); }
.mp-small { font-size: 0.875rem; }
.mp-nowrap { white-space: nowrap; }
.mp-visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px;
}
@media (prefers-reduced-motion: reduce) {
  .mp-sticky-cta, .mp-btn { transition: none; }
}
@media print {
  .mp-sticky-cta, .mp-sidebar, .b1ng-consent, .b1ng-cookies-link { display: none !important; }
  .mp-layout { grid-template-columns: 1fr; }
}
