/* ==========================================================
   MISE EN PAGE TROIS COLONNES
   gauche : navigation · centre : fil · droite : infos
   Les couleurs (--c-*) viennent de custom.css.
   Unités en px : Casper fixe 1rem = 10px.
   ========================================================== */

.gh-head[hidden] { display: none !important; }

.nf-shell.viewport {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(0, 660px) minmax(320px, 1fr);
    min-height: 100vh;
}

/* ---------- Colonne gauche ---------- */

.nf-left {
    display: flex;
    justify-content: flex-end;
}

.nf-left-inner {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    width: 250px;
    height: 100vh;
    padding: 24px 16px 20px;
    overflow-y: auto;
}

.nf-left-brand {
    display: block;
    margin: 0 0 18px 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--c-text);
}

.nf-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nf-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    align-self: flex-start;
    padding: 10px 18px 10px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-size: 17px;
    color: var(--c-text);
    cursor: pointer;
    transition: background 0.15s;
}

.nf-nav-item svg {
    width: 23px;
    height: 23px;
    flex-shrink: 0;
}

.nf-nav-item:hover,
.nf-nav-item.is-active {
    background: var(--c-surface-2);
    opacity: 1;
}

.nf-nav-item.is-active {
    font-weight: 600;
}

/* Liens de la navigation Ghost, en sous-menu indenté */
.nf-nav-sub .nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 6px 25px;
    padding: 0 0 0 12px;
    border-left: 1px solid var(--c-border);
    list-style: none;
}

.nf-nav-sub .nav li {
    margin: 0;
    padding: 0;
}

.nf-nav-sub .nav a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 16px;
    color: var(--c-text-soft);
}

.nf-nav-sub .nav a:hover,
.nf-nav-sub .nav-current a {
    background: var(--c-surface-2);
    color: var(--c-text);
    opacity: 1;
}

.nf-left-account {
    margin-top: auto;
    padding-top: 20px;
}

.nf-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--c-text);
    font-size: 15px;
    font-weight: 500;
}

.nf-account:hover {
    background: var(--c-surface-2);
    opacity: 1;
}

.nf-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c-chip);
    color: var(--c-muted);
}

.nf-avatar svg { width: 20px; height: 20px; }

/* ---------- Colonne centrale ---------- */

.nf-main {
    min-width: 0;
    min-height: 100vh;
    border-left: 1px solid var(--c-border);
    border-right: 1px solid var(--c-border);
}

.nf-main .outer { padding-left: 0; padding-right: 0; }
.nf-main .inner { max-width: none; }

.nf-feed.post-feed {
    display: block;
    padding: 0;
}

/* Carte d'article */
.nf-card.post-card {
    display: block;
    padding: 20px 22px 18px;
    border-bottom: 1px solid var(--c-border);
}

.nf-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.nf-card-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--c-chip);
    color: var(--c-muted);
}

.nf-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nf-card-avatar svg { width: 22px; height: 22px; }

.nf-card-headtext { min-width: 0; }

html.dark-mode .nf-card-title.post-card-title,
.nf-card-title {
    margin: 1px 0 2px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--c-text);
}

.nf-card-title a { color: inherit; }
.nf-card-title a:hover { color: var(--c-coral); opacity: 1; }
.nf-card-title svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -1px; }

.nf-card-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--c-muted);
}

.nf-card-tag { color: var(--c-muted); }
.nf-card-tag:hover { color: var(--c-coral); opacity: 1; }

.nf-card-featured {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--c-coral);
}

.nf-card-featured svg { width: 13px; height: 13px; }

.nf-card-excerpt {
    margin: 12px 0 0;
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--c-text-soft);
}

.nf-card-figure {
    margin: 14px 0 0;
}

.nf-card-figure a {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    background: var(--c-surface);
}

.nf-card-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.nf-card-figure a:hover .nf-card-image { transform: scale(1.015); }

.nf-card-figure figcaption {
    margin-top: 8px;
    font-size: 13px;
    text-align: center;
    color: var(--c-muted);
}

/* Aperçu du début de l'article */
.nf-card-preview.gh-content {
    margin-top: 14px;
    font-family: var(--font-sans);
    font-size: 15.5px;
    line-height: 1.6;
}

.nf-card-preview.gh-content > * { margin-top: 0; margin-bottom: 0; }
.nf-card-preview.gh-content > * + * { margin-top: 14px; }

.nf-card-preview.gh-content :is(h1, h2, h3, h4) {
    margin-top: 22px;
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--c-text);
}

.nf-card-preview.gh-content :is(p, li) { font-size: 15.5px; }
.nf-card-preview.gh-content pre { font-size: 13px; border-radius: 12px; }
.nf-card-preview.gh-content .kg-image-card img { border-radius: 12px; }

