.is-mode-long.post-display-overlay {
    padding: var(--long-reader-modal-margin);
    background: rgba(245, 247, 250, .7);
    -webkit-backdrop-filter: blur(2.5px);
    backdrop-filter: blur(2.5px);
}

.is-mode-long .post-display-dialog {
    width: min(calc(100vw - (2 * var(--long-reader-modal-margin))), 1520px);
    height: calc(100vh - (2 * var(--long-reader-modal-margin)));
    max-width: 1520px;
    max-height: none;
    margin: auto;
}

.is-mode-long .post-display-header {
    position: sticky;
    top: 0;
}

.is-mode-long .post-display-layout {
    grid-template-columns: minmax(170px, 210px) minmax(0, 1fr) minmax(310px, 360px);
    grid-template-rows: minmax(0, 1fr);
    justify-content: center;
    height: 100%;
    min-height: 0;
    padding: 18px;
}


/* AV.1 R7 — un article sans H2/H3 n'a pas de sommaire : ne jamais réserver
 * une colonne vide qui ferait tomber le lecteur dans les 165–190 px du TOC. */
.is-mode-long .post-display-layout.post-display-layout-no-toc {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
}

.is-mode-long .post-display-layout.post-display-layout-no-toc .post-display-reader {
    max-width: 980px;
}

.is-mode-long .blog-modal-post {
    height: 100%;
    min-height: 0;
}

