/* =============================================================================
HEADER
============================================================================= */

header {
    padding: 2.5rem 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5rem;
}

/* Intro */
.header--content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: var(--width-narrow);
    gap: 1.25rem;
    margin-top: 10rem;
}

/* Article à la une */
.featured-article {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background-color: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: 1.5rem;
    gap: 0;
    width: var(--width-content);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .3s ease, transform .3s ease;
}

.featured-article:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Corps texte */
.featured-article-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    padding: 3rem;
    flex: 1 0 0;
}

.featured-article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.featured-article-date {
    color: var(--color-text-disabled);
}

.featured-article-body h2 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-text-default);
    line-height: var(--leading-tight);
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-article-body>p {
    color: var(--color-text-secondary);
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    display: -webkit-box;
    line-clamp: 4;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Image */
.featured-article-visual {
    max-width: 50%;
    overflow: hidden;
}

.featured-article-visual img {
    width: 100%;
    height: 100%;
    min-height: 36rem;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.featured-article:hover .featured-article-visual img {
    transform: scale(1.03);
}


/* =============================================================================
MAIN — GRILLE D'ARTICLES
============================================================================= */

main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.blog-section {
    width: var(--width-content);
    margin: 5rem auto 7rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
}

.blog-section-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--color-text-default);
}

/* Grille */
.article-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

/* Carte article */
.article-card {
    display: flex;
    flex-direction: column;
    border-radius: 1.5rem;
    background-color: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    overflow: hidden;
    flex: 1 1 calc(33.333% - 1.5rem);
    max-width: calc(33.333% - 1.5rem);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .3s ease, transform .3s ease;
}

.article-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

/* Image */
.article-card-visual {
    width: 100%;
    height: 20rem;
    overflow: hidden;
    flex-shrink: 0;
}

.article-card-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.article-card:hover .article-card-visual img {
    transform: scale(1.03);
}

/* Corps */
.article-card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.article-card-meta .caption {
    color: var(--color-text-disabled);
}

.article-card-body h3 {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-text-default);
    line-height: var(--leading-normal);
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-excerpt {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* =============================================================================
RESPONSIVE
============================================================================= */

@media (max-width: 900px) {
    .header--content {
        width: 100%;
        margin-top: 8rem;
        padding: 0 2rem;
        box-sizing: border-box;
    }

    .featured-article {
        flex-direction: column-reverse;
        width: calc(100% - 4rem);
    }

    .featured-article-visual {
        max-width: 100%;
    }

    .featured-article-visual img {
        min-height: 26rem;
    }

    .featured-article-body {
        padding: 2rem;
    }

    .featured-article-body>p {
        line-clamp: 3;
        -webkit-line-clamp: 3;
    }

    .blog-section {
        width: 100%;
        box-sizing: border-box;
    }

    .article-card {
        flex: 1 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }
}

@media (max-width: 600px) {
    .featured-article {
        width: 100%;
    }

    .article-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}