/* ════════════════════════════════════════════════════
   MesLapins Guides — Style v1.0.0
   Couleurs : --mlg-primary #104B59 | --mlg-accent #FF7D44
   ════════════════════════════════════════════════════ */

:root {
    --mlg-primary:    #104B59;
    --mlg-primary-l:  #1a6b7a;
    --mlg-accent:     #FF7D44;
    --mlg-accent-l:   #fff3ec;
    --mlg-bg:         #f4f6f8;
    --mlg-card:       #ffffff;
    --mlg-border:     #e4e9ed;
    --mlg-text:       #1a2332;
    --mlg-muted:      #64748b;
    --mlg-radius:     14px;
    --mlg-shadow:     0 4px 20px rgba(16,75,89,.08);
    --mlg-guide-color:#104B59;
}

/* ── RESET ── */
.mlg-archive-wrap *,
.mlg-single-wrap * {
    box-sizing: border-box;
}
.mlg-single-wrap {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body.mlg-modal-open { overflow: hidden; }

/* ── THÈME PXLTHEME : supprimer padding main et bloc titre blanc ── */
body.single-msl_guide #pxl-main,
body.post-type-archive-msl_guide #pxl-main,
body.tax-msl_guide_cat #pxl-main {
    padding: 0 !important;
    min-height: 0 !important;
}

body.single-msl_guide #pxl-page-title-elementor,
body.post-type-archive-msl_guide #pxl-page-title-elementor,
body.tax-msl_guide_cat #pxl-page-title-elementor {
    display: none !important;
}

/* ── THÈME : masquer espaces et titre natif sur les pages guides ── */
body.single-msl_guide .mlg-single-wrap,
body.post-type-archive-msl_guide .mlg-archive-wrap {
    margin-top: 0 !important;
}

/* Hello Elementor — supprime padding/margin des wrappers */
body.single-msl_guide .page-content,
body.single-msl_guide .elementor-section-wrap,
body.single-msl_guide .e--ua-firefox,
body.post-type-archive-msl_guide .page-content,
body.post-type-archive-msl_guide .elementor-section-wrap,
body.single-msl_guide .site-main,
body.single-msl_guide #main,
body.single-msl_guide main,
body.single-msl_guide .content-area,
body.single-msl_guide #primary,
body.single-msl_guide .entry-content,
body.single-msl_guide .post-content,
body.single-msl_guide article.msl_guide {
    padding: 0 !important;
    margin: 0 !important;
}

body.post-type-archive-msl_guide .site-main,
body.post-type-archive-msl_guide #main,
body.post-type-archive-msl_guide main,
body.post-type-archive-msl_guide .content-area,
body.post-type-archive-msl_guide #primary {
    padding: 0 !important;
    margin: 0 !important;
}

/* Masque le titre de la page généré automatiquement par le thème */
body.single-msl_guide .entry-header,
body.single-msl_guide .entry-title,
body.single-msl_guide .page-header,
body.single-msl_guide .page-title,
body.single-msl_guide h1.entry-title,
body.single-msl_guide h2.entry-title,
body.post-type-archive-msl_guide .entry-header,
body.post-type-archive-msl_guide .page-header,
body.post-type-archive-msl_guide .page-title,
body.post-type-archive-msl_guide h1.entry-title {
    display: none !important;
}

/* ════════════════════════════════════════════════════
   ARCHIVE — HERO
   ════════════════════════════════════════════════════ */
.mlg-archive-wrap {
    min-height: 60vh;
    background: var(--mlg-bg);
}

