/* ==========================================================
   LASLA — LES ARTICLES (Hub 2026)
   Fichier unique : lasla-articles.css
   - Layout page (2/3 + 1/3)
   - Hub thèmes + listes
   - Reader (lecture)
   - Scroll interne uniquement
   - Surbrillance mot par mot (lecture + livre)
   - Overlay livre (#slaBookOverlay / .sla-book-*)
   ========================================================== */

/* =========================
   Variables
   ========================= */
   :root{
    --reading-scale: 1;
    --book-reading-scale: 1;
    --reading-font-family: "Source Sans Pro", sans-serif;
  
    --book-maxw: 1200px;
    --book-radius: 24px;
    --book-gap: clamp(12px, 2vw, 20px);
    --book-pad: clamp(12px, 2.2vw, 20px);
    --book-toc-w: 280px;
    --book-toc-w-max: 320px;
  
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
  }
  
  /* =========================
   0) Anti scroll horizontal global (images/tables)
   ========================= */
html, body { overflow-x: hidden; }

/* ============================================================
   1) STRUCTURE PAGE (page-les-articles.php)
   - main.lasla2026-root[data-page="les-articles"]
   - layout "livre" : viewport fixe + scroll interne
   ============================================================ */



/* main = colonne verticale, prend tout le viewport */
body.page-template-page-les-articles .main{

  display: flex !important;
  flex-direction: column !important;
  min-height: 0; /* autorise shrink dans certains moteurs */
  flex: 1 1 auto !important;
}