.is-mode-long .post-display-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.is-mode-long .post-display-reader {
    position: relative;
    width: 100%;
    max-width: 860px;
    min-height: 0;
    padding-right: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.is-mode-long .post-display-reader .blog-modal-content-body {
    max-width: 78ch;
    font-family: var(--bs-body-font-family, system-ui, -apple-system, "Segoe UI", sans-serif);
    font-size: 1rem;
    line-height: 1.65;
}

.is-mode-long .post-display-reader .blog-modal-content-body h2,
.is-mode-long .post-display-reader .blog-modal-content-body h3 {
    scroll-margin-top: 92px;
}

.is-mode-long .post-display-reader .blog-modal-content-body p {
    margin: 0 0 .9rem;
}

.is-mode-long .post-display-reader .blog-modal-content-body h2 {
    margin: 1.45rem 0 .75rem;
    font-size: 1.55rem;
    line-height: 1.25;
}

.is-mode-long .post-display-reader .blog-modal-content-body h3 {
    margin: 1.2rem 0 .65rem;
    font-size: 1.28rem;
    line-height: 1.3;
}

.post-display-toc {
    position: static;
    align-self: stretch;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: 12px;
    overflow: auto;
    border: 1px solid #d7dde6;
    border-radius: 12px;
    background: #eef1f5;
    box-shadow: inset -1px 0 0 rgba(148, 163, 184, .12);
}

.is-mode-long .post-display-interactions {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: 4px 0 0 16px;
    overflow: hidden;
}

.is-mode-long .post-display-interactions .blog-modal-comments {
    flex: 1 1 auto;
    min-height: 0;
    padding-right: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.is-mode-long .post-display-footer.is-inline {
    margin-top: 12px;
    padding: 12px 8px 0;
}

.post-display-toc-toggle {
    width: 100%;
    padding: 0 0 8px;
    border: 0;
    background: transparent;
    color: #1e293b;
    font-weight: 800;
    text-align: left;
}

.post-display-toc ol {
    margin: 0;
    padding-left: 24px;
    list-style-position: outside;
}

.post-display-toc li {
    margin: 7px 0;
    padding-left: 1px;
}

.post-display-toc li.is-subsection {
    margin-left: 12px;
    font-size: .9em;
}

.post-display-toc a {
    color: #475569;
    text-decoration: none;
}

.post-display-toc a.is-active {
    color: #1d4ed8;
    font-weight: 800;
}

:root[data-theme="dark"] .post-display-toc {
    border-color: rgba(148, 163, 184, .28);
    background: #1b273b;
}

:root[data-theme="dark"] .is-mode-long.post-display-overlay {
    background: rgba(15, 23, 42, .58);
}

:root[data-theme="dark"] .post-display-toc-toggle,
:root[data-theme="dark"] .post-display-toc a {
    color: #cbd5e1;
}

:root[data-theme="dark"] .post-display-toc a.is-active {
    color: #93c5fd;
}

@media (max-width: 1280px) {
    .is-mode-long .post-display-layout {
        grid-template-columns: minmax(0, 820px) minmax(300px, 350px);
        grid-template-rows: auto minmax(0, 1fr);
    }

    .post-display-toc {
        grid-column: 1 / -1;
        height: auto;
        max-height: 220px;
    }
}

@media (max-width: 820px) {
    .is-mode-long.post-display-overlay {
        padding: 0;
    }

    .is-mode-long .post-display-dialog {
        width: 100vw;
        height: 100dvh;
    }

    .is-mode-long .post-display-layout {
        display: block;
        height: auto;
    }

    .post-display-toc {
        height: auto;
        max-height: none;
        margin-bottom: 18px;
    }

    .post-display-toc-toggle[aria-expanded="false"] + ol {
        display: none;
    }

    .is-mode-long .post-display-content,
    .is-mode-long .post-display-reader,
    .is-mode-long .post-display-interactions {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .is-mode-long.post-display-overlay {
        background: rgba(245, 247, 250, .84);
    }

    :root[data-theme="dark"] .is-mode-long.post-display-overlay {
        background: rgba(15, 23, 42, .72);
    }
}

/*
 * Version 2026.07.27.6.4 : lecteur long réellement défilable sur téléphone.
 * Le sommaire devient un menu compact superposé au lieu de pousser tout l'article.
 */
.post-display-toc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.post-display-toc-toggle-icon {
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 820px) {
    .is-mode-long .post-display-dialog {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .is-mode-long .post-display-content {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        -webkit-overflow-scrolling: touch;
    }

    .is-mode-long .post-display-layout {
        display: flex;
        min-height: 100%;
        height: auto;
        flex-direction: column;
        gap: 0;
        padding: 12px;
    }

    .is-mode-long .post-display-reader {
        order: 2;
        width: 100%;
        max-width: none;
        min-height: 0;
        padding-right: 0;
        overflow: visible;
    }

    .is-mode-long .post-display-interactions {
        order: 3;
        width: 100%;
        height: auto;
        min-height: 0;
        margin-top: 22px;
        padding: 18px 0 4px;
        overflow: visible;
        border-top: 1px solid rgba(148, 163, 184, .3);
        border-left: 0;
    }

    .is-mode-long .post-display-interactions .blog-modal-comments {
        overflow: visible;
    }

    .post-display-toc {
        position: sticky;
        z-index: 18;
        top: 0;
        order: 1;
        width: auto;
        height: auto;
        min-height: 0;
        max-height: none;
        align-self: flex-start;
        margin: 0 0 10px;
        padding: 0;
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .post-display-toc-toggle {
        width: auto;
        padding: 8px 12px;
        border: 1px solid #cbd5e1;
        border-radius: 999px;
        color: #334155;
        background: rgba(238, 241, 245, .97);
        box-shadow: 0 4px 14px rgba(15, 23, 42, .1);
    }

    .post-display-toc ol {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        width: min(360px, calc(100vw - 32px));
        max-height: min(62dvh, 520px);
        margin: 0;
        padding: 12px 14px 12px 36px;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        border: 1px solid #d7dde6;
        border-radius: 14px;
        background: #eef1f5;
        box-shadow: 0 16px 38px rgba(15, 23, 42, .2);
    }

    .post-display-toc ol[hidden] {
        display: none !important;
    }

    .post-display-toc li {
        margin: 8px 0;
    }

    :root[data-theme="dark"] .post-display-toc-toggle,
    :root[data-theme="dark"] .post-display-toc ol {
        color: #dbeafe;
        border-color: #475569;
        background: rgba(27, 39, 59, .98);
    }
}


/* Version 2026.07.27.6.5 : accès rapide aux commentaires et composeur mobile permanent. */
.post-display-comments-jump {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #334155;
    background: rgba(238, 241, 245, .97);
    font: inherit;
    font-weight: 750;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.post-display-comments-fab {
    position: absolute;
    z-index: 35;
    right: 18px;
    bottom: 22px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .48);
    border-radius: 50%;
    color: #fff;
    background: #2563eb;
    box-shadow: 0 9px 24px rgba(37, 99, 235, .32);
    font-size: 1.15rem;
    font-weight: 900;
}

.post-display-comments-fab:hover,
.post-display-comments-fab:focus-visible {
    background: #1d4ed8;
    transform: translateY(-1px);
}

:root[data-theme="dark"] .post-display-comments-jump {
    color: #dbeafe;
    border-color: #475569;
    background: rgba(27, 39, 59, .98);
}

@media (max-width: 820px) {
    .post-display-toc {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .post-display-comments-jump { display: inline-flex; }

    .post-display-toc ol {
        flex-basis: 100%;
    }

    .is-mode-long .post-display-content {
        padding-bottom: calc(min(46dvh, 360px) + 14px + env(safe-area-inset-bottom));
    }

    .is-mode-long .post-display-footer.is-inline {
        position: fixed;
        z-index: 120080;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: min(46dvh, calc(360px + env(safe-area-inset-bottom)));
        margin: 0;
        padding: 6px 10px calc(7px + env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        border-top: 1px solid rgba(148, 163, 184, .35);
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 -10px 28px rgba(15, 23, 42, .13);
    }

    :root[data-theme="dark"] .is-mode-long .post-display-footer.is-inline {
        background: rgba(17, 26, 44, .98);
    }

    .is-mode-long .post-display-footer.is-inline .blog-modal-social-summary {
        margin-bottom: 0;
        padding: 2px 0 4px;
    }

    .is-mode-long .post-display-footer.is-inline .blog-modal-social-actions {
        padding-bottom: 2px;
    }

    .is-mode-long .post-display-footer.is-inline .blog-modal-comment-form {
        padding: 5px 6px;
    }

    .post-display-comments-fab {
        position: fixed;
        z-index: 120090;
        right: 14px;
        bottom: calc(min(46dvh, 360px) + 22px + env(safe-area-inset-bottom));
        width: 44px;
        height: 44px;
    }
}

/* Le composeur mobile reste réellement visible: les résumés se compactent, le formulaire ne défile pas. */
@media (max-width: 820px) {
    .is-mode-long .post-display-footer.is-inline {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .is-mode-long .post-display-footer.is-inline .blog-modal-comment-bar-inner {
        display: flex;
        min-height: 0;
        max-height: 100%;
        flex-direction: column;
    }

    .is-mode-long .post-display-footer.is-inline .blog-modal-social-summary,
    .is-mode-long .post-display-footer.is-inline .blog-modal-social-actions {
        flex: 0 0 auto;
    }

    .is-mode-long .post-display-footer.is-inline .blog-modal-comment-form {
        position: sticky;
        z-index: 2;
        bottom: 0;
        flex: 0 0 auto;
        margin-top: 3px;
        background: inherit;
    }
}

/* Club Alex Borg 8.15.9.7.12 — polish desktop : la marge morte à droite
 * est rendue aux commentaires, sans écraser le corps de l'article. */
@media (min-width: 1281px) {
    .is-mode-long .post-display-layout {
        grid-template-columns: minmax(165px, 190px) minmax(0, 1fr) minmax(420px, 470px);
        gap: 14px;
        padding: 18px 8px 18px 16px;
    }

    .is-mode-long .post-display-reader {
        max-width: 810px;
        padding-right: 4px;
    }

    .is-mode-long .post-display-interactions {
        padding-left: 10px;
        padding-right: 0;
    }

    .is-mode-long .post-display-interactions .blog-modal-comments {
        padding-right: 2px;
    }


    .is-mode-long .post-display-layout.post-display-layout-no-toc {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 470px);
    }

    .is-mode-long .post-display-layout.post-display-layout-no-toc .post-display-reader {
        max-width: 980px;
    }

    .is-mode-long .post-display-footer.is-inline {
        padding-inline: 2px;
    }
}