.mlg-archive-hero {
    background: linear-gradient(135deg, var(--mlg-primary) 0%, var(--mlg-primary-l) 100%);
    padding: 60px 20px 40px;
    text-align: center;
    position: relative;
    overflow: visible; /* NE PAS mettre overflow:hidden — coupe le dropdown de recherche */
}
.mlg-archive-hero::before {
    content: '🐰';
    position: absolute;
    font-size: 160px;
    opacity: .05;
    right: 5%;
    top: -20px;
    line-height: 1;
    pointer-events: none;
    clip-path: inset(0);
}
.mlg-archive-hero-inner {
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.mlg-archive-hero h1 {
    color: #fff !important;
    font-size: clamp(1.8rem, 4vw, 2.6rem) !important;
    font-weight: 900 !important;
    margin: 0 0 10px !important;
    line-height: 1.2 !important;
}
.mlg-archive-hero p {
    color: rgba(255,255,255,.8) !important;
    font-size: 1.05rem !important;
    margin: 0 0 24px !important;
}

/* Barre de recherche */
.mlg-search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}
.mlg-search-bar input {
    width: 100%;
    padding: 14px 20px !important;
    border: none !important;
    border-radius: 50px !important;
    font-size: 15px !important;
    background: #fff !important;
    color: var(--mlg-text) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.15) !important;
    outline: none !important;
}
.mlg-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.15);
    z-index: 99999;
    overflow: hidden;
    border: 1px solid var(--mlg-border);
}
.mlg-sr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px !important;
    text-decoration: none !important;
    color: var(--mlg-text) !important;
    border-bottom: 1px solid var(--mlg-border);
    transition: background .15s;
}
.mlg-sr-item:last-child { border-bottom: none; }
.mlg-sr-item:hover { background: var(--mlg-bg); }
.mlg-sr-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--mlg-bg); }
.mlg-sr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mlg-sr-no-thumb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.mlg-sr-info { min-width: 0; }
.mlg-sr-info strong { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlg-sr-excerpt { font-size: 12px; color: var(--mlg-muted); display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlg-sr-cat { display: inline-block; font-size: 11px; background: var(--mlg-accent-l); color: var(--mlg-accent); font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-bottom: 3px; }
.mlg-sr-empty { padding: 16px; text-align: center; color: var(--mlg-muted); font-size: 14px; }

/* ── BODY ── */
.mlg-archive-body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ── CATÉGORIES ── */
.mlg-cats-wrap {
    margin-bottom: 28px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mlg-cats-wrap::-webkit-scrollbar { display: none; }

.mlg-cats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

@media (max-width: 640px) {
    .mlg-cats-bar {
        flex-wrap: nowrap;
        width: max-content;
        padding-bottom: 4px;
    }
}

.mlg-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px !important;
    border-radius: 50px;
    background: #fff;
    border: 1.5px solid var(--mlg-border);
    color: var(--mlg-text) !important;
    font-weight: 700;
    font-size: 13px !important;
    text-decoration: none !important;
    transition: all .2s;
    white-space: nowrap;
}
.mlg-cat-btn:hover, .mlg-cat-btn.active {
    background: var(--mlg-primary);
    color: #fff !important;
    border-color: var(--mlg-primary);
}
.mlg-cat-count {
    background: rgba(0,0,0,.1);
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 11px;
}
.mlg-cat-btn.active .mlg-cat-count { background: rgba(255,255,255,.25); }

/* Catégories cachées (races isolées) */
.mlg-cats-hidden { display: none; }
.mlg-cats-hidden.open { display: contents; }

/* Bouton toggle */
.mlg-cat-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 50px;
    background: transparent;
    border: 1.5px dashed var(--mlg-border);
    color: var(--mlg-primary);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    font-family: inherit;
}
.mlg-cat-toggle:hover {
    background: var(--mlg-primary);
    color: #fff;
    border-color: var(--mlg-primary);
    border-style: solid;
}
.mlg-cat-toggle .mlg-toggle-label-less { display: none; }
.mlg-cat-toggle.open .mlg-toggle-label-more { display: none; }
.mlg-cat-toggle.open .mlg-toggle-label-less { display: inline; }

/* ── TITRE DE SECTION ── */
.mlg-section-title {
    font-size: 1.2rem !important;
    font-weight: 900 !important;
    color: var(--mlg-primary) !important;
    margin: 0 0 18px !important;
}

/* ── FEATURED GRID ── */
.mlg-featured-section { margin-bottom: 40px; }
.mlg-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.mlg-featured-card {
    display: block;
    border-radius: var(--mlg-radius);
    overflow: hidden;
    text-decoration: none !important;
    background: var(--mlg-card);
    box-shadow: var(--mlg-shadow);
    transition: transform .2s, box-shadow .2s;
    border-top: 4px solid var(--mlg-guide-color);
}
.mlg-featured-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(16,75,89,.14); }
.mlg-featured-thumb {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--mlg-bg);
}
.mlg-no-thumb { background: linear-gradient(135deg, var(--mlg-bg), var(--mlg-border)); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.mlg-featured-body { padding: 18px; }
.mlg-featured-body h3 { font-size: 1.05rem !important; font-weight: 800 !important; color: var(--mlg-text) !important; margin: 4px 0 8px !important; line-height: 1.3 !important; }
.mlg-featured-body p { font-size: 13px !important; color: var(--mlg-muted) !important; margin: 0 0 12px !important; line-height: 1.5 !important; }
.mlg-card-cat { display: inline-block; font-size: 11px; font-weight: 700; color: var(--mlg-accent); background: var(--mlg-accent-l); padding: 3px 10px; border-radius: 20px; margin-bottom: 4px; }
.mlg-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.mlg-meta-tag { font-size: 12px; color: var(--mlg-muted); background: var(--mlg-bg); padding: 4px 10px; border-radius: 20px; font-weight: 600; }

/* ── GRILLE GUIDES ── */
.mlg-guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.mlg-guide-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--mlg-radius);
    overflow: hidden;
    text-decoration: none !important;
    background: var(--mlg-card);
    box-shadow: var(--mlg-shadow);
    transition: transform .2s, box-shadow .2s;
    border: 1px solid var(--mlg-border);
}
.mlg-guide-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(16,75,89,.12); }
.mlg-guide-card-thumb { position: relative; height: 140px; overflow: hidden; background: var(--mlg-bg); }
.mlg-guide-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.mlg-guide-card:hover .mlg-guide-card-thumb img { transform: scale(1.04); }
.mlg-thumb-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 36px; color: var(--mlg-muted); }
.mlg-card-color-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: var(--mlg-guide-color); }
.mlg-guide-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.mlg-guide-card-body h3 { font-size: .95rem !important; font-weight: 800 !important; color: var(--mlg-text) !important; margin: 4px 0 6px !important; line-height: 1.3 !important; }
.mlg-card-excerpt { font-size: 12px !important; color: var(--mlg-muted) !important; line-height: 1.5 !important; margin: 0 0 10px !important; flex: 1; }
.mlg-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.mlg-card-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.mlg-chip { font-size: 11px; color: var(--mlg-muted); background: var(--mlg-bg); padding: 3px 8px; border-radius: 20px; font-weight: 600; }
.mlg-chip-chapters { font-size: 11px; color: var(--mlg-primary); font-weight: 700; white-space: nowrap; }

