/* =======================================================
   HOME.CSS — PiloteCSE (NETTOYÉ + STABLE)
   - BASE + largeur
   - HERO (home-hero) style "magazine"
   - FEATURED (home-featured)
   - METAS (ligne) + READMORE (bouton à droite)
   ======================================================= */

/* =========================
   0) BASE + LARGEUR + RYTHME
   ========================= */

body.home{
  --pcse-home-width: 1600px;   /* largeur cible = comme les autres pages */
  --pcse-home-bg: #f6f7f9;     /* fond gris clair (ajustable) */

  font-family: "Inter","Segoe UI",Roboto,Arial,sans-serif;
  background-color: var(--pcse-home-bg);
  color:#222;
}

body.home main{
  max-width: var(--pcse-home-width) !important;
  width:100% !important;
  margin:0 auto !important;
  padding:18px 30px 56px !important; /* 30px = cohérent avec vos pages */
}

/* Evite des alignwide trop larges sur la home (mais même largeur que main) */
body.home .wp-site-blocks :where(.alignwide),
body.home .wp-block-group.alignwide,
body.home .wp-block-columns.alignwide,
body.home .wp-block-query.alignwide,
body.home .wp-block-group.is-layout-constrained{
  max-width: var(--pcse-home-width) !important;
  margin-left:auto !important;
  margin-right:auto !important;
}

/* Rythme vertical Gutenberg (entre blocs) */
body.home .entry-content.is-layout-flow > * + *{
  margin-block-start:22px !important;
}

/* Réduction espacement entre header et contenu */
body.home header.wp-block-template-part{
  margin-bottom:6px !important;
}

/* Stop aux marges automatiques des groupes (home uniquement) */
body.home .wp-block-group{
  margin-top:0 !important;
  margin-bottom:0 !important;
}

/* Spacers vides (home uniquement) */
body.home main .wp-block-spacer{
  display:none !important;
  height:0 !important;
  margin:0 !important;
  padding:0 !important;
}


/* =========================
   1) HERO — (classe : home-hero)
   ========================= */

body.home .home-hero{
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,#f6f9ff 0%,#ffffff 55%);
  border:1px solid #e7eefc;
  border-top:4px solid #2a4d8f;
  border-radius:16px;
  padding:28px 34px !important;
  box-shadow:0 10px 26px rgba(15,41,64,0.06);
}

body.home .home-hero::after{
  content:"";
  position:absolute;
  right:-60px;
  top:-60px;
  width:220px;
  height:220px;
  background:rgba(225,71,0,0.10);
  border-radius:999px;
  pointer-events:none;
}

body.home .home-hero h2{
  margin:0 0 10px 0 !important;
  line-height:1.15 !important;
}

body.home .home-hero p{ margin-top:0 !important; }

/* Ligne "Guides..." */
body.home .home-hero p:not(.hero-meta){
  margin-bottom:6px !important;
  line-height:1.55 !important;
}

/* Ligne "Mis à jour..." (classe : hero-meta) */
body.home .home-hero .hero-meta{
  margin:0 !important;
  font-size:13px !important;
  line-height:1.35 !important;
  color:#64748b !important;
}
body.home .home-hero .hero-meta p{
  margin:0 !important;
  font-size:inherit !important;
  line-height:inherit !important;
  color:inherit !important;
}

/* Boutons du hero */
body.home .home-hero .wp-block-buttons{ gap:12px !important; }

body.home .home-hero .wp-block-button__link{
  min-width:240px;
  text-align:center !important;
  padding:14px 18px !important;
  border-radius:10px !important;
  font-weight:700 !important;
  box-shadow:0 8px 18px rgba(42,77,143,0.18);
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
body.home .home-hero .wp-block-button__link:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 22px rgba(42,77,143,0.22);
  filter:brightness(1.03);
}


/* =========================
   2) FEATURED — (classe : home-featured)
   ========================= */

body.home .home-featured{
  position:relative;
  background:#fff;
  border:1px solid #e8eef9;
  border-left:6px solid rgba(42,77,143,0.25);
  border-radius:18px;
  padding:22px !important;
  box-shadow:0 14px 34px rgba(15,41,64,0.08);
}

body.home .home-featured::before{
  content:"";
  position:absolute;
  left:-10px;
  top:22px;
  bottom:22px;
  width:4px;
  border-radius:10px;
  background:#e14700;
  opacity:0.18;
}

body.home .home-featured:hover{
  box-shadow:0 18px 40px rgba(15,41,64,0.10);
  transform:translateY(-1px);
  transition:box-shadow 0.2s ease, transform 0.2s ease;
}

/* Colonnes */
body.home .home-featured .wp-block-columns{
  gap:28px !important;
  align-items:flex-start !important;
}

/* Nettoyage Query Loop ul/li */
body.home .home-featured .wp-block-post-template{
  margin:0 !important;
  padding:0 !important;
  list-style:none !important;
}
body.home .home-featured .wp-block-post{
  margin:0 !important;
  padding:0 !important;
}

