/*
Theme Name: RenoPratique V8
Theme URI: https://renopratique.fr/
Author: RenoPratique
Description: Thème léger pour RenoPratique, orienté guides travaux et outillage.
Version: 8.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: renopratique
*/

:root{
  --rp-night:#17212B;
  --rp-yellow:#F5B700;
  --rp-bg:#F4F6F8;
  --rp-text:#26323D;
  --rp-white:#fff;
  --rp-muted:#66717c;
  --rp-border:#dfe4e8;
  --rp-radius:10px;
  --rp-max:1220px;
  --rp-article:800px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--rp-bg);color:var(--rp-text);font-family:Arial,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:17px;line-height:1.65}
a{color:#0b5d8b;text-decoration-thickness:1px;text-underline-offset:2px}
a:hover{color:#073f5f}
img{max-width:100%;height:auto}
.rp-wrap{width:min(calc(100% - 32px),var(--rp-max));margin-inline:auto}
.rp-header{background:var(--rp-night);color:var(--rp-white);position:sticky;top:0;z-index:50;box-shadow:0 2px 10px rgba(0,0,0,.12)}
.admin-bar .rp-header{top:32px}
.rp-header-inner{min-height:72px;display:flex;align-items:center;gap:26px}
.rp-brand{font-size:24px;font-weight:800;color:#fff;text-decoration:none;letter-spacing:-.4px}
.rp-brand span{color:var(--rp-yellow)}
.rp-nav{margin-left:auto}
.rp-nav ul{list-style:none;display:flex;gap:22px;align-items:center;margin:0;padding:0}
.rp-nav a{color:#fff;text-decoration:none;font-weight:600;font-size:15px}
.rp-nav a:hover{color:var(--rp-yellow)}
.rp-guide-btn{display:inline-flex;align-items:center;justify-content:center;background:var(--rp-yellow);color:var(--rp-night)!important;border-radius:8px;padding:9px 14px;font-weight:800!important}
.rp-compare-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;border:1px solid var(--rp-yellow);border-radius:999px;padding:6px 12px;color:var(--rp-yellow)!important;text-decoration:none;font-size:13px;font-weight:800;line-height:1.5;transition:background-color .15s,color .15s}
.rp-compare-btn:hover,.rp-compare-btn:focus-visible{background:var(--rp-yellow);color:var(--rp-night)!important}
.rp-compare-btn [aria-hidden="true"]{font-size:19px;line-height:1}
.rp-menu-toggle{display:none;margin-left:auto;background:transparent;border:1px solid rgba(255,255,255,.4);color:#fff;border-radius:7px;padding:8px 11px;font-weight:700}
.rp-main{min-height:60vh}
.rp-hero{background:linear-gradient(135deg,#17212B,#26384a);color:#fff;padding:82px 0}
.rp-hero-inner{max-width:860px}
.rp-kicker{display:inline-block;color:var(--rp-yellow);font-size:14px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;margin-bottom:12px}
.rp-hero h1{font-size:clamp(38px,6vw,64px);line-height:1.05;margin:0 0 22px;letter-spacing:-1.7px}
.rp-hero p{font-size:20px;max-width:760px;color:#e9eef2;margin:0 0 28px}
.rp-actions{display:flex;gap:12px;flex-wrap:wrap}
.rp-btn{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border-radius:8px;padding:12px 18px;font-weight:800}
.rp-btn-primary{background:var(--rp-yellow);color:var(--rp-night)}
.rp-btn-secondary{border:1px solid rgba(255,255,255,.55);color:#fff}
.rp-trust{background:#fff;border-bottom:1px solid var(--rp-border)}
.rp-trust .rp-wrap{display:flex;gap:28px;flex-wrap:wrap;padding-block:14px;font-size:14px;font-weight:700;color:#49545e}
.rp-section{padding:58px 0}
.rp-section h2{font-size:clamp(28px,4vw,40px);line-height:1.15;color:var(--rp-night);margin:0 0 12px}
.rp-section-intro{max-width:760px;color:var(--rp-muted);margin:0 0 28px}
.rp-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.rp-card{background:#fff;border:1px solid var(--rp-border);border-radius:var(--rp-radius);padding:22px;box-shadow:0 5px 18px rgba(23,33,43,.05)}
.rp-card h3{margin:0 0 8px;color:var(--rp-night);font-size:20px}
.rp-card p{margin:0;color:var(--rp-muted)}
.rp-card a{font-weight:800}
.rp-method{background:#fff;border-top:1px solid var(--rp-border);border-bottom:1px solid var(--rp-border)}
.rp-article{width:min(calc(100% - 32px),var(--rp-article));margin:44px auto 70px;background:#fff;padding:clamp(24px,5vw,52px);border-radius:var(--rp-radius);box-shadow:0 4px 18px rgba(23,33,43,.05)}
.rp-article h1{font-size:clamp(34px,5vw,52px);line-height:1.08;color:var(--rp-night);margin:0 0 18px;letter-spacing:-1px}
.rp-article h2{font-size:28px;line-height:1.2;color:var(--rp-night);margin:38px 0 12px}
.rp-article h3{font-size:21px;color:var(--rp-night);margin:28px 0 8px}
.rp-article p,.rp-article li{font-size:18px}
.rp-meta{color:var(--rp-muted);font-size:14px;margin-bottom:24px}
.rp-answer,.rp-note{border-left:5px solid var(--rp-yellow);background:#fff9df;padding:17px 19px;margin:24px 0;border-radius:0 8px 8px 0}
.rp-answer p,.rp-note p{margin:5px 0 0}
.rp-disclosure{font-size:14px!important;background:#f2f5f7;border:1px solid var(--rp-border);padding:12px 14px;border-radius:8px;color:#59636c}
.rp-table-wrap{overflow-x:auto;margin:24px 0}
.rp-table{width:100%;border-collapse:collapse;font-size:15px}
.rp-table th,.rp-table td{border:1px solid var(--rp-border);padding:10px 12px;text-align:left;vertical-align:top}
.rp-table th{background:var(--rp-night);color:#fff}
.rp-post-card{display:flex;flex-direction:column;height:100%}
.rp-post-card .rp-post-meta{font-size:13px;color:var(--rp-muted);margin-bottom:7px}
.rp-post-card .rp-more{margin-top:auto;padding-top:14px}
.rp-page{width:min(calc(100% - 32px),var(--rp-max));margin:44px auto 70px}
.rp-page-content{background:#fff;border-radius:var(--rp-radius);padding:clamp(24px,5vw,48px)}
.rp-page-content h1{font-size:clamp(36px,5vw,52px);line-height:1.1;color:var(--rp-night);margin-top:0}
.rp-footer{background:var(--rp-night);color:#dfe6ec;padding:44px 0 24px;margin-top:40px}
.rp-footer a{color:#fff}
.rp-footer-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:30px}
.rp-footer-brand{font-size:22px;font-weight:800;color:#fff}
.rp-footer-links{display:flex;gap:15px;flex-wrap:wrap;align-content:flex-start}
.rp-footer-note{font-size:13px;color:#aeb9c2;margin-top:24px;border-top:1px solid rgba(255,255,255,.12);padding-top:18px}
.rp-legal-placeholder{padding:16px;background:#fff3cd;border:1px solid #ffe69c;border-radius:8px}
@media(max-width:800px){
  .admin-bar .rp-header{top:46px}
  .rp-menu-toggle{display:block}
  .rp-nav{display:none;position:absolute;left:0;right:0;top:72px;background:var(--rp-night);padding:10px 16px 18px}
  .rp-nav.is-open{display:block}
  .rp-nav ul{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
  .rp-nav a{display:block;padding:9px 0}
  .rp-guide-btn{margin-left:0}
  .rp-header-inner{gap:12px}
  .rp-grid{grid-template-columns:1fr}
  .rp-footer-grid{grid-template-columns:1fr}
  .rp-hero{padding:58px 0}
}
@media(max-width:520px){
  .rp-brand{font-size:20px}
  .rp-header-inner{gap:8px}
  .rp-menu-toggle{padding:8px 9px}
  .rp-compare-btn{min-width:40px;padding:7px 9px}
  .rp-compare-label{display:none}
}


/* --- V2 : affichage robuste des articles importés --- */
body.single-post .rp-main{padding:0}
body.single-post .rp-article{
  width:min(calc(100% - 32px),800px);
  margin:44px auto 70px;
  background:#fff;
  padding:clamp(24px,5vw,52px);
  border-radius:10px;
  box-shadow:0 4px 18px rgba(23,33,43,.05);
}
body.single-post .rp-article h1{
  font-size:clamp(34px,5vw,52px);
  line-height:1.08;
  color:#17212B;
  margin:0 0 18px;
  letter-spacing:-1px;
}
body.single-post .rp-article h2{
  font-size:28px;
  line-height:1.2;
  color:#17212B;
  margin:38px 0 12px;
}
body.single-post .rp-article h3{
  font-size:21px;
  color:#17212B;
  margin:28px 0 8px;
}
body.single-post .rp-article p,
body.single-post .rp-article li{font-size:18px}

/* Le document Word source stockait parfois chaque ligne d'un tableau
   comme un mini-tableau séparé. On les recolle visuellement ici. */
.rp-article .rp-table-wrap{margin:0}
.rp-article h2 + .rp-table-wrap{margin-top:22px}
.rp-article .rp-table-wrap + .rp-table-wrap{margin-top:-1px}
.rp-article .rp-table-wrap + .rp-table-wrap .rp-table th{
  background:#fff;
  color:#26323D;
  font-weight:400;
}
.rp-article .rp-table-wrap + .rp-table-wrap .rp-table th:first-child{font-weight:700}
.rp-article .rp-table{margin:0}
.rp-article .rp-table th,
.rp-article .rp-table td{padding:11px 12px}

/* Sécurité : le contenu d'un article ne colle jamais aux bords de l'écran. */
body.single-post .rp-main > p,
body.single-post .rp-main > h1,
body.single-post .rp-main > h2,
body.single-post .rp-main > h3,
body.single-post .rp-main > ul,
body.single-post .rp-main > ol,
body.single-post .rp-main > div{
  max-width:800px;
  margin-left:auto;
  margin-right:auto;
}


/* --- V3 : images mises en avant --- */
.rp-featured-image{
  margin:0 0 26px;
  border-radius:10px;
  overflow:hidden;
  background:#eef1f3;
}
.rp-featured-image img{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:16/9;
  object-fit:cover;
}
.rp-card-thumb{
  display:block;
  margin:-22px -22px 18px;
  overflow:hidden;
  border-radius:10px 10px 0 0;
}
.rp-card-thumb img{
  display:block;
  width:100%;
  height:190px;
  object-fit:cover;
}
.rp-article .rp-featured-image{
  margin-top:4px;
  margin-bottom:26px;
}
@media(max-width:800px){
  .rp-card-thumb img{height:210px}
}


/* --- V4 : hub Outillage dynamique --- */
.rp-hub{
  width:min(calc(100% - 32px),1220px);
  margin:44px auto 70px;
}
.rp-hub-head{
  background:#fff;
  border:1px solid #dfe4e8;
  border-radius:10px;
  padding:clamp(24px,5vw,48px);
  margin-bottom:24px;
}
.rp-hub-head h1{
  margin:0 0 14px;
  color:#17212B;
  font-size:clamp(38px,5vw,56px);
  line-height:1.05;
}
.rp-hub-head p{
  margin:0;
  max-width:850px;
  color:#5f6973;
  font-size:18px;
}
.rp-hub-meta{
  margin-top:16px;
  font-size:14px;
  color:#76808a;
}
.rp-hub-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}
.rp-hub-card{
  background:#fff;
  border:1px solid #dfe4e8;
  border-radius:10px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:100%;
  box-shadow:0 5px 18px rgba(23,33,43,.05);
}
.rp-hub-thumb{
  display:block;
  aspect-ratio:16/9;
  overflow:hidden;
  background:#e9edf0;
}
.rp-hub-thumb img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  transition:transform .2s ease;
}
.rp-hub-card:hover .rp-hub-thumb img{
  transform:scale(1.02);
}
.rp-hub-card-body{
  padding:20px;
  display:flex;
  flex-direction:column;
  flex:1;
}
.rp-hub-card .rp-post-meta{
  font-size:13px;
  color:#76808a;
  margin-bottom:8px;
}
.rp-hub-card h2{
  margin:0 0 10px;
  color:#17212B;
  font-size:22px;
  line-height:1.25;
}
.rp-hub-card h2 a{
  color:#17212B;
  text-decoration:none;
}
.rp-hub-card h2 a:hover{
  color:#0b5d8b;
}
.rp-hub-card p{
  margin:0 0 16px;
  color:#5f6973;
}
.rp-hub-card .rp-more{
  margin-top:auto;
}
.rp-hub-empty-thumb{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#17212B,#26384a);
  color:#F5B700;
  font-weight:800;
  font-size:18px;
}
.rp-pagination{
  margin-top:28px;
  display:flex;
  justify-content:center;
}
.rp-pagination .page-numbers{
  display:flex;
  gap:8px;
  list-style:none;
  padding:0;
}
.rp-pagination a,
.rp-pagination span{
  display:inline-flex;
  min-width:40px;
  height:40px;
  padding:0 12px;
  align-items:center;
  justify-content:center;
  border-radius:7px;
  border:1px solid #dfe4e8;
  background:#fff;
  text-decoration:none;
}
.rp-pagination .current{
  background:#17212B;
  color:#fff;
  border-color:#17212B;
}
@media(max-width:980px){
  .rp-hub-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:650px){
  .rp-hub-grid{grid-template-columns:1fr}
}


/* --- V5 : pied de page légal --- */
.rp-footer{
  background:#17212B;
  color:#fff;
  margin-top:56px;
}
.rp-footer-inner{
  width:min(calc(100% - 32px),1220px);
  margin:0 auto;
  padding:34px 0 24px;
}
.rp-footer-top{
  display:flex;
  justify-content:space-between;
  gap:32px;
  align-items:flex-start;
}
.rp-footer-brand{
  font-size:24px;
  font-weight:800;
  margin:0 0 8px;
}
.rp-footer-brand .accent{color:#F5B700;}
.rp-footer-copy{
  color:#d7dde2;
  margin:0;
  max-width:560px;
  line-height:1.6;
}
.rp-footer-links{
  display:flex;
  flex-wrap:wrap;
  gap:12px 20px;
  justify-content:flex-end;
}
.rp-footer-links a{
  color:#fff;
  text-decoration:none;
  font-weight:700;
}
.rp-footer-links a:hover{
  color:#F5B700;
  text-decoration:underline;
}
.rp-footer-bottom{
  border-top:1px solid rgba(255,255,255,.14);
  margin-top:26px;
  padding-top:18px;
  display:flex;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
  color:#c3cbd2;
  font-size:14px;
}
@media(max-width:760px){
  .rp-footer-top{flex-direction:column}
  .rp-footer-links{justify-content:flex-start}
}


/* --- V6 : alignement des tableaux importés --- */
/* Certains anciens articles contiennent une ligne de tableau par mini-tableau.
   On force une grille identique d'une ligne à l'autre. */
.rp-article .rp-table{
  width:100%;
  table-layout:fixed;
}

/* Pour les tableaux à 3 colonnes :
   Critère = 22 %, les deux colonnes de comparaison = 39 % chacune. */
.rp-article .rp-table:has(tr > *:nth-child(3):last-child) th:first-child,
.rp-article .rp-table:has(tr > *:nth-child(3):last-child) td:first-child{
  width:22%;
}
.rp-article .rp-table:has(tr > *:nth-child(3):last-child) th:nth-child(2),
.rp-article .rp-table:has(tr > *:nth-child(3):last-child) td:nth-child(2),
.rp-article .rp-table:has(tr > *:nth-child(3):last-child) th:nth-child(3),
.rp-article .rp-table:has(tr > *:nth-child(3):last-child) td:nth-child(3){
  width:39%;
}

/* Empêche le texte de déformer la largeur d'une colonne. */
.rp-article .rp-table th,
.rp-article .rp-table td{
  overflow-wrap:anywhere;
  word-break:normal;
}

/* Sur mobile, le tableau reste lisible avec défilement horizontal si nécessaire. */
@media(max-width:650px){
  .rp-article .rp-table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  .rp-article .rp-table{
    min-width:620px;
  }
}


/* --- V7 : cartes "Bien choisir son équipement" cliquables --- */
a.rp-card.rp-home-card{
  display:block;
  color:inherit;
  text-decoration:none;
  cursor:pointer;
  position:relative;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.rp-card.rp-home-card:hover{
  transform:translateY(-3px);
  box-shadow:0 12px 28px rgba(23,33,43,.10);
  border-color:#f5b700;
}
a.rp-card.rp-home-card h3{
  color:#17212b;
}
a.rp-card.rp-home-card .rp-home-card-link{
  display:inline-block;
  margin-top:12px;
  font-weight:800;
  color:#17212b;
}
a.rp-card.rp-home-card:hover .rp-home-card-link{
  text-decoration:underline;
  text-decoration-color:#f5b700;
  text-decoration-thickness:2px;
  text-underline-offset:3px;
}


/* --- V8 : cartes Accueil réellement cliquables côté serveur --- */
a.rp-home-choice{
  display:block;
  color:inherit;
  text-decoration:none;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.rp-home-choice:hover{
  transform:translateY(-3px);
  box-shadow:0 12px 28px rgba(23,33,43,.10);
  border-color:#f5b700;
}
a.rp-home-choice h3{ color:#17212b; }
a.rp-home-choice .rp-home-choice-link{
  display:inline-block;
  margin-top:12px;
  font-weight:800;
  color:#17212b;
}
a.rp-home-choice:hover .rp-home-choice-link{
  text-decoration:underline;
  text-decoration-color:#f5b700;
  text-decoration-thickness:2px;
  text-underline-offset:3px;
}
