/* Page détail d'un article du blog (views/post/styles/style-1.blade.php) */

.post-breadcrumb,
.post-hero,
.post-page {
    --post-brand: var(--primary-color, #82b440);
    --post-brand-rgb: var(--primary-color-rgb, 130, 180, 64);
    --post-ink: #1c1f23;
    --post-text: #343a40;
    --post-muted: #6b7280;
    --post-line: #e7e9ec;
    --post-soft: #f6f7f9;
}

/* ---------- Fil d'Ariane (hors de la photo : lisible) ---------- */
.post-breadcrumb {
    padding: 18px 0 14px;
}

.post-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 20px;
    color: var(--post-muted);
}

.post-breadcrumb li + li::before {
    content: "›";
    color: #b5bac1;
}

.post-breadcrumb a {
    font-size: 14px;
    color: var(--post-muted);
    transition: color .2s;
}

.post-breadcrumb a:hover {
    color: var(--post-brand);
}

.post-breadcrumb [aria-current] span {
    display: -webkit-box;
    max-width: 60ch;
    overflow: hidden;
    font-size: 14px;
    color: var(--post-ink);
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* ---------- Bannière : photo, catégorie, titre, infos ---------- */
.post-hero__frame {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #1c1f23;
    isolation: isolate;
}

.post-hero__image img {
    display: block;
    width: 100%;
    height: clamp(320px, 42vw, 520px);
    object-fit: cover;
}

.post-hero__frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .35) 55%, rgba(0, 0, 0, .82) 100%);
}

.post-hero__body {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    padding: clamp(20px, 4vw, 48px);
}

/* Sans photo : bloc sombre, texte dans le flux */
.post-hero__frame:not(:has(.post-hero__image)) .post-hero__body {
    position: static;
}

.post-hero__category {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--post-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: .02em;
    text-transform: uppercase;
    transition: filter .2s;
}

.post-hero__category:hover {
    color: #fff;
    filter: brightness(1.08);
}

.post-hero__title {
    max-width: 30ch;
    margin: 0 0 16px;
    color: #fff;
    font-family: var(--heading-font, inherit);
    font-size: clamp(26px, 3.4vw, 46px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.01em;
    text-wrap: balance;
}

.post-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-hero__meta li,
.post-hero__meta time {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, .9);
    font-size: 14px;
    line-height: 20px;
}

.post-hero__meta svg {
    width: 17px;
    height: 17px;
}

/* Icônes : la règle « * { color } » du thème colorerait aussi leurs tracés */
.post-hero__meta svg,
.post-hero__meta svg * {
    color: rgba(255, 255, 255, .75);
}

/* ---------- Mise en page article + barre latérale ---------- */
.post-page {
    padding: clamp(32px, 4vw, 56px) 0 clamp(40px, 5vw, 72px);
}

.post-article {
    min-width: 0;
}

/* Chapô : résumé de l'article */
.post-article__lead {
    max-width: 760px;
    margin: 0 0 28px;
    padding-left: 18px;
    border-left: 4px solid var(--post-brand);
    color: var(--post-ink);
    font-size: 19px;
    font-weight: 500;
    line-height: 1.65;
}

/* ---------- Sommaire ---------- */
.post-toc {
    max-width: 760px;
    margin: 0 0 32px;
    padding: 20px 24px;
    border: 1px solid var(--post-line);
    border-radius: 16px;
    background: var(--post-soft);
}

.post-toc__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--post-ink);
    font-size: 16px;
    font-weight: 700;
}

.post-toc__title svg {
    width: 20px;
    height: 20px;
}

.post-toc__title svg,
.post-toc__title svg * {
    color: var(--post-brand);
}

.post-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.post-toc li {
    margin: 0;
    padding: 4px 0;
}

.post-toc li:not(.is-sub) {
    counter-increment: toc;
}

.post-toc a {
    display: flex;
    gap: 10px;
    color: var(--post-text);
    font-size: 15px;
    line-height: 1.5;
    transition: color .2s;
}

.post-toc li:not(.is-sub) > a::before {
    content: counter(toc);
    flex: 0 0 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(var(--post-brand-rgb), .15);
    color: var(--post-ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

.post-toc li.is-sub {
    padding-left: 32px;
}

.post-toc li.is-sub > a {
    color: var(--post-muted);
    font-size: 14px;
}

.post-toc a:hover {
    color: var(--post-brand);
}

/* ---------- Texte de l'article ---------- */
.post-content {
    max-width: 760px;
    color: var(--post-text);
    font-size: 17px;
    line-height: 1.8;
    overflow-wrap: break-word;
}

/* Le contenu collé hérite de la typographie de la page */
.post-content *:not(svg):not(svg *) {
    font-family: inherit;
    color: inherit;
}

.post-content p,
.post-content li,
.post-content span,
.post-content b,
.post-content strong,
.post-content em,
.post-content i,
.post-content a,
.post-content td,
.post-content th {
    font-size: inherit;
    line-height: inherit;
}

.post-content p {
    margin: 0 0 1.25em;
}

.post-content strong,
.post-content b {
    color: var(--post-ink);
    font-weight: 700;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--post-ink);
    font-family: var(--heading-font, inherit);
    font-weight: 700;
    letter-spacing: -.01em;
    scroll-margin-top: 90px;
}

.post-content h2 {
    position: relative;
    margin: 2em 0 .75em;
    padding-bottom: 12px;
    font-size: clamp(23px, 2.4vw, 29px);
    line-height: 1.3;
}

.post-content h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 3px;
    border-radius: 3px;
    background: var(--post-brand);
}