/* ── PAGINATION ── */
.mlg-pagination { text-align: center; margin-top: 40px; }
.mlg-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--mlg-border); background: #fff; color: var(--mlg-text) !important; text-decoration: none !important; font-weight: 700; font-size: 14px; margin: 0 3px; transition: all .2s; }
.mlg-pagination .page-numbers.current { background: var(--mlg-primary); color: #fff !important; border-color: var(--mlg-primary); }
.mlg-pagination .page-numbers:hover:not(.current) { border-color: var(--mlg-primary); color: var(--mlg-primary) !important; }
.mlg-pagination .page-numbers.prev, .mlg-pagination .page-numbers.next { width: auto; padding: 0 16px; }

/* ── EMPTY ── */
.mlg-empty-state { text-align: center; padding: 60px 20px; }
.mlg-empty-icon { font-size: 48px; margin-bottom: 16px; }

/* ════════════════════════════════════════════════════
   SINGLE GUIDE
   ════════════════════════════════════════════════════ */
.mlg-single-wrap { min-height: 60vh; background: var(--mlg-bg); }

/* ── HERO ── */
.mlg-single-hero {
    background: linear-gradient(135deg, var(--mlg-primary) 0%, var(--mlg-primary-l) 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}
.mlg-single-hero-overlay {
    background: linear-gradient(to right, rgba(16,75,89,.92) 60%, rgba(16,75,89,.70) 100%);
    padding: 56px 24px 40px;
}
.mlg-single-hero-inner { max-width: 800px; margin: 0 auto; position: relative; z-index: 1; }

.mlg-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.mlg-breadcrumb a { color: rgba(255,255,255,.7) !important; text-decoration: none !important; font-size: 13px; font-weight: 600; }
.mlg-breadcrumb a:hover { color: #fff !important; }
.mlg-breadcrumb span { color: rgba(255,255,255,.4); }

.mlg-single-hero h1 {
    color: #fff !important;
    font-size: clamp(1.5rem, 3.5vw, 2.2rem) !important;
    font-weight: 900 !important;
    margin: 0 0 10px !important;
    line-height: 1.25 !important;
}
.mlg-hero-excerpt { color: rgba(255,255,255,.82) !important; font-size: 1rem !important; margin: 0 0 16px !important; line-height: 1.6 !important; }
.mlg-hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.mlg-hero-meta span { background: rgba(255,255,255,.15); color: rgba(255,255,255,.9); padding: 5px 14px; border-radius: 50px; font-size: 13px; font-weight: 700; }

/* Barre progression globale */
.mlg-global-progress { margin-top: 12px; }
.mlg-global-progress-bar { height: 6px; background: rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.mlg-global-progress-fill { height: 100%; background: #FF7D44; border-radius: 3px; transition: width .5s ease; }
.mlg-global-progress-label { font-size: 12px; color: rgba(255,255,255,.75); font-weight: 600; }

/* ── LAYOUT ── */
.mlg-single-layout {
    display: flex;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    gap: 28px;
}

/* ── TABLE DES MATIÈRES ── */
.mlg-toc-sidebar {
    width: 270px;
    flex-shrink: 0;
    background: var(--mlg-card);
    border-radius: var(--mlg-radius);
    border: 1px solid var(--mlg-border);
    box-shadow: var(--mlg-shadow);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    transition: width .25s ease, opacity .25s;
    scrollbar-width: thin;
}
.mlg-toc-sidebar.collapsed {
    width: 44px;
    /* PAS de overflow:hidden ici — couperait le contenu qui suit sur mobile */
    border-radius: 10px;
}
.mlg-toc-sidebar.collapsed .mlg-toc-nav,
.mlg-toc-sidebar.collapsed .mlg-toc-footer { display: none !important; }
.mlg-toc-sidebar.collapsed .mlg-toc-header {
    padding: 0;
    border-bottom: none;
    justify-content: center;
    min-height: 44px;
    overflow: hidden; /* overflow uniquement sur le header, pas le sidebar */
}
.mlg-toc-sidebar.collapsed .mlg-toc-header span { display: none; }
.mlg-toc-sidebar.collapsed .mlg-toc-toggle-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 0;
    pointer-events: all !important;
}

.mlg-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    font-weight: 800;
    font-size: 13px;
    color: var(--mlg-primary);
    border-bottom: 1px solid var(--mlg-border);
    position: sticky;
    top: 0;
    background: var(--mlg-card);
    z-index: 2;
}
.mlg-toc-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mlg-muted);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}
.mlg-toc-toggle-btn:hover { background: var(--mlg-bg); }

.mlg-toc-nav { padding: 8px 0; }
.mlg-toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    text-decoration: none !important;
    color: var(--mlg-muted) !important;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.mlg-toc-item:hover { color: var(--mlg-primary) !important; background: var(--mlg-bg); }
.mlg-toc-item.active { color: var(--mlg-primary) !important; border-left-color: var(--mlg-accent); background: var(--mlg-accent-l); }
.mlg-toc-item.done .mlg-toc-title { color: var(--mlg-muted); }
.mlg-toc-num { font-size: 11px; font-weight: 800; color: var(--mlg-accent); min-width: 18px; }
.mlg-toc-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlg-toc-check { font-size: 12px; color: #22c55e; font-weight: 800; display: none; flex-shrink: 0; }

.mlg-toc-footer { padding: 10px 14px 14px; border-top: 1px solid var(--mlg-border); }
.mlg-gallery-open-btn {
    width: 100%;
    padding: 9px !important;
    background: var(--mlg-bg);
    border: 1.5px solid var(--mlg-border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mlg-primary);
    cursor: pointer;
    transition: all .2s;
}
.mlg-gallery-open-btn:hover { border-color: var(--mlg-primary); background: #fff; }

/* ── CONTENU PRINCIPAL ── */
.mlg-single-main { flex: 1; min-width: 0; }

/* ── CHAPITRES ── */
.mlg-chapters-wrap { display: flex; flex-direction: column; gap: 28px; }

.mlg-chapter {
    background: var(--mlg-card);
    border-radius: var(--mlg-radius);
    border: 1px solid var(--mlg-border);
    box-shadow: var(--mlg-shadow);
    overflow: hidden;
    scroll-margin-top: 90px;
}

.mlg-chapter-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--mlg-border);
    background: linear-gradient(to right, rgba(16,75,89,.03), transparent);
}
.mlg-chapter-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--mlg-guide-color, var(--mlg-primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 15px;
    flex-shrink: 0;
}
.mlg-chapter-title {
    flex: 1;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: var(--mlg-text) !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}

/* Bouton "Marquer comme lu" */
.mlg-mark-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 50px;
    border: 1.5px solid var(--mlg-border);
    background: #fff;
    color: var(--mlg-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.mlg-mark-btn:hover { border-color: #22c55e; color: #22c55e; }
.mlg-mark-btn.done { background: #f0fdf4; border-color: #22c55e; color: #22c55e; }
.mlg-mark-btn.pulse { animation: mlg-pulse .5s ease; }
@keyframes mlg-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Image chapitre */
.mlg-chapter-image {
    padding: 20px 20px 0;
}
.mlg-chapter-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    cursor: zoom-in;
    transition: opacity .2s;
    display: block;
}
.mlg-chapter-image img:hover { opacity: .92; }

/* Contenu chapitre */
.mlg-chapter-content {
    padding: 20px;
    color: var(--mlg-text);
    font-size: 15px;
    line-height: 1.8;
}
.mlg-chapter-content h2, .mlg-chapter-content h3 { color: var(--mlg-primary) !important; margin-top: 24px !important; }
.mlg-chapter-content h3 { font-size: 1.05rem !important; }
.mlg-chapter-content p { margin-bottom: 14px; }
.mlg-chapter-content ul, .mlg-chapter-content ol { padding-left: 22px; margin-bottom: 14px; }
.mlg-chapter-content li { margin-bottom: 6px; }
.mlg-chapter-content a { color: var(--mlg-accent) !important; }
.mlg-chapter-content img { max-width: 100%; border-radius: 8px; margin: 10px 0; }
.mlg-chapter-content blockquote {
    border-left: 4px solid var(--mlg-accent);
    margin: 16px 0;
    padding: 12px 18px;
    background: var(--mlg-accent-l);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--mlg-muted);
}
.mlg-chapter-content strong { color: var(--mlg-primary); }
.mlg-chapter-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.mlg-chapter-content th { background: var(--mlg-primary); color: #fff; padding: 10px 14px; text-align: left; font-size: 13px; }
.mlg-chapter-content td { border: 1px solid var(--mlg-border); padding: 10px 14px; font-size: 14px; }
.mlg-chapter-content tr:nth-child(even) td { background: var(--mlg-bg); }

/* Nav chapitre */
.mlg-chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid var(--mlg-border);
    background: var(--mlg-bg);
    gap: 10px;
    flex-wrap: wrap;
}
.mlg-chapter-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px !important;
    border-radius: 50px;
    border: 1.5px solid var(--mlg-border);
    background: #fff;
    color: var(--mlg-text) !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all .2s;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mlg-chapter-nav-btn:hover { border-color: var(--mlg-primary); color: var(--mlg-primary) !important; }
.mlg-chapter-nav-btn.mlg-next { background: var(--mlg-primary); color: #fff !important; border-color: var(--mlg-primary); }
.mlg-chapter-nav-btn.mlg-next:hover { background: var(--mlg-primary-l); }
.mlg-guide-complete { display: flex; align-items: center; gap: 8px; padding: 8px 18px; background: #f0fdf4; border-radius: 50px; border: 1.5px solid #22c55e; color: #16a34a; font-weight: 800; font-size: 14px; }

/* ── GUIDES LIÉS ── */
.mlg-related-section { margin-top: 40px; }
.mlg-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.mlg-related-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--mlg-radius);
    overflow: hidden;
    text-decoration: none !important;
    background: var(--mlg-card);
    border: 1px solid var(--mlg-border);
    box-shadow: var(--mlg-shadow);
    transition: transform .2s;
    border-top: 3px solid var(--mlg-guide-color);
}
.mlg-related-card:hover { transform: translateY(-3px); }
.mlg-related-thumb { height: 110px; background-size: cover; background-position: center; background-color: var(--mlg-bg); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.mlg-related-body { padding: 12px; }
.mlg-related-body h3 { font-size: .9rem !important; font-weight: 800 !important; color: var(--mlg-text) !important; margin: 4px 0 6px !important; line-height: 1.3 !important; }
.mlg-related-chapters { font-size: 12px; color: var(--mlg-muted); font-weight: 600; }

/* ════════════════════════════════════════════════════
   GALERIE + LIGHTBOX
   ════════════════════════════════════════════════════ */
.mlg-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.mlg-gallery-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
}
.mlg-gallery-inner {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 18px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.mlg-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mlg-border);
    font-weight: 800;
    color: var(--mlg-primary);
    flex-shrink: 0;
}
.mlg-gallery-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--mlg-border);
    background: var(--mlg-bg);
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.mlg-gallery-close:hover { background: #fee2e2; border-color: #ef4444; color: #ef4444; }
.mlg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 20px;
    overflow-y: auto;
}
.mlg-gallery-item {
    border-radius: 10px;
    overflow: hidden;
    cursor: zoom-in;
    aspect-ratio: 1;
    background: var(--mlg-bg);
}
.mlg-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; display: block; }
.mlg-gallery-item:hover img { transform: scale(1.06); }

