/**
 * Styles pour la page Blog - Champagne Champion
 */

/* Container principal du blog */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
}

.blog-container h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--brown);
    position: relative;
}

.blog-container h1::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background-color: var(--beige);
}

/* Grille d'articles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

/* Carte d'article */
.blog-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.blog-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

/* Masquer tout texte superposé sur l'image */
.blog-image::before,
.blog-image::after,
.blog-image *::before,
.blog-image *::after {
    content: none !important;
    display: none !important;
}

/* Supprimer tout élément de texte superposé */
.blog-image h1, .blog-image h2, .blog-image h3, .blog-image h4, .blog-image h5, .blog-image h6,
.blog-image p, .blog-image span:not(.blog-date), .blog-image div:not(.blog-image) {
    display: none !important;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* Centre l'image intelligemment */
    transition: transform 0.5s ease;
    /* Supprimer toute légende ou texte superposé */
    position: relative;
    z-index: 2;
    max-width: 100%; /* Assure que l'image ne dépasse pas son conteneur */
}

/* Supprimer les légendes d'images */
.blog-image figcaption,
.blog-image::after,
.blog-card::before,
.blog-image::before {
    display: none !important;
}

/* Masquer tout texte ou légende qui pourrait être généré automatiquement */
.blog-card img::before,
.blog-card img::after {
    content: none !important;
    display: none !important;
}

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-date {
    position: absolute;
    bottom: 0;
    right: 0;
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 400;
    z-index: 5;
    padding: 3px 8px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 0;
    letter-spacing: 0.5px;
    font-family: 'Montserrat', sans-serif;
}

/* La catégorie est maintenant affichée différemment */
.blog-category {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--beige);
    font-size: 0.85rem;
    font-weight: 500;
}

.blog-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--brown);
    line-height: 1.3;
}

.blog-content p {
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.blog-content .btn {
    align-self: flex-start;
    background-color: var(--beige);
    color: var(--white);
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    display: inline-block;
    margin-top: auto;
}

.blog-content .btn:hover {
    background-color: var(--brown);
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    gap: 0.5rem;
}

.blog-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.blog-pagination a:hover,
.blog-pagination a.active {
    background-color: var(--beige);
    color: var(--white);
}

/* Page d'article individuel */
.article-header {
    position: relative;
    height: 70vh;
    min-height: 500px;
    margin-bottom: 0;
    display: flex;
    align-items: flex-end;
}

.article-header-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.article-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%; /* Privilégie la partie supérieure de l'image */
    max-height: 70vh; /* Limite la hauteur maximale */
    will-change: transform; /* Optimise le rendu */
}

.article-header-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.7));
    z-index: 2;
}

.article-header-content {
    position: relative;
    z-index: 3;
    padding: 3rem 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.article-category,
.article-date {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.article-category {
    position: relative;
    padding-right: 1.5rem;
}

.article-category::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 1px;
    height: 15px;
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%);
}

.article-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: var(--white);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
    max-width: 800px;
}

.article-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
    background-color: var(--white);
    position: relative;
    z-index: 2;
    margin-top: -3rem;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}

.article-intro {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--brown);
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--beige);
    position: relative;
}

.article-intro::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 20px;
    background-color: var(--white);
    background-image: url('/assets/images/divider.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.first-letter {
    float: left;
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    line-height: 0.8;
    padding-top: 0.1em;
    padding-right: 0.1em;
    color: var(--beige);
}

.article-content {
    max-width: 100%;
    margin: 0 auto;
}

.article-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
}

.article-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--brown);
    margin: 3rem 0 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.article-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: var(--beige);
}

.article-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--brown);
    margin: 2.5rem 0 1rem;
}

.article-image {
    margin: 2.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-height: 500px; /* Limite la hauteur maximale */
}

.article-image img {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: cover; /* Rogne intelligemment l'image */
    object-position: center center; /* Centre l'image */
    display: block;
}

.article-image figcaption {
    padding: 1rem;
    text-align: center;
    font-style: italic;
    font-size: 0.9rem;
    color: #666;
    background-color: #f9f9f9;
}

.article-content blockquote {
    margin: 3rem 0;
    padding: 2rem;
    background-color: var(--cream);
    border-left: 3px solid var(--beige);
    font-style: italic;
    position: relative;
}

.article-content blockquote::before {
    content: '\201C';
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    position: absolute;
    top: -1rem;
    left: 1rem;
    color: rgba(202, 174, 147, 0.2);
}

.article-content blockquote p {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--brown);
}

.article-content blockquote cite {
    display: block;
    font-style: normal;
    font-weight: 500;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--beige);
}

.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.article-tags span {
    font-weight: 500;
    color: var(--brown);
}

.article-tags a {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: var(--cream);
    color: var(--brown);
    border-radius: 30px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-tags a:hover {
    background-color: var(--beige);
    color: var(--white);
}

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

.article-share span {
    font-weight: 500;
    color: var(--brown);
}

.article-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--cream);
    color: var(--brown);
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-share a:hover {
    background-color: var(--beige);
    color: var(--white);
}

.related-articles {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid #eee;
}

.related-articles h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--brown);
    position: relative;
}

.related-articles h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background-color: var(--beige);
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.related-article {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.related-article img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.related-article h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    padding: 1rem 1rem 0.5rem;
    color: var(--brown);
}

.btn-small {
    display: inline-block;
    margin: 0 1rem 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--beige);
    color: var(--white);
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.btn-small:hover {
    background-color: var(--brown);
}

/* Responsive pour la page d'article */
@media (max-width: 992px) {
    .article-header h1 {
        font-size: 2.8rem;
    }
    
    .article-container {
        padding: 3rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .article-header {
        height: 50vh;
        min-height: 400px;
    }
    
    .article-header h1 {
        font-size: 2.2rem;
    }
    
    .article-intro {
        font-size: 1.1rem;
    }
    
    .first-letter {
        font-size: 4rem;
    }
    
    .article-footer {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .article-header {
        height: 40vh;
        min-height: 300px;
    }
    
    .article-header-content {
        padding: 2rem 1rem;
    }
    
    .article-header h1 {
        font-size: 1.8rem;
    }
    
    .article-container {
        padding: 2rem 1rem;
        margin-top: -2rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content blockquote {
        padding: 1.5rem;
    }
    
    .article-content blockquote p {
        font-size: 1rem;
    }
    
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .article-header {
        height: 400px;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .blog-container h1 {
        font-size: 2rem;
    }
    
    .article-header {
        height: 350px;
    }
    
    .article-header h1 {
        font-size: 1.8rem;
    }
}
