/* =============================================================================
   mlpublications.css — Gabarit natif des articles Publications v1.1.0
   MesLacets.fr · PHP 7.4 / PS 1.7.8
   ============================================================================= */

/* ── Variables ───────────────────────────────────────────────────────────────── */
.ml-pub-hero,
.ml-pub-layout,
.ml-pub-sidebar,
.ml-pub-nav {
    --ml-pink:       #FD0065;
    --ml-pink-light: #fff0f6;
    --ml-gray-100:   #f4f4f6;
    --ml-gray-200:   #e5e5e5;
    --ml-gray-300:   #d1d1d1;
    --ml-gray-500:   #7a7a7a;
    --ml-gray-700:   #3d3d3d;
    --ml-gray-900:   #1a1a1a;
    font-family:     Sarala, sans-serif;
}

/* ── HERO COMMUN ─────────────────────────────────────────────────────────────── */
.ml-pub-hero {
    width: 100%;
    margin-bottom: 28px;
    overflow: hidden;
}

/* ── HERO BANDEAU (image de fond) ───────────────────────────────────────────── */
.ml-pub-hero--bandeau {
    position: relative;
    min-height: 240px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.ml-pub-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 70%);
}

.ml-pub-hero--bandeau .ml-pub-hero__content {
    position: relative;
    z-index: 1;
    padding: 22px 26px;
    max-width: 680px;
}

.ml-pub-hero__date {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,.7);
    margin-bottom: 5px;
    letter-spacing: .02em;
}

.ml-pub-hero__texte {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    margin: 0;
}

/* ── HERO PLAIN (sans image) ─────────────────────────────────────────────────── */
.ml-pub-hero--plain {
    background: var(--ml-pink-light);
    border-left: 4px solid var(--ml-pink);
    padding: 18px 22px;
}

.ml-pub-hero__date--plain {
    display: block;
    font-size: 12px;
    color: var(--ml-gray-500);
    margin-bottom: 5px;
}

.ml-pub-hero__texte--plain {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ml-gray-900);
    line-height: 1.4;
    margin: 0;
}

/* ── HERO 3 VISUELS ──────────────────────────────────────────────────────────── */
.ml-pub-hero--3visuels {
    margin-bottom: 20px;
}

.ml-pub-hero3__grid {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.ml-pub-hero3__img {
    overflow: hidden;
    background: var(--ml-gray-100);
    line-height: 0;
    width: 307px;
    height: 294px;
    border: 1px solid #fd0065;
    flex-shrink: 0;
}

.ml-pub-hero3__img img {
    width: 307px;
    height: 294px;
    object-fit: cover;
    display: block;
}

.ml-pub-hero3__img--empty {
    background: var(--ml-gray-200);
}

.ml-pub-hero3__caption {
    padding: 12px 0 8px;
    display: flex;
    align-items: baseline;
    gap: 14px;
    border-bottom: 1px solid var(--ml-gray-200);
    margin-bottom: 20px;
}

.ml-pub-hero3__texte {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ml-gray-900);
    line-height: 1.4;
    margin: 0;
}

/* Masquer visuels 2 et 3 sur mobile */
@media (max-width: 767px) {
    .ml-pub-hero3__img--secondary {
        display: none;
    }
    .ml-pub-hero3__grid {
        grid-template-columns: 1fr;
    }
    .ml-pub-hero--bandeau {
        min-height: 160px;
    }
}

/* ── LAYOUT 2 COLONNES ──────────────────────────────────────────────────────── */
.ml-pub-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.ml-pub-main {
    flex: 1 1 0;
    min-width: 0;
}

.ml-pub-sidebar {
    flex: 0 0 280px;
    width: 280px;
    position: sticky;
    top: 16px;
}

/* ── SECTIONS ────────────────────────────────────────────────────────────────── */
.ml-pub-section {
    margin-bottom: 28px;
}

.ml-pub-empty {
    color: var(--ml-gray-500);
    font-style: italic;
}

/* H2 */
.ml-pub-h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ml-pink);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ml-gray-200);
    text-align: left !important;
}