.nf-card-locked {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--c-cell);
    font-size: 14px;
    color: var(--c-pink);
}

.nf-card-locked svg { width: 15px; height: 15px; }

.nf-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--c-muted);
}

.nf-card-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nf-card-more svg { width: 15px; height: 15px; }
.nf-card-more:hover { color: var(--c-coral); opacity: 1; }

.nf-card-meta span { margin-left: 4px; }

/* En-tête des pages Tag / Auteur */
.nf-hero {
    border-bottom: 1px solid var(--c-border);
}

.nf-hero-cover {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.nf-hero-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 22px;
}

.nf-hero-badge,
.nf-hero-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--c-coral-strong);
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    object-fit: cover;
}

.nf-hero-avatar { border-radius: 50%; background: var(--c-chip); color: var(--c-muted); }
.nf-hero-avatar svg { width: 30px; height: 30px; }

.nf-hero-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--c-text);
}

.nf-hero-desc {
    margin: 6px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--c-text-soft);
}

.nf-hero-meta {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--c-muted);
}

.nf-hero .author-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.nf-hero .author-profile-social-link {
    font-size: 14px;
    color: var(--c-muted);
}

.nf-hero .author-profile-social-link svg { width: 18px; height: 18px; fill: currentColor; }
.nf-hero .author-profile-social-link:hover { color: var(--c-coral); }

/* Article / page dans la colonne centrale */
.nf-main .gh-canvas {
    grid-template-columns: [full-start wide-start main-start] minmax(0, 1fr) [main-end wide-end full-end];
    padding: 0 26px;
}

.nf-main .gh-canvas > .kg-width-full,
.nf-main .gh-canvas > .kg-width-wide {
    margin-left: -26px;
    margin-right: -26px;
}

.nf-main .article {
    padding: 28px 0 40px;
}

.post-template .nf-main .article-header {
    padding: 0 26px 28px;
}

.page-template .nf-main .article-header {
    padding: 28px 26px 24px;
}

.nf-main .article-title {
    font-family: var(--font-sans);
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.2;
}

.nf-main .article-excerpt {
    margin-top: 12px;
    font-size: 17px;
    line-height: 1.5;
}

.nf-main .article-tag { font-size: 14px; }

.nf-main .article-byline { margin-top: 22px; }

.nf-main .gh-canvas .article-image {
    margin-top: 26px;
}

.nf-main .gh-canvas .article-image img {
    border-radius: 16px;
}

.nf-main .gh-content {
    font-size: 17px;
    line-height: 1.7;
}

.nf-main .gh-content > * + * { margin-top: 20px; }

.nf-main .gh-content h2 { font-size: 24px; margin-top: 40px; }
.nf-main .gh-content h3 { font-size: 20px; margin-top: 32px; }
.nf-main .gh-content h4 { font-size: 17px; margin-top: 28px; }

.nf-main .gh-content :is(p, li) { font-size: 17px; }

.nf-main .footer-cta {
    padding: 32px 26px;
    border-top: 1px solid var(--c-border);
}

.nf-main .footer-cta-title { font-size: 22px; }

.nf-main .read-more-wrap { margin: 0; }
.nf-main .footer-cta + .read-more-wrap { margin-top: 0; }
.nf-main .read-more { display: block; border-top: 1px solid var(--c-border); }

/* ---------- Colonne droite ---------- */

.nf-right-inner {
    position: sticky;
    top: 0;
    width: 360px;
    max-height: 100vh;
    padding: 26px 26px 24px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.nf-about-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nf-about-logo {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--c-coral), var(--c-coral-strong));
}

.nf-about-logo img { width: 100%; height: 100%; object-fit: cover; }

/* Sans icône de site : on n'affiche que la première lettre du titre */
.nf-about-logo span {
    display: block;
    width: 1ch;
    overflow: hidden;
    white-space: nowrap;
    font-size: 30px;
    font-weight: 700;
    color: #fff;
}

.nf-about-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--c-text);
}

.nf-social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.nf-social a { color: var(--c-text-soft); font-size: 13px; }
.nf-social a:hover { color: var(--c-coral); opacity: 1; }
.nf-social svg { width: 17px; height: 17px; fill: currentColor; }

.nf-about-desc {
    margin: 16px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--c-text-soft);
}

/* Formulaire d'abonnement (membres Ghost) */
.nf-subscribe {
    position: relative;
    display: flex;
    margin-top: 18px;
    padding: 4px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-surface);
}

.nf-subscribe:focus-within { border-color: var(--c-coral); }

.nf-subscribe-input {
    flex: 1;
    min-width: 0;
    padding: 0 12px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 14.5px;
    color: var(--c-text);
    outline: none;
}

.nf-subscribe-input::placeholder { color: var(--c-muted); }