/* .main doit pouvoir shrink (sinon scroll interne impossible) */
body.page-template-page-les-articles .main.lasla-articles-main{
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* shell = wrapper principal */
body.page-template-page-les-articles .main .articles-shell{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  overflow: hidden !important;

  height: auto !important; /* IMPORTANT : pas de 100% */
}

/* ============================================================
   2) GRID 2/3 + 1/3 (desktop) -> 1 colonne (narrow)
   ============================================================ */
body.page-template-page-les-articles .articles-grid{
  flex: 1 1 auto !important;
  min-height: 0 !important;

  display: grid !important;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch !important;

  overflow: hidden !important;
  height: auto !important; /* IMPORTANT */
}

/* une seule règle responsive (évite conflits) */
@media (max-width: 1100px){
  body.page-template-page-les-articles .articles-grid{
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   3) COLONNES (gauche/droite) : flex + shrink OK
   ============================================================ */
body.page-template-page-les-articles .articles-col-main,
body.page-template-page-les-articles .articles-col-side{
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;

  /* IMPORTANT : on enlève height:100% fragile */
  height: auto !important;
}

/* ============================================================
   4) CARDS : header fixe, body "remplit", scroll interne
   ============================================================ */
body.page-template-page-les-articles .articles-col-main > .card,
body.page-template-page-les-articles .articles-col-side > .card{
  flex: 1 1 auto !important;
  min-height: 0 !important;

  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;

  border-radius: 18px;
}

/* card header fixe */
body.page-template-page-les-articles .card > .card-h{
  flex: 0 0 auto !important;
}

/* card body prend le reste */
body.page-template-page-les-articles .card > .card-b{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* ============================================================
   5) SCROLL INTERNE (les seules zones qui scrollent)
   - adapte les sélecteurs à tes vrais blocs (tu les as déjà)
   ============================================================ */

/* Lecture : zone contenu scrolle */
body.page-template-page-les-articles .card-article-reader .card-b,
body.page-template-page-les-articles .reader-viewport,
body.page-template-page-les-articles #articleContent{
  min-height: 0 !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Hub posts : zone liste scrolle */
body.page-template-page-les-articles .hub-posts{
  min-height: 0 !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   6) HUB-POSTS : 2 colonnes si place, 1 colonne automatiquement
   => zéro seuil fixe : auto-fit + minmax
   ============================================================ */
body.page-template-page-les-articles .hub-posts{
  display: grid !important;
  gap: 10px;

  /* le navigateur décide selon la place dispo */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;

  height: auto !important;
  max-height: none !important;
}

/* sécurité : un item peut shrink (ellipsis etc.) */
body.page-template-page-les-articles .hub-posts > *{
  min-width: 0;
}

/* ============================================================
   7) Sécurisation contenu (images/tables) dans les zones scroll
   ============================================================ */
body.page-template-page-les-articles .card-article-reader img,
body.page-template-page-les-articles .card-article-reader table{
  max-width: 100%;
}

body.page-template-page-les-articles .card-article-reader table{
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

  /* ============================================================
     2) SCROLL INTERNE UNIQUEMENT
     - lecture: .card-b.reader-body
     - hub: .hub-posts (dans .articles-hub-list.is-active)
     ============================================================ */
  
  /* lecture */
  body.page-template-page-les-articles .card-b.reader-body{
    overflow: auto !important;
    min-height: 0 !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 10px;
  }
  
  /* hub body */
  body.page-template-page-les-articles .card-b.articles-hub-body{
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: repeating-linear-gradient( 90deg, rgba(0, 0, 0, 0.01) 0px, rgba(0, 0, 0, 0.01) 1px, transparent 1px, transparent 22px ), repeating-linear-gradient( 0deg, rgba(0, 0, 0, 0) 0px, rgba(0,0,0,.06) 1px, transparent 1px, transparent 22px ); 
 }
  
  /* layout hub */
  body.page-template-page-les-articles .articles-hub-layout{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  
  /* preview = colonne */
  body.page-template-page-les-articles .articles-hub-preview{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative;
    border-radius: 18px;
    padding: 14px;

  }
  
  /* top fixe */
  body.page-template-page-les-articles .articles-hub-top{
    flex: 0 0 auto !important;
    position: relative;
    z-index: 2;
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,.35);
    
    border: 1px solid rgba(0,0,0,.06) !important;
  /*  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);*/
  }
  
  /* lists prend le reste */
  body.page-template-page-les-articles .articles-hub-lists{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* panel actif */
  body.page-template-page-les-articles .articles-hub-list{
    display: none !important;
    min-height: 0 !important;
  }
  body.page-template-page-les-articles .articles-hub-list.is-active{
    display: flex !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  
  /* ✅ scroll uniquement ici */
  body.page-template-page-les-articles .articles-hub-list.is-active .hub-posts{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    padding: 6px 12px 12px 6px;
  
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  
    align-items: start !important;
    align-content: start !important;
  
    position: relative !important;
  }
  
  @media (max-width: 992px){
    body.page-template-page-les-articles .articles-hub-list.is-active .hub-posts{
      grid-template-columns: 1fr;
    }
  }
  
  /* ============================================================
     3) HUB NAV (thèmes)
     ============================================================ */
  
  .themes-nav--hub{
  /*  background: radial-gradient(circle at 20% 10%, rgba(80,184,255,.16), transparent 55%), radial-gradient(circle at 70% 30%, rgba(255,198,42,.14), transparent 60%); */   

    display: grid !important;
  gap: 10px !important;
  padding: 10px !important;
  border-radius: 16px !important;
  background: rgba(200, 184, 78, 0.53) !important;
  border: 1px solid rgba(0,0,0,.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);

  }
  
  .themes-nav--hub .themes-nav-item{
    line-height: 1.05;
    background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.62)) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 49px !important;
    padding: 0px 12px !important;
    border-radius: 16px !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.6),
      0 4px 10px rgba(255, 170, 0, 0.18);
    transition: all .25s ease;
    cursor: pointer;
  
    position: relative;

  }
  
  .themes-nav--hub .themes-nav-item::before{
    content: "";
    position: absolute;
    inset: -2px;
    pointer-events: none;
  }
  .themes-nav--hub .themes-nav-item:hover::before{ opacity: 1; }
  
  .themes-nav--hub .themes-nav-icon{
    color:#000;
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
  
    background: rgba(255,255,255,.18) !important;
    border: 1px solid rgba(0,0,0,.10) !important;
  
    box-shadow:
      0 0 0 1px rgba(255,255,255,.12) inset,
      0 10px 24px rgba(0,0,0,.10),
      0 0 18px rgba(255,210,60,.35) !important;
  }
  
  .themes-nav--hub .themes-nav-text{
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  
  .themes-nav--hub .themes-nav-label{
    font-weight: 600;
    font-size: 13px;
    color: #000;
  }
  .themes-nav--hub .themes-nav-count{
    font-size: 11px;
    color: rgba(0,0,0);
  }
  
  .themes-nav--hub .themes-nav-chevron{
    opacity: .7;
  }
  .themes-nav--hub .themes-nav-item:hover .themes-nav-chevron{
    transform: translateX(2px);
    transition: transform .18s ease;
    
  }
  .themes-nav--hub .themes-nav-item:hover{
    color: rgba(0,0,0);  
    background: linear-gradient(180deg, rgba(255,214,90,.92), rgba(255,190,40,.62)) !important;
    border-color: rgba(255,170,0,.55) !important;
  }

  /* actif */
  .themes-nav--hub .themes-nav-item.is-active{
    background: linear-gradient(180deg, rgba(255,214,90,.92), rgba(255, 190, 40, 0.88)) !important;
    border-color: rgba(255, 170, 0, 0.8) !important;
  
  }
  
  .themes-nav--hub .themes-nav-item.is-active .themes-nav-label,
  .themes-nav--hub .themes-nav-item.is-active .themes-nav-count,
  .themes-nav--hub .themes-nav-item.is-active .themes-nav-icon{
    color: #2d1b00;
  }
  
  /* ============================================================
     4) PREVIEW TOP (pill + search)
     ============================================================ */
  
  .articles-hub-pill{
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  
    padding: 10px 12px;
    border-radius: 10px;
  
    background: linear-gradient(180deg, rgba(255, 204, 92, .65), rgba(255, 185, 30, .45));
    border: 1px solid rgba(255,140,0,.35);
  
    box-shadow:
      0 8px 18px rgba(255,140,0,.15),
      inset 0 1px 0 rgba(255,255,255,.55);
  }
  
  .articles-hub-pill .pill-dot{
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff9800;
    box-shadow: 0 0 0 4px rgba(255,152,0,.18);
  }
  
  .articles-hub-pill-text{
    font-weight: 700;
    color: rgba(0,0,0);
  }
  .articles-hub-pill-count{
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,.10);
    color: rgba(0,0,0);
    border: 1px solid rgba(0,0,0,.08);
  }
  
  .articles-hub-desc{
    font-size: 13px;
    line-height: 1.35;
    color: rgba(0,0,0);
    padding: 0 6px;
  }
  
  .articles-hub-search{
    position: relative;
    display: flex;
    align-items: center;
  }
  .articles-hub-search i{
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0,0,0);
    font-size: 14px;
    z-index: 2;
  }
  .articles-hub-search input{
    padding-left: 34px !important;
    height: 42px;
    border-radius: 12px !important;
  
    background: rgba(255,255,255,.55) !important;
    border: 1px solid rgba(255,140,0,.18) !important;
  
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.65),
      0 6px 14px rgba(0,0,0,.06);
  }
  .articles-hub-search input:focus{
    border-color: rgba(255,140,0,.45) !important;
    box-shadow:
      0 0 0 4px rgba(255,140,0,.18),
      0 8px 18px rgba(0,0,0,.10);
  }
  
  /* ============================================================
     5) LISTE POSTS (cards)
     ============================================================ */
  
  .hub-post-card{ border-radius: 14px; }
  .hub-post-btn{
    pointer-events: auto !important;
    cursor: pointer;
  
    width: 100%;
    text-align: left;
    border-radius: 14px;
    padding: 12px 12px;
  
    background: rgba(255,255,255,.55);
    border: 1px solid rgba(0,0,0,.10);
    box-shadow: 0px 2px 2px rgba(0,0,0,.08);
  
    transition: transform .2s ease, box-shadow .2s ease;
  
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  
/* hover + active (clic maintenu) + actif persistant (page ?post=ID) */
.hub-post-btn:hover,
.hub-post-btn:active,
.hub-post-card.is-active .hub-post-btn,
.hub-post-btn.is-active{
  background: rgba(255,214,90,.70);
  border-color: rgba(255,170,0,.40);
}

.hub-post-btn:hover{
  transform: translateY(-2px);
}

/* optionnel : effet "enfoncé" pendant le clic */
.hub-post-btn:active{
  transform: translateY(0);
}


  .hub-post-main{
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }
  .hub-post-icon{
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
  
    background: rgba(0,0,0,.06);
    border: 1px solid rgba(0,0,0,.10);
  }
  .bi.bi-book{ color: #000000d9; }
  
  .hub-post-texts{
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }
  .hub-post-title{
    color: rgba(0,0,0);
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.15 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-weight: 650;
    color: #111;
  }
  .hub-post-chevron{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    opacity: .7;
  }
  
  /* ============================================================
     6) Surbrillance des mots (article + livre)
     ============================================================ */
  
  .reading-word,
  .book-reading-word{
    display: inline;
  }
  
  .reading-word-active,
  .book-reading-word-active{
    display: inline-block;
    padding: 0 3px;
    border-radius: 3px;
    background: #ffe70f;
    color: #000 !important;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    text-decoration: none !important;
  }
  
  /* ============================================================
     7) Scrollbar futuriste (2 zones seulement)
     ============================================================ */
  
  body.page-template-page-les-articles .card-b.reader-body,
  body.page-template-page-les-articles .articles-hub-list.is-active .hub-posts{
    scrollbar-width: thin;
    scrollbar-color: rgba(80,184,255,.85) rgba(0,0,0,.10);
  }
  
  body.page-template-page-les-articles .card-b.reader-body::-webkit-scrollbar,
  body.page-template-page-les-articles .articles-hub-list.is-active .hub-posts::-webkit-scrollbar{
    width: 12px;
  }
  
  body.page-template-page-les-articles .card-b.reader-body::-webkit-scrollbar-track,
  body.page-template-page-les-articles .articles-hub-list.is-active .hub-posts::-webkit-scrollbar-track{
    background: linear-gradient(180deg, rgba(2,6,23,.18), rgba(2,6,23,.06));
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), inset 0 0 18px rgba(0,0,0,.14);
  }
  
  body.page-template-page-les-articles .card-b.reader-body::-webkit-scrollbar-thumb,
  body.page-template-page-les-articles .articles-hub-list.is-active .hub-posts::-webkit-scrollbar-thumb{
    border-radius: 999px;
    border: 3px solid rgba(2,6,23,.22);
    background: linear-gradient(180deg,
      rgba(80,184,255,.92),
      rgba(255,198,42,.88),
      rgba(255,120,0,.86)
    );
    box-shadow:
      0 0 0 1px rgba(255,255,255,.18),
      0 10px 28px rgba(80,184,255,.22),
      0 10px 28px rgba(255,198,42,.18),
      inset 0 0 10px rgba(255,255,255,.16);
  }
  
  body.page-template-page-les-articles .card-b.reader-body::-webkit-scrollbar-thumb:hover,
  body.page-template-page-les-articles .articles-hub-list.is-active .hub-posts::-webkit-scrollbar-thumb:hover{
    box-shadow:
      0 0 0 1px rgba(255,255,255,.22),
      0 12px 34px rgba(80,184,255,.30),
      0 12px 34px rgba(255,198,42,.24),
      inset 0 0 12px rgba(255,255,255,.18);
  }
  
  /* ============================================================
     8) MODE LIVRE — Overlay #slaBookOverlay (repris, dédoublonné)
     ============================================================ */
  
  #slaBookOverlay{
    position: fixed;
    inset: 0;
    z-index: 99999999;
    background: radial-gradient(circle at top, #F4EBC3 0, #EBD50A 40%, #FFE600 90%);
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .35s ease, transform .35s ease;
    overflow: hidden;
  }
  
  #slaBookOverlay.is-visible{
    display: block;
    opacity: 1;
    transform: translateY(0);
  }
  
  body.sla-book-open{ overflow: hidden; }
  
  /* sécurité box sizing overlay */
  #slaBookOverlay, #slaBookOverlay *{ box-sizing: border-box; }
  
  /* inner (hauteur fiable) */
  #slaBookOverlay .sla-book-inner{
    width: min(var(--book-maxw), calc(100vw - 2*var(--book-pad)));
    height: min(92vh, calc(100dvh - (var(--safe-top) + var(--safe-bottom) + 2*var(--book-pad))));
    margin: calc(var(--book-pad) + var(--safe-top)) auto;
    border-radius: var(--book-radius);
    padding: var(--book-pad);
  
    background: #121214;
    box-shadow: 0 28px 80px rgba(0,0,0,0.8);
  
    position: relative;
    display: flex;
    flex-direction: column;
  }
  
  /* close */
  #slaBookOverlay .sla-book-close{
    position: absolute;
    top: calc(12px + var(--safe-top));
    right: calc(12px + var(--safe-right));
    border: none;
    background: transparent;
    font-size: 32px;
    line-height: 1;
    color: #f5f1e6;
    cursor: pointer;
  }
  
  /* shell desktop */
  #slaBookOverlay .sla-book-shell{
    flex: 1;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(240px, var(--book-toc-w)) minmax(0, 1fr);
    gap: var(--book-gap);
    padding-bottom: 18px;
  }
  
  /* TOC */
  #slaBookOverlay .sla-book-toc{
    background: #1a1a1a;
    border-right: 1px solid rgba(255,255,255,0.05);
    border-radius: 18px;
    overflow: hidden;
  
    display: flex;
    flex-direction: column;
  
    max-width: var(--book-toc-w-max);
    min-width: 240px;
  }
  
  #slaBookOverlay .sla-book-toc-list{
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
  
    display: flex;
    flex-direction: column;
    gap: .35rem;
  }
  
  /* item */
  #slaBookOverlay .sla-book-toc-item{
    width: 100%;
    min-height: 2.8rem;
    display: flex;
    align-items: center;
    gap: .75rem;
  
    padding: .55rem .9rem;
    border-radius: 999px;
    border: 1px solid #000;
  
    background:
      radial-gradient(circle at 0 0, rgba(255,212,106,0.12), transparent 55%),
      linear-gradient(135deg, rgba(255,251,0,0.44), rgba(255,227,0,0.43));
  
    box-shadow: 0 0 0 1px rgba(0,0,0,0.55);
    color: #f7f7ff;
    font-size: .92rem;
    text-align: left;
    cursor: pointer;
  
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
  }
  
  #slaBookOverlay .sla-book-toc-item:hover{
    border-color: rgba(255,238,5,.8);
    box-shadow: 0 0 0 2px rgba(0,0,0,.85), 0 0 5px rgba(255,245,92,.75);
    transform: translateX(2px);
  }
  
  #slaBookOverlay .sla-book-toc-item.is-current{
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(0,0,0,.85), 0 0 5px rgba(255,245,92,.75);
    color: #050612;
  }
  
  #slaBookOverlay .sla-book-toc-index{
    min-width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  
    background: rgba(0,0,0,.65);
    color: #e8f9ff;
    box-shadow: 0 0 0 2px rgba(4,14,26,.9);
    flex: 0 0 auto;
  }
  
  #slaBookOverlay .sla-book-toc-title{
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
  }
  
  /* view */
  #slaBookOverlay .sla-book-view{
    min-width: 0;
    height: 100%;
    overflow: hidden;
    border-radius: 18px;
    position: relative;
    background: #1a1a1a;
  }
  
  /* bookblock base */
  #slaBookOverlay .bb-custom-wrapper{
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  #slaBookOverlay .bb-bookblock{
    position: relative;
    width: 100%;
    height: 100%;
    -webkit-perspective: 1600px;
    perspective: 1600px;
    transform-style: preserve-3d;
  }
  #slaBookOverlay .bb-bookblock .bb-item{
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    overflow: hidden;
    background: transparent;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  #slaBookOverlay .bb-bookblock .bb-item:first-child{
    position: relative;
  }
  
  /* page */
  #slaBookOverlay .sla-book-page{
    width: 100%;
    height: 100%;
    padding: clamp(16px, 2.4vw, 28px) clamp(14px, 2.8vw, 32px);
  }
  #slaBookOverlay .sla-book-page-inner{
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 28px;
  }
  #slaBookOverlay .sla-book-page-heading{
    font-family: var(--reading-font-family);
    font-size: clamp(1.15rem, 1.4vw, 1.6rem);
    margin-bottom: 1rem;
    color: #f5f1e6;
  }
  #slaBookOverlay .sla-book-page-content{
    font-family: var(--reading-font-family);
    font-size: calc(1.5rem * var(--book-reading-scale, 1));
    line-height: 1.6;
    color: #fff;
  
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  #slaBookOverlay .sla-book-page-content p{ margin-bottom: .9rem; }
  #slaBookOverlay .sla-book-page-content > *:last-child{ margin-bottom: 0 !important; }
  
  /* anti overflow contenus WP */
  #slaBookOverlay .sla-book-page-content img,
  #slaBookOverlay .sla-book-page-content video,
  #slaBookOverlay .sla-book-page-content iframe{
    max-width: 100% !important;
    height: auto !important;
  }
  #slaBookOverlay .sla-book-page-content table{
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #slaBookOverlay .sla-book-page-content pre,
  #slaBookOverlay .sla-book-page-content code{
    max-width: 100%;
    overflow-x: auto;
  }
  
  /* nav overlay (flèches) */
  #slaBookOverlay .sla-book-view .sla-book-nav{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: calc(18px + var(--safe-left));
    padding-right: calc(18px + var(--safe-right));
    pointer-events: none;
    z-index: 40;
  }
  #slaBookOverlay .sla-book-view #slaBookPrev,
  #slaBookOverlay .sla-book-view #slaBookNext{
    pointer-events: auto;
    touch-action: manipulation;
  
    border-radius: 999px;
    border: 1px solid rgba(243,171,0,.25);
    color: #f9fafb;
    line-height: 1;
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    cursor: pointer;
  
    box-shadow: 0 0 0 1px rgba(244,172,2,.22), 0 0 2px rgb(255,174,37);
    text-shadow: 0 0 4px rgba(0,0,0,1);
  
    transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  
    margin-left: -15px;
    margin-right: -15px;
  }
  
  #slaBookOverlay .sla-book-view #slaBookPrev:hover,
  #slaBookOverlay .sla-book-view #slaBookNext:hover{
    transform: translateY(-1px);
    border-color: rgba(248,250,252,.95);
    box-shadow:
      0 0 0 1px rgba(15,23,42,1),
      0 0 24px rgba(59,130,246,.9);
  }
  
  /* tablette => TOC drawer */
  @media (max-width: 992px){
    #slaBookOverlay .sla-book-shell{
      grid-template-columns: 1fr;
    }
  
    #slaBookOverlay .sla-book-toc{
      position: absolute;
      top: calc(var(--book-pad) + 44px);
      left: calc(var(--book-pad) + var(--safe-left));
      bottom: calc(var(--book-pad) + var(--safe-bottom));
      width: min(86vw, 360px);
      max-width: none;
      min-width: 0;
      z-index: 80;
  
      transform: translateX(-110%);
      opacity: 0;
      pointer-events: none;
  
      transition: transform .22s ease, opacity .22s ease;
    }
  
    #slaBookOverlay.toc-open .sla-book-toc{
      transform: translateX(0);
      opacity: 1;
      pointer-events: auto;
    }
  
    #slaBookOverlay #slaBookTocToggle{
      display: inline-flex;
      align-items: center;
      gap: 8px;
      z-index: 90;
      bottom: calc(14px + var(--safe-bottom));
      left: calc(14px + var(--safe-left));
    }
  
    #slaBookOverlay .sla-book-view .sla-book-nav{
      padding: 0 calc(14px + var(--safe-right)) 0 calc(14px + var(--safe-left));
    }
  }
  
  /* mobile */
  @media (max-width: 768px){
    #slaBookOverlay .sla-book-inner{
      width: calc(100vw - 16px);
      height: calc(100dvh - (var(--safe-top) + var(--safe-bottom) + 16px));
      margin: calc(8px + var(--safe-top)) auto;
      padding: 12px;
      border-radius: 18px;
    }
  
    #slaBookOverlay .sla-book-page{ padding: 16px 14px; }
  
    #slaBookOverlay .sla-book-view #slaBookPrev,
    #slaBookOverlay .sla-book-view #slaBookNext{
      width: 50px;
      height: 50px;
    }
  
    #slaBookOverlay #slaBookTocToggle{
      padding: 10px 14px;
      font-size: .9rem;
    }
  }
  
  @media (max-width: 420px){
    #slaBookOverlay .sla-book-page-heading{ font-size: 1.1rem; }
    #slaBookOverlay .sla-book-page-content{
      font-size: 1.02rem;
      line-height: 1.6;
    }
    #slaBookOverlay .sla-book-view .sla-book-nav{
      padding: 0 calc(10px + var(--safe-right)) 0 calc(10px + var(--safe-left));
    }
    #slaBookOverlay .sla-book-view #slaBookPrev,
    #slaBookOverlay .sla-book-view #slaBookNext{
      width: 46px;
      height: 46px;
    }
  }
  


  /* ============================================================
   PATCH Reader: cadre visible + scroll propre + effet futuriste
   ============================================================ */