/* Prose */
.ml-pub-prose {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ml-gray-700);
}

.ml-pub-prose p                  { margin: 0 0 1em; text-align: left; }
.ml-pub-prose ul,
.ml-pub-prose ol                 { margin: 0 0 1em 1.6em !important; padding: 0 !important; }
.ml-pub-prose ul                 { list-style: disc !important; }
.ml-pub-prose ol                 { list-style: decimal !important; }
.ml-pub-prose li                 { margin-bottom: .5em !important; padding-left: 0 !important;
                                   display: list-item !important; text-align: left !important;
                                   font-size: 15px !important; color: #7a7a7a !important; }
.ml-pub-prose li::before         { display: none !important; }
.ml-pub-prose a                  { color: var(--ml-pink); text-decoration: underline; }
.ml-pub-prose strong             { color: var(--ml-gray-900); }

/* Image */
.ml-pub-figure {
    margin: 0;
}

.ml-pub-figure img {
    width: 100%;
    display: block;
}

.ml-pub-figcaption {
    font-size: 12px;
    color: var(--ml-gray-500);
    margin-top: 6px;
    text-align: center;
}

.ml-pub-figcredit {
    font-style: italic;
}

/* Encadré */
.ml-pub-encadre {
    background: var(--ml-pink-light);
    border-left: 3px solid var(--ml-pink);
    padding: 14px 16px;
}

.ml-pub-encadre__titre {
    font-size: 12px;
    font-weight: 700;
    color: var(--ml-pink);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ml-pub-encadre__contenu {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ml-gray-700);
}

.ml-pub-encadre__contenu p              { margin: 0 0 .6em; }
.ml-pub-encadre__contenu p:last-child   { margin-bottom: 0; }

/* CTA */
.ml-pub-cta {
    border: 1px solid var(--ml-gray-200);
    padding: 16px;
    background: var(--ml-gray-100);
}

.ml-pub-cta__intro {
    font-size: 14px;
    color: var(--ml-gray-700);
    margin: 0 0 12px;
}

.ml-pub-cta__liens {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ml-pub-cta__btn {
    display: inline-block;
    padding: 9px 18px;
    background: var(--ml-pink);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}

.ml-pub-cta__btn:hover {
    background: #d30c5c;
    color: #fff;
}

/* FAQ */
.ml-pub-faq__item {
    border-bottom: 1px solid var(--ml-gray-200);
}

.ml-pub-faq__item:first-child {
    border-top: 1px solid var(--ml-gray-200);
}

.ml-pub-faq__question {
    font-size: 15px;
    font-weight: 600;
    color: var(--ml-gray-900);
    padding: 12px 0;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ml-pub-faq__question::-webkit-details-marker,
.ml-pub-faq__question::marker { display: none; }

.ml-pub-faq__question::after {
    content: '+';
    color: var(--ml-pink);
    font-size: 18px;
    font-weight: 400;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform .2s;
}

.ml-pub-faq__item[open] .ml-pub-faq__question::after {
    transform: rotate(45deg);
}

.ml-pub-faq__reponse {
    font-size: 14px;
    line-height: 1.65;
    color: var(--ml-gray-700);
    padding: 0 0 14px;
}

.ml-pub-faq__reponse p              { margin: 0 0 .7em; }
.ml-pub-faq__reponse p:last-child   { margin-bottom: 0; }

/* ── SIDEBAR ─────────────────────────────────────────────────────────────────── */
.ml-pub-sidebar__bloc {
    background: #fff;
    border: 1px solid var(--ml-gray-200);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.ml-pub-sidebar__titre {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ml-gray-500);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ml-gray-200);
}

/* Sommaire */
.ml-pub-toc ul,
.ml-pub-toc ul li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.ml-pub-toc li {
    margin-bottom: 5px;
}

.ml-pub-toc li::before {
    display: none !important;
}

.ml-pub-toc a {
    font-size: 13px;
    color: var(--ml-pink);
    text-decoration: none;
    line-height: 1.4;
    display: block;
    padding: 4px 0 4px 10px;
    border-left: 2px solid var(--ml-gray-200);
    transition: border-color .15s, background .15s, padding-left .1s;
    text-align: left;
}

.ml-pub-toc a:hover {
    border-left-color: var(--ml-pink);
    background: var(--ml-pink-light);
    padding-left: 14px;
}

/* Blocs libres */
.ml-pub-sidebar__contenu {
    font-size: 13px;
    line-height: 1.6;
    color: var(--ml-gray-700);
}

.ml-pub-sidebar__contenu a              { color: var(--ml-pink); text-decoration: none; }
.ml-pub-sidebar__contenu a:hover        { text-decoration: underline; }
.ml-pub-sidebar__contenu p              { margin: 0 0 .6em; }
.ml-pub-sidebar__contenu p:last-child   { margin-bottom: 0; }

/* Autres publications */
.ml-pub-autres__list,
.ml-pub-autres__list li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.ml-pub-autres__list li::before {
    display: none !important;
}

.ml-pub-autres__item {
    padding: 8px 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--ml-gray-200);
}

.ml-pub-autres__item:first-child {
    padding-top: 0 !important;
}

.ml-pub-autres__item:last-child {
    padding-bottom: 0 !important;
    border-bottom: none;
}

.ml-pub-autres__lien {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ml-gray-700);
    transition: color .15s;
}