.nf-subscribe-btn {
    padding: 9px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--c-coral-strong);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

.nf-subscribe-btn:hover { background: var(--c-coral); }

.nf-subscribe-loading,
.nf-subscribe-msg { display: none; }

.nf-subscribe.loading .nf-subscribe-label { display: none; }
.nf-subscribe.loading .nf-subscribe-loading { display: inline; }

.nf-subscribe-msg {
    position: absolute;
    top: calc(100% + 6px);
    left: 14px;
    margin: 0;
    font-size: 13px;
}

.nf-subscribe.success .nf-subscribe-success { display: block; color: var(--c-green); }
.nf-subscribe.error .nf-subscribe-error { display: block; color: var(--c-coral); }
.nf-subscribe.success,
.nf-subscribe.error { margin-bottom: 22px; }

/* Widgets */
.nf-widget { margin-top: 32px; }

.nf-widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--c-text);
}

.nf-widget-title::after {
    content: "";
    flex: 1;
    height: 1px;
    margin-left: 8px;
    background: var(--c-border);
}

.nf-widget-title svg { width: 17px; height: 17px; }

.nf-featured {
    display: block;
    margin-bottom: 18px;
}

.nf-featured-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--c-text);
}

.nf-featured-excerpt {
    display: block;
    margin-top: 6px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--c-muted);
}

.nf-featured:hover { opacity: 1; }
.nf-featured:hover .nf-featured-title { color: var(--c-coral); }

.nf-tag {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.nf-tag:hover { opacity: 1; }
.nf-tag:hover .nf-tag-name { color: var(--c-coral); }

.nf-tag-badge {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--c-chip);
    font-weight: 700;
    color: var(--c-text);
}

.nf-tag-badge img { width: 100%; height: 100%; object-fit: cover; }

.nf-tag-name {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--c-text);
}

.nf-tag-count {
    display: block;
    font-size: 12.5px;
    color: var(--c-muted);
}

.nf-right-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
    font-size: 12.5px;
    color: var(--c-muted);
}

.nf-right-footer .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.nf-right-footer .nav li { margin: 0; padding: 0; }
.nf-right-footer p { margin: 0; }
.nf-right-footer a { color: var(--c-text-soft); }
.nf-right-footer a:hover { color: var(--c-coral); opacity: 1; }

/* ---------- Barre du haut + tiroir (mobile) ---------- */

.nf-topbar,
.nf-overlay { display: none; }

.nf-icon-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--c-text);
    cursor: pointer;
}

.nf-icon-btn:hover { background: var(--c-surface-2); }
.nf-icon-btn svg { width: 22px; height: 22px; }

/* Écran moyen : colonnes latérales plus étroites */
@media (max-width: 1240px) {
    .nf-shell.viewport { grid-template-columns: 230px minmax(0, 1fr) 300px; }
    .nf-left-inner { width: 230px; }
    .nf-right-inner { width: 300px; padding: 22px 20px; }
}

/* Tablette / mobile : une seule colonne, navigation en tiroir */
@media (max-width: 1000px) {
    .nf-shell.viewport { grid-template-columns: minmax(0, 1fr); }

    .nf-topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border-bottom: 1px solid var(--c-border);
        background: rgba(17, 17, 18, 0.92);
        backdrop-filter: blur(8px);
    }

    .nf-topbar-title {
        flex: 1;
        font-size: 16px;
        font-weight: 700;
        color: var(--c-text);
    }

    .nf-left {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: 270px;
        background: var(--c-bg-deep);
        border-right: 1px solid var(--c-border);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .nf-left-inner { width: 100%; }

    .nf-nav-open .nf-left { transform: none; }

    .nf-overlay:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: block;
        background: rgba(0, 0, 0, 0.55);
    }

    .nf-main {
        width: 100%;
        max-width: 680px;
        margin: 0 auto;
        min-height: 0;
        border: 0;
    }

    .nf-right {
        border-top: 1px solid var(--c-border);
    }

    .nf-right-inner {
        position: static;
        width: 100%;
        max-width: 680px;
        max-height: none;
        margin: 0 auto;
        padding: 28px 16px 32px;
    }
}

@media (max-width: 600px) {
    .nf-card.post-card { padding: 16px 16px 14px; }
    .nf-main .gh-canvas { padding: 0 16px; }
    .nf-main .gh-canvas > .kg-width-full,
    .nf-main .gh-canvas > .kg-width-wide { margin-left: -16px; margin-right: -16px; }
    .post-template .nf-main .article-header { padding: 0 16px 24px; }
    .page-template .nf-main .article-header { padding: 24px 16px 20px; }
    .nf-hero-body { padding: 20px 16px; }
    .nf-card-image { max-height: 380px; }
}