/* Anti-marge globale d'images */
body.home .home-featured img{ margin:0 !important; }

/* Figure / bloc image : zéro marge */
body.home .home-featured figure,
body.home .home-featured .wp-block-post-featured-image,
body.home .home-featured figure.wp-block-post-featured-image{
  margin:0 !important;
  padding:0 !important;
}

/* Arrondis + ombre image */
body.home .home-featured figure.wp-block-post-featured-image,
body.home .home-featured img{
  border-radius:16px;
}
body.home .home-featured img{
  display:block !important;
  height:auto;
  box-shadow:0 12px 22px rgba(0,0,0,0.10);
}


/* =========================
   2.1) BADGE "À la une" (classe : alaune-badge)
   ========================= */

body.home .home-featured p.alaune-badge,
body.home .home-featured p.hero-alaune-badge,
body.home .home-featured p.featured-badge{
  display:inline-flex !important;
  align-items:center;
  width:auto !important;
  margin:0 0 10px 0 !important;
  padding:7px 12px !important;
  background:#e14700 !important;
  color:#fff !important;
  font-weight:800 !important;
  font-size:14px !important;
  line-height:1 !important;
  border-radius:999px !important;
  letter-spacing:.2px;
  box-shadow:0 6px 14px rgba(225,71,0,0.18);
  white-space:nowrap !important;
}


/* =========================
   2.2) TITRE + ACCENT
   ========================= */

body.home .home-featured .wp-block-post-title{
  font-size:clamp(26px, 2.2vw, 36px) !important;
  line-height:1.12 !important;
  margin:8px 0 10px 0 !important;
}

body.home .home-featured .wp-block-post-title a{
  color:#0f4c81;
  text-decoration:none !important;
  position:relative;
}
body.home .home-featured .wp-block-post-title a:hover{
  text-decoration:underline !important;
  text-underline-offset:4px;
}
body.home .home-featured .wp-block-post-title a::after{
  content:"";
  display:block;
  width:84px;
  height:4px;
  background:rgba(225,71,0,0.35);
  border-radius:99px;
  margin-top:10px;
}


/* =========================
   2.3) RÉSUMÉ (champ resume_court) — classe : featured-resume
   ========================= */

body.home .home-featured .featured-resume{
  color:#223041;
  font-size:16.5px !important;
  line-height:1.65 !important;
  margin:0 0 14px 0 !important;

  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:5;
  overflow:hidden;
}
body.home .home-featured .featured-resume p{
  margin:0 !important;
  font:inherit !important;
  color:inherit !important;
  line-height:inherit !important;
}


/* =========================
   2.5) SUPPRESSION DU "BLANC SOUS LA PHOTO" (DESKTOP)
   ========================= */

@media (min-width: 901px){

  body.home .home-featured .wp-block-columns{
    align-items:stretch !important;
  }

  body.home .home-featured .wp-block-columns > .wp-block-column:first-child{
    display:flex !important;
  }

  body.home .home-featured figure.wp-block-post-featured-image,
  body.home .home-featured .wp-block-post-featured-image{
    flex:1 1 auto !important;
    height:100% !important;
    margin:0 !important;
    aspect-ratio: unset !important;
  }

  body.home .home-featured figure.wp-block-post-featured-image > a{
    display:block !important;
    height:100% !important;
  }

  body.home .home-featured figure.wp-block-post-featured-image img{
    width:100% !important;
    height:100% !important;
    object-fit:cover !important;
    display:block !important;
    border-radius:16px;
  }
}


/* =========================
   3) TITRE "Derniers articles"
   ========================= */

.frontpage-titre-ligne{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:1.8rem;
  margin:60px auto 40px;
}

.frontpage-titre-ligne h2{
  font-size:38px;
  font-weight:700;
  margin:0;
  text-align:center;
  color:#0f2940;
}

.frontpage-titre-ligne .wp-block-separator{
  flex:1;
  max-width:350px;
  border-top:1px solid #d9d9d9 !important;
  opacity:1 !important;
  margin:0;
}

/* Nettoyage : pas de bordures parasites */
h3, h4{
  border-left:none !important;
  padding-left:0 !important;
}


/* =========================
   4) RESPONSIVE
   ========================= */

@media (max-width: 900px){

  body.home main{ padding:14px 16px 46px !important; }

  body.home .home-hero{ padding:18px 18px !important; }
  body.home .home-hero::after{ display:none; }

  body.home .home-hero .wp-block-button__link{ min-width:100%; }

  body.home .home-featured{ padding:16px !important; }
  body.home .home-featured .wp-block-columns{ gap:18px !important; }
}


/* =========================================================
   5) HOME FEATURED — 2 lignes:
   - ligne 1 : Lire la suite à droite (bouton)
   - ligne 2 : métas à gauche + séparateurs |
   ========================================================= */