.post-content h3 {
    margin: 1.7em 0 .6em;
    font-size: clamp(19px, 2vw, 22px);
    line-height: 1.35;
}

.post-content h4 {
    margin: 1.5em 0 .5em;
    font-size: 18px;
    line-height: 1.4;
}

.post-content > :first-child,
.post-content > div:first-child > :first-child {
    margin-top: 0;
}

.post-content a {
    color: var(--post-brand);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.post-content a:hover {
    text-decoration-thickness: 2px;
}

/* Listes : puces et numéros aux couleurs du site */
.post-content ul,
.post-content ol {
    margin: 0 0 1.4em;
    padding-left: 0;
    list-style: none;
}

.post-content li {
    position: relative;
    margin: 0 0 .5em;
    padding-left: 28px;
}

.post-content li > p {
    margin: 0;
}

.post-content ul > li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: .72em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--post-brand);
}

.post-content ol {
    counter-reset: post-ol;
}

.post-content ol > li {
    counter-increment: post-ol;
}

.post-content ol > li::before {
    content: counter(post-ol);
    position: absolute;
    left: 0;
    top: .25em;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(var(--post-brand-rgb), .15);
    color: var(--post-ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

/* Citation */
.post-content blockquote {
    margin: 1.8em 0;
    padding: 18px 22px;
    border-left: 4px solid var(--post-brand);
    border-radius: 0 14px 14px 0;
    background: var(--post-soft);
    color: var(--post-ink);
    font-size: 18px;
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Images et légendes */
.post-content img {
    display: block;
    height: auto;
    margin: 1.6em auto;
    border-radius: 16px;
}

.post-content figure {
    margin: 1.6em 0;
}

.post-content figcaption {
    margin-top: 8px;
    color: var(--post-muted);
    font-size: 14px;
    text-align: center;
}

.post-content hr {
    margin: 2.2em 0;
    border: 0;
    border-top: 1px solid var(--post-line);
}

/* Tableaux : cadre arrondi qui défile sur mobile */
.post-content .post-table {
    margin: 1.6em 0 2em;
    overflow-x: auto;
    border: 1px solid var(--post-line);
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
}

.post-content figure.table {
    margin: 0;
}

.post-content table {
    width: 100%;
    min-width: 520px;
    margin: 0;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.5;
}

.post-content th,
.post-content td {
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--post-line);
    text-align: left;
    vertical-align: top;
}

.post-content thead th,
.post-content thead td {
    background: var(--post-ink);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
}

.post-content thead th *,
.post-content thead td * {
    color: #fff;
}

.post-content tbody tr:nth-child(even) {
    background: var(--post-soft);
}

.post-content tbody tr:last-child td {
    border-bottom: 0;
}

/* ---------- Bas d'article : étiquettes, partage ---------- */
.post-article__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 24px;
    max-width: 760px;
    margin: 40px 0 32px;
    padding: 22px 0;
    border-top: 1px solid var(--post-line);
    border-bottom: 1px solid var(--post-line);
}

.post-footer-label {
    color: var(--post-ink);
    font-size: 14px;
    font-weight: 700;
}

.post-tags,
.post-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.post-tags ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-tags a {
    display: inline-block;
    padding: 5px 13px;
    border: 1px solid var(--post-line);
    border-radius: 999px;
    color: var(--post-text);
    font-size: 13px;
    line-height: 20px;
    transition: border-color .2s, color .2s, background-color .2s;
}

.post-tags a:hover {
    border-color: var(--post-brand);
    background: rgba(var(--post-brand-rgb), .08);
    color: var(--post-ink);
}

.post-share p {
    display: none;
}

/* ---------- Article précédent / suivant ---------- */
.post-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 760px;
    margin: 0 0 40px;
}

.post-nav__item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--post-line);
    border-radius: 16px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.post-nav__item--next {
    grid-column: 2;
    text-align: right;
}

.post-nav__item:hover {
    border-color: rgba(var(--post-brand-rgb), .6);
    box-shadow: 0 10px 28px rgba(16, 24, 40, .08);
    transform: translateY(-2px);
}

.post-nav__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--post-brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.post-nav__item--next .post-nav__label {
    justify-content: flex-end;
}

.post-nav__label svg {
    width: 16px;
    height: 16px;
}

.post-nav__label svg,
.post-nav__label svg * {
    color: var(--post-brand);
}

.post-nav__title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--post-ink);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Commentaires alignés sur la largeur du texte */
.post-comment-wrapper {
    max-width: 760px;
}

/* ---------- Barre latérale : reste visible en lisant (ordinateur) ---------- */
@media (min-width: 992px) {
    .post-sidebar__inner {
        position: sticky;
        top: 90px;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    .post-breadcrumb {
        padding: 12px 0 10px;
    }

    .post-hero .container {
        padding-left: 0;
        padding-right: 0;
    }

    .post-hero__frame {
        border-radius: 0;
    }

    .post-hero__image img {
        height: 300px;
    }

    .post-article__lead {
        font-size: 17px;
    }

    .post-content {
        font-size: 16px;
        line-height: 1.75;
    }

    .post-toc {
        padding: 16px 18px;
    }

    .post-nav {
        grid-template-columns: 1fr;
    }

    .post-nav__item--next {
        grid-column: auto;
    }
}