.ml-pub-autres__lien:hover {
    color: var(--ml-pink);
}

.ml-pub-autres__img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    border: 1px solid #dadada;
}

.ml-pub-autres__img--empty {
    background: var(--ml-gray-100);
    border: 1px solid var(--ml-gray-200);
}

.ml-pub-autres__titre {
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}

/* ── NAVIGATION PRÉCÉDENT / SUIVANT ─────────────────────────────────────────── */
.ml-pub-nav {
    display: flex;
    gap: 2px;
    margin-top: 36px;
    border-top: 1px solid var(--ml-gray-200);
    padding-top: 20px;
}

.ml-pub-nav__item {
    flex: 1;
    min-width: 0;
}

.ml-pub-nav__item--next {
    text-align: right;
}

.ml-pub-nav__lien {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--ml-gray-700);
    padding: 12px 14px;
    border: 1px solid var(--ml-gray-200);
    transition: border-color .15s, background .15s;
}

.ml-pub-nav__item--next .ml-pub-nav__lien {
    justify-content: flex-end;
}

.ml-pub-nav__lien:hover {
    border-color: var(--ml-pink);
    background: var(--ml-pink-light);
    color: var(--ml-pink);
}

.ml-pub-nav__img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.ml-pub-nav__texte {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ml-pub-nav__texte--right {
    text-align: right;
}

.ml-pub-nav__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ml-gray-500);
}

.ml-pub-nav__lien:hover .ml-pub-nav__label {
    color: var(--ml-pink);
}

.ml-pub-nav__titre {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: inherit;
    /* Tronquer à 2 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .ml-pub-layout {
        flex-direction: column;
    }

    .ml-pub-sidebar {
        flex: none;
        width: 100%;
        position: static;
        order: -1;
    }

    /* Sur mobile : seul le sommaire visible en sidebar */
    .ml-pub-sidebar .ml-pub-sidebar__bloc:not(.ml-pub-sidebar__sommaire) {
        display: none;
    }

    .ml-pub-nav {
        flex-direction: column;
        gap: 10px;
    }

    .ml-pub-nav__item--next {
        text-align: left;
    }

    .ml-pub-nav__item--next .ml-pub-nav__lien {
        justify-content: flex-start;
    }

    .ml-pub-nav__texte--right {
        text-align: left;
    }

    .ml-pub-cta__liens {
        flex-direction: column;
    }

    .ml-pub-cta__btn {
        text-align: center;
    }
}

/* ── HOMEPAGE — grille compteurs 4 colonnes ────────────────────────────────── */
.ml-counters__grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 767px) {
    .ml-counters__grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