/* --- LIGNE "LIRE LA SUITE" --- */
body.home .home-featured .home-readmore-row{
  display:flex !important;
  justify-content:flex-end !important;
  align-items:center !important;
  margin-top:12px !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  text-align:right !important;
}

/* Important: si WP met des styles inline de justification, on écrase */
body.home .home-featured .home-readmore-row.is-layout-flex{
  justify-content:flex-end !important;
}

/* Bouton = sur le lien (et seulement sur le lien) */
body.home .home-featured a.home-readmore,
body.home .home-featured .home-readmore-row a,
body.home .home-featured a.wp-block-post-excerpt__more-link,
body.home .home-featured a.wp-block-read-more__link{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;

  padding:.55rem 1.05rem !important;
  border-radius:999px !important;
  border:1px solid currentColor !important;

  background:transparent !important;
  text-decoration:none !important;
  font-weight:600 !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

/* Hover léger */
body.home .home-featured a.home-readmore:hover,
body.home .home-featured .home-readmore-row a:hover,
body.home .home-featured a.wp-block-post-excerpt__more-link:hover,
body.home .home-featured a.wp-block-read-more__link:hover{
  transform:translateY(-1px);
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}


/* --- LIGNE METAS --- */
body.home .home-featured .home-meta-row{
  display:flex !important;
  flex-wrap:wrap !important;
  justify-content:flex-start !important;
  align-items:center !important;

  gap:10px !important;
  margin-top:10px !important;

  font-size:.92rem !important;
  color:#64748b !important;
  opacity:.95 !important;

  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  text-align:left !important;
}

/* Chaque bloc meta doit rester "compact" */
body.home .home-featured .home-meta-row > *{
  display:inline-flex !important;
  align-items:center !important;
  width:auto !important;
  margin:0 !important;
}

/* Séparateurs | entre blocs */
body.home .home-featured .home-meta-row > * + *{
  position:relative;
  margin-left:10px !important;
  padding-left:10px !important;
}
body.home .home-featured .home-meta-row > * + *::before{
  content:"|";
  position:absolute;
  left:0;
  opacity:.5;
}

/* Préfixe Lecture : (si vous avez mis class reading-time au bloc) */
body.home .home-featured .home-meta-row .reading-time{
  white-space:nowrap !important;
}
/* ===== FIX DROPDOWN HOME — priorité au bloc header réel ===== */

/* 1) Le “vrai” conteneur de votre header (vos classes) */
.header-magazine,
.header-nav-magazine{
  position: relative !important;
  z-index: 9999 !important;
  overflow: visible !important;
  isolation: isolate !important;
}

/* 2) Le sous-menu doit être dans une couche encore au-dessus */
.header-nav-magazine .wp-block-navigation__submenu-container{
  z-index: 10000 !important;
}

/* 3) Le hero / sections Home doivent rester en dessous */
body.home .home-hero,
body.home .home-featured{
  position: relative !important;
  z-index: 0 !important;
  transform: none !important;
}

/* 4) Si vous avez des décors en ::before/::after sur le hero, ils ne doivent pas recouvrir */
body.home .home-hero::before,
body.home .home-hero::after,
body.home .home-featured::before,
body.home .home-featured::after{
  z-index: -1 !important;
  pointer-events: none !important;
}
/* =======================================================
   HOME — fond (sans impacter les autres pages)
   ======================================================= */

body.home,
body.home .wp-site-blocks{
  background-color: var(--pcse-home-bg) !important;
}

/* Le contenu reste géré par vos cartes */
body.home main{
  background-color: transparent !important;
}

/* Header reste blanc */
body.home header.wp-block-group.alignfull{
  background-color: #fff !important;
}

}

/* 2) Home : le wrapper WP ne doit pas repasser en blanc */
body.home,
body.home .wp-site-blocks{
  background-color: var(--pcse-site-bg) !important;
}

/* 3) Le contenu (main) reste transparent : ce sont vos cartes/sections qui gèrent leur fond */
body.home main{
  background-color: transparent !important;
}

/* 4) Si un bloc "alignfull" de la home a un fond blanc, on neutralise UNIQUEMENT la couleur,
      sans toucher aux images/dégradés */
body.home .wp-site-blocks > .wp-block-group.alignfull,
body.home .wp-site-blocks > .wp-block-cover.alignfull,
body.home .wp-site-blocks > .wp-block-columns.alignfull{
  background-color: transparent !important;
}

/* 5) Exception : le header peut rester blanc (si vous le souhaitez) */
body.home header.wp-block-group.alignfull{
  background-color: #fff !important;
}
/* HOME — homogénéiser le fond du header (zone du rond à gauche) */
body.home header.wp-block-group.alignfull{
  background-color: #fafafa !important;
}
/* HOME — homogénéiser le fond global (si un wrapper reste plus clair/blanc) */
body.home,
body.home .wp-site-blocks{
  background-color: #fafafa !important;
}
