/*
  Blog : liste des articles, archives de catégorie, article.

  Mobile d'abord. blog.tablet.css (≥ 640 px) et blog.desktop.css (≥ 900 px)
  ajoutent ce que la place permet. Même vocabulaire que les pages de service :
  titres en serif, filets fins, laiton pour les accents, aucune ombre lourde.
*/

/* --- En-tête de la liste ------------------------------------------------- */

.blog-hero {
    padding-block: var(--sp-7) var(--sp-7);
}

.blog-hero .container {
    padding-block: 16px 0;
}

.blog-hero h1,
.blog-hero .h1 {
    max-width: 20ch;
    margin-bottom: var(--sp-4);
}

.blog-intro {
    font-size: 1.1rem;
    color: var(--text-soft);
    max-width: 58ch;
}

.blog-cats ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-5);
}

.blog-cats a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--c-anthracite);
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color 0.18s var(--ease-editorial), color 0.18s var(--ease-editorial);
}

.blog-cats a:hover {
    border-color: var(--c-anthracite);
}

.blog-cats a[aria-current="page"] {
    background: var(--c-green-deep);
    border-color: var(--c-green-deep);
    color: #fff;
}

/* --- Grille et cartes d'article ----------------------------------------- */

.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-6);
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition:
        box-shadow 0.25s var(--ease-editorial),
        transform 0.25s var(--ease-editorial),
        border-color 0.25s;
}

.post-card:hover,
.post-card:focus-within {
    box-shadow: var(--shadow-soft);
    border-color: #d7ddd8;
    transform: translateY(-3px);
}

.post-card-media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-editorial);
}

.post-card:hover .post-card-media img {
    transform: scale(1.03);
}

.post-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-5);
    flex: 1;
}

.post-card-body p {
    margin: 0;
}

.post-card-cat {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-eyebrow);
}

.post-card .h2,
.post-card .h3 {
    position: relative;
    padding-bottom: 10px;
}

/* Même filet laiton que les cartes de service. */
.post-card .h2::after,
.post-card .h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 32px;
    background: var(--c-brass);
    transition: width 0.3s var(--ease-editorial);
}

.post-card:hover .h2::after,
.post-card:hover .h3::after {
    width: 64px;
}

.post-card-link {
    color: inherit;
    text-decoration: none;
}

/* Toute la carte est cliquable, mais un seul lien est annoncé. */
.post-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.post-card-link:focus-visible {
    outline: none;
}

.post-card:has(.post-card-link:focus-visible) {
    outline: 2.5px solid var(--c-green-leaf);
    outline-offset: 3px;
}

.post-card-excerpt {
    color: var(--text-soft);
    font-size: 0.96rem;
    flex: 1;
}

.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: var(--sp-3);
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--text-soft);
}

/* --- Article : en-tête ---------------------------------------------------- */

.article-hero {
    padding-block: var(--sp-7) 0;
}

.article-hero .container {
    padding-block: 16px 0;
}

.article-hero .eyebrow a {
    color: inherit;
    text-decoration: none;
}

.article-hero .eyebrow a:hover {
    text-decoration: underline;
}

.article-title {
    max-width: 22ch;
    margin-bottom: var(--sp-5);
}

.article-lede {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--c-anthracite);
    max-width: 60ch;
    margin-bottom: var(--sp-5);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    font-size: 0.88rem;
    color: var(--text-soft);
    max-width: none;
    margin: 0;
    padding-top: var(--sp-4);
    border-top: 1px solid var(--line);
}

.article-meta span:not(:last-child)::after {
    content: "·";
    margin-inline: 10px;
    color: var(--c-brass);
}

.article-media {
    margin: var(--sp-6) 0 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    aspect-ratio: 16 / 9;
}

.article-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Article : corps et sommaire ----------------------------------------- */

.article-body {
    padding-block: var(--sp-7) var(--sp-9);
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-6);
}

.article-toc {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-alt);
    padding: var(--sp-4) var(--sp-5);
}

.article-toc summary {
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-eyebrow);
    min-height: 32px;
    display: flex;
    align-items: center;
}

.article-toc ol {
    list-style: none;
    counter-reset: toc;
    display: grid;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
}

.article-toc li {
    counter-increment: toc;
    display: flex;
    gap: 10px;
    font-size: 0.92rem;
    line-height: 1.4;
}

.article-toc li::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--font-serif);
    color: var(--c-brass-dark, var(--c-brass));
    flex: none;
}

.article-toc a {
    color: var(--text);
    text-decoration: none;
}

.article-toc a:hover {
    color: var(--c-green-deep);
    text-decoration: underline;
}

.article-content {
    font-size: 1.06rem;
    max-width: 68ch;
}

.article-content > p:first-child {
    font-size: 1.12rem;
}

/* Intertitres d'article : un cran sous les titres de section du site, le
   texte reste le sujet. */
.article-content h2 {
    font-size: clamp(1.6rem, 1.6vw + 1rem, 2.1rem);
    scroll-margin-top: calc(var(--header-h) + var(--sp-4));
    padding-top: var(--sp-5);
    border-top: 1px solid var(--line);
}

.article-content h3 {
    margin-top: var(--sp-6);
}

.article-content ul li::marker {
    color: var(--c-brass);
}

/* --- Appel à l'action ------------------------------------------------------ */

.blog-cta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-7);
    align-items: center;
}

.blog-cta-text h2,
.blog-cta-text .h2 {
    margin-bottom: var(--sp-4);
}

.blog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-5);
}

.blog-cta-services {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-5);
}

.blog-related .post-grid {
    margin-top: 0;
}