.mlg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.mlg-lightbox-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.9); }
.mlg-lightbox-close {
    position: fixed;
    top: 16px; right: 20px;
    z-index: 2;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.mlg-lightbox-close:hover { background: rgba(255,255,255,.25); }
.mlg-lightbox-img {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

/* ════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════ */
@media (max-width: 960px) {
    .mlg-single-layout { flex-direction: column; }
    .mlg-toc-sidebar {
        width: 100% !important; /* override collapsed width */
        position: relative;
        top: auto;
        max-height: none;
        overflow: visible !important; /* ne jamais clipper sur mobile */
    }
    .mlg-toc-sidebar.collapsed {
        width: 100% !important;
        height: auto;
    }
    .mlg-toc-sidebar.collapsed .mlg-toc-header {
        min-height: 46px;
        overflow: visible;
        justify-content: space-between;
        padding: 0 14px;
    }
    .mlg-toc-sidebar.collapsed .mlg-toc-header span { display: block; opacity: 0.5; }
    .mlg-toc-toggle-btn { display: none; }
}

@media (max-width: 600px) {
    .mlg-archive-hero { padding: 40px 16px 30px; }
    .mlg-archive-body { padding: 20px 16px 40px; }
    .mlg-featured-grid, .mlg-guides-grid { grid-template-columns: 1fr; }
    .mlg-single-layout { padding: 12px 12px 40px; overflow-x: hidden; width: 100%; }
    .mlg-single-main { width: 100%; max-width: 100%; overflow-x: hidden; }
    .mlg-chapter-section { width: 100%; max-width: 100%; overflow-x: hidden; }
    .mlg-chapter-body { width: 100%; max-width: 100%; word-break: break-word; }
    .mlg-chapter-head { flex-wrap: wrap; }
    .mlg-mark-btn { font-size: 12px; padding: 6px 10px; }
    .mlg-mark-btn .mlg-mark-label { display: none; }
    .mlg-chapter-nav { flex-direction: column; }
    .mlg-chapter-nav-btn { max-width: 100%; width: 100%; justify-content: center; }
    .mlg-related-grid { grid-template-columns: 1fr 1fr; }
    .mlg-gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .mlg-rating-share { grid-template-columns: 1fr; }
    .mlg-share-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Animation emoji décoratif hero (identique au hero quiz CA) ── */
@keyframes mlg-float {
    0%, 100% { transform: translateY(0) rotate(-15deg); }
    50%       { transform: translateY(-20px) rotate(-12deg); }
}

.mlg-archive-hero::before {
    animation: mlg-float 6s ease-in-out infinite;
    transform: rotate(-15deg);
}

/* ════════════════════════════════════════════════════
   NOTATION & PARTAGE
   ════════════════════════════════════════════════════ */
.mlg-rating-share {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 32px 0;
}
@media (max-width: 700px) { .mlg-rating-share { grid-template-columns: 1fr; } }

.mlg-rating-box,
.mlg-share-box {
    background: #fff;
    border: 1px solid var(--mlg-border);
    border-radius: 14px;
    padding: 20px 22px;
}

.mlg-rs-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--mlg-muted);
    margin-bottom: 14px;
}

/* Résumé notation */
.mlg-rating-summary {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.mlg-rating-big { text-align: center; }
.mlg-rating-num { font-size: 38px; font-weight: 900; color: var(--mlg-primary); line-height: 1; }
.mlg-rating-stars-display { display: flex; gap: 2px; justify-content: center; margin: 5px 0 3px; }
.mlg-rating-count { font-size: 12px; color: var(--mlg-muted); }
.mlg-rating-bars { flex: 1; }
.mlg-bar-row { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.mlg-bar-lbl { font-size: 12px; color: var(--mlg-muted); width: 10px; text-align: right; }
.mlg-bar-track { flex: 1; height: 6px; background: var(--mlg-border); border-radius: 3px; overflow: hidden; }
.mlg-bar-fill { height: 100%; background: #F59E0B; border-radius: 3px; transition: width .4s; }
.mlg-bar-count { font-size: 11px; color: var(--mlg-muted); width: 20px; }

/* Étoiles interactives */
.mlg-stars-input {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}
.mlg-star-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s;
    border-radius: 6px;
}
.mlg-star-btn:hover { transform: scale(1.2); }
.mlg-star-btn svg { width: 28px; height: 28px; }
.mlg-star-label { font-size: 13px; color: var(--mlg-muted); margin-left: 4px; min-width: 100px; }
.mlg-already-rated { font-size: 13px; color: var(--mlg-accent); margin: 8px 0 0; }
.mlg-rate-thanks { font-size: 13px; color: #16a34a; margin-top: 8px; font-weight: 600; }

/* Boutons partage */
.mlg-share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.mlg-share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
    transition: opacity .15s, transform .15s;
    font-family: inherit;
}
.mlg-share-btn:hover { opacity: .88; transform: translateY(-1px); }
.mlg-share-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.mlg-share-fb { background: #1877F2; }
.mlg-share-wa { background: #25D366; }
.mlg-share-tt { background: #010101; }
.mlg-share-ig { background: #E1306C; }
.mlg-share-copy { background: var(--mlg-primary); grid-column: span 2; justify-content: center; }

/* ════════════════════════════════════════════════════
   BARRE DE PROGRESSION + TEMPS RESTANT
   ════════════════════════════════════════════════════ */
.mlg-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    z-index: 9999;
    transition: width .1s linear;
    pointer-events: none;
}

.mlg-reading-time {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--mlg-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    z-index: 9998;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    white-space: nowrap;
}
.mlg-reading-time.visible {
    opacity: 1;
    transform: translateY(0);
}
.mlg-reading-time.done {
    background: #16a34a;
}

@media (max-width: 600px) {
    .mlg-reading-time {
        bottom: 16px;
        right: 16px;
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* ════════════════════════════════════════════════════
   QUIZ
   ════════════════════════════════════════════════════ */
.mlg-quiz-wrap {
    background: #fff;
    border: 1px solid var(--mlg-border);
    border-radius: 16px;
    overflow: hidden;
    margin: 32px 0;
}

.mlg-quiz-trigger {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: linear-gradient(135deg, var(--mlg-primary) 0%, #1a6b7a 100%);
}
.mlg-quiz-trigger-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.mlg-quiz-trigger-title {
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 2px;
}
.mlg-quiz-trigger-sub { color: rgba(255,255,255,.75); font-size: 13px; }
.mlg-quiz-start-btn {
    margin-left: auto;
    background: #fff;
    color: var(--mlg-primary);
    border: none;
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform .15s, box-shadow .15s;
}
.mlg-quiz-start-btn:hover { transform: scale(1.04); }

/* Loading */
.mlg-quiz-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 28px 24px;
    color: var(--mlg-muted);
    font-size: 14px;
}
.mlg-quiz-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--mlg-border);
    border-top-color: var(--mlg-primary);
    border-radius: 50%;
    animation: mlg-spin .8s linear infinite;
    flex-shrink: 0;
}
@keyframes mlg-spin { to { transform: rotate(360deg); } }

/* Questions */
.mlg-quiz-questions { padding: 24px; }
.mlg-quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.mlg-quiz-progress-text { font-size: 13px; color: var(--mlg-muted); }
.mlg-quiz-progress-track {
    height: 4px;
    background: var(--mlg-border);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}
.mlg-quiz-progress-fill {
    height: 100%;
    background: var(--mlg-primary);
    border-radius: 2px;
    transition: width .4s ease;
}

.mlg-quiz-question-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--mlg-dark);
    margin-bottom: 16px;
    line-height: 1.5;
}

.mlg-quiz-options { display: flex; flex-direction: column; gap: 10px; }
.mlg-quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1.5px solid var(--mlg-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--mlg-dark);
    background: #fff;
    text-align: left;
    transition: border-color .15s, background .15s;
    width: 100%;
}
.mlg-quiz-option:hover { border-color: var(--mlg-primary); background: #f0f9fb; }
.mlg-quiz-option.correct { border-color: #16a34a; background: #f0fdf4; color: #15803d; }
.mlg-quiz-option.wrong   { border-color: #dc2626; background: #fef2f2; color: #dc2626; }
.mlg-quiz-option.disabled { cursor: default; }
.mlg-quiz-option.disabled:hover { border-color: var(--mlg-border); background: #fff; }
.mlg-quiz-option.correct.disabled:hover { border-color: #16a34a; background: #f0fdf4; }
.mlg-quiz-option.wrong.disabled:hover   { border-color: #dc2626; background: #fef2f2; }

.mlg-quiz-option-letter {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--mlg-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800;
    flex-shrink: 0;
    transition: background .15s;
}
.mlg-quiz-option.correct .mlg-quiz-option-letter { background: #16a34a; color: #fff; }
.mlg-quiz-option.wrong   .mlg-quiz-option-letter { background: #dc2626; color: #fff; }

.mlg-quiz-feedback {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: none;
}
.mlg-quiz-feedback.correct { background: #f0fdf4; color: #15803d; }
.mlg-quiz-feedback.wrong   { background: #fef2f2; color: #dc2626; }

.mlg-quiz-next-btn {
    margin-top: 16px;
    background: var(--mlg-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: none;
    transition: opacity .15s;
}
.mlg-quiz-next-btn:hover { opacity: .88; }

/* Résultat final */
.mlg-quiz-result {
    padding: 32px 24px;
    text-align: center;
}
.mlg-quiz-score-circle {
    width: 90px; height: 90px;
    border-radius: 50%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 26px; font-weight: 900;
}
.mlg-quiz-score-circle.great  { background: #f0fdf4; color: #16a34a; border: 3px solid #16a34a; }
.mlg-quiz-score-circle.good   { background: #fffbeb; color: #d97706; border: 3px solid #d97706; }
.mlg-quiz-score-circle.retry  { background: #fef2f2; color: #dc2626; border: 3px solid #dc2626; }
.mlg-quiz-score-label { font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.mlg-quiz-result-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.mlg-quiz-result-sub   { font-size: 14px; color: var(--mlg-muted); margin-bottom: 20px; }
.mlg-quiz-retry-btn {
    background: none;
    border: 2px solid var(--mlg-primary);
    color: var(--mlg-primary);
    border-radius: 50px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.mlg-quiz-retry-btn:hover { background: var(--mlg-primary); color: #fff; }

@media (max-width: 600px) {
    .mlg-quiz-trigger { flex-wrap: wrap; gap: 12px; }
    .mlg-quiz-start-btn { margin-left: 0; width: 100%; justify-content: center; }
}

/* ════════════════════════════════════════════════════
   BOUTON RETOUR AUX GUIDES
   ════════════════════════════════════════════════════ */
.mlg-back-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px 0;
    font-size: 13px;
}
.mlg-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mlg-primary);
    font-weight: 700;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 50px;
    border: 1.5px solid var(--mlg-primary);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.mlg-back-btn:hover { background: var(--mlg-primary); color: #fff; }
.mlg-back-sep { color: var(--mlg-muted); }
.mlg-back-cat {
    color: var(--mlg-muted);
    text-decoration: none;
    font-weight: 600;
}
.mlg-back-cat:hover { color: var(--mlg-primary); }

/* ════════════════════════════════════════════════════
   LIENS INTERNES AUTOMATIQUES
   ════════════════════════════════════════════════════ */
.mlg-autolink {
    color: var(--mlg-primary);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color .15s;
}
.mlg-autolink:hover { color: var(--mlg-accent); text-decoration-style: solid; }