/* le body du reader ne scrolle plus: c'est le viewport */
body.page-template-page-les-articles .card-article-reader .card-b.reader-body{
    overflow: hidden !important;
    padding: 14px !important; /* ✅ laisse respirer le contour */
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0);
  }
  
  /* frame = contour / border radius toujours visible */
  .card-article-reader .reader-frame{
    height: 100%;
    min-height: 0;
    border-radius: 18px;
    overflow: hidden;
  
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.06));
    border: 1px solid rgba(0,0,0,.08) !important;
  
    box-shadow:
      0 18px 55px rgba(0,0,0,.12),
      inset 0 1px 0 rgba(255,255,255,.14);
  
    position: relative;
  }
  
  /* petit glow discret */
  .card-article-reader .reader-frame::before{
    content:"";
    position:absolute;
    inset:-2px;
    border-radius: 20px;
    pointer-events:none;
    background:rgba(255, 255, 255, 0.54);
    opacity:.9;
  }
  
  /* viewport = SEULE zone scroll */
  .card-article-reader .reader-viewport{
    position: relative;
    height: 100%;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both-edges;
  
    padding: 18px 16px 22px;
  }
  
  /* header “semi-sticky” (futuriste) */
  .card-article-reader .reader-head{

    top: 0;
    z-index: 2;

  }
  
  /* contenu: évite les débordements WP */
  .card-article-reader .reader-content img,
  .card-article-reader .reader-content video,
  .card-article-reader .reader-content iframe{
    max-width: 100% !important;
    height: auto !important;
  }
  .card-article-reader .reader-content table{
    display:block;
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  
  /* scrollbar futuriste (reader-viewport) */
  .card-article-reader .reader-viewport{
    scrollbar-width: thin;
    scrollbar-color: rgba(80,184,255,.85) rgba(0,0,0,.10);
  }
  .card-article-reader .reader-viewport::-webkit-scrollbar{ width: 12px; }
  .card-article-reader .reader-viewport::-webkit-scrollbar-track{
    background: linear-gradient(180deg, rgba(2,6,23,.18), rgba(2,6,23,.06));
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), inset 0 0 18px rgba(0,0,0,.14);
  }
  .card-article-reader .reader-viewport::-webkit-scrollbar-thumb{
    border-radius: 999px;
    border: 3px solid rgba(2,6,23,.22);
    background: linear-gradient(180deg,
      rgba(80,184,255,.92),
      rgba(255,198,42,.88),
      rgba(255,120,0,.86)
    );
    box-shadow:
      0 0 0 1px rgba(255,255,255,.18),
      0 10px 28px rgba(80,184,255,.22),
      0 10px 28px rgba(255,198,42,.18),
      inset 0 0 10px rgba(255,255,255,.16);
  }
  .card-article-reader .reader-viewport::-webkit-scrollbar-thumb:hover{
    box-shadow:
      0 0 0 1px rgba(255,255,255,.22),
      0 12px 34px rgba(80,184,255,.30),
      0 12px 34px rgba(255,198,42,.24),
      inset 0 0 12px rgba(255,255,255,.18);
  }
/* =========================================================
   1) CONTAINER QUERY SUR LA COLONNE DROITE
   ========================================================= */
   .articles-col-side{
    container-type: inline-size;
    container-name: articles-side;
  
    display: flex;
    flex-direction: column;
    min-height: 0; /* CRUCIAL */
  }
  
  /* =========================================================
     2) STRUCTURE HUB (évite les sauts de hauteur)
     ========================================================= */
  .card-articles-hub,
  .card-b-articles-hub-body,
  .articles-hub-layout,
  .articles-hub-preview,
  .articles-hub-lists,
  .articles-hub-list{
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  
  /* =========================================================
     3) THEMES NAV : auto 3 / 2 / 1 colonnes
     ========================================================= */
  .themes-nav.themes-nav--hub{
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    align-content: start;
  
    height: auto !important;
    max-height: none !important;
  }
  
  /* Item */
  .themes-nav-item{
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  /* Ellipsis */
  .themes-nav-text{ min-width:0; flex:1; }
  .themes-nav-label,
  .themes-nav-count{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .themes-nav-chevron{ flex:0 0 auto; }
  
  /* =========================================================
     4) HUB POSTS → AUTO GRID (2 colonnes si possible)
     ========================================================= */
  .hub-posts{
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-content: start;
  
    min-height: 0;
  }
  
  /* =========================================================
     5) SI LA COLONNE DEVIENT ÉTROITE → 1 COLONNE
     ========================================================= */
  @container articles-side (max-width: 520px){
    .hub-posts{
      grid-template-columns: 1fr !important;
    }
  
    .themes-nav.themes-nav--hub{
      grid-template-columns: 1fr !important;
    }
  }
  
/* La “carte lecture” doit pouvoir rétrécir */
.card-article,
.card-lecture,
.articles-col-main > .card{
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* La zone contenu texte scrolle */
.card-article .card-body,
.card-lecture .card-body,
.lecture-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

/* Chaîne de sécurité : tous les wrappers dans la colonne */
.articles-col-main *,
.articles-col-side *{
  /* NON : pas de max-height none global */
}

/* OUI : min-height:0 sur les wrappers clés (pas sur tout *) */
.card,
.card-body,
.articles-hub-layout,
.articles-hub-lists,
.articles-hub-list,
.articles-hub-preview{
  min-height: 0;
}

/* Stabilise un peu la mise en page pendant le chargement */
.articles-col-main, .articles-col-side{
    text-rendering: optimizeLegibility;
  }

