/* Blog Page Styles - Thème DictoQuest */
.blog-hero {
    background: linear-gradient(160deg, #f0ddb8 0%, #e8d4a8 40%, #dcc89a 100%);
    padding: 8rem 2rem 4rem;
    text-align: center;
    margin-top: var(--nav-height);
    position: relative;
}

.blog-hero .section-eyebrow {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--gold-dark);
    margin-bottom: 0.75rem;
}

.blog-hero .section-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(1.9rem, 3.5vw, 2.8rem);
    font-weight: 700;
    color: var(--royal-blue);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.blog-hero .section-subtitle {
    font-size: 1.1rem;
    color: var(--ink-sepia);
    max-width: 640px;
    margin: 0 auto;
}

.blog-section {
    padding: 4rem 2rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.blog-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--parchment-dark);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow-soft);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px var(--shadow-soft);
    border-color: var(--gold-base);
}

.blog-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.blog-link:hover {
    text-decoration: none;
}

.blog-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--light-gray);
    position: relative;
}

.blog-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--light-gray);
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.blog-content {
    padding: 1.5rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.blog-date {
    color: var(--text-light);
}

.blog-category {
    color: var(--crimson);
    font-weight: 600;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.blog-content p {
    color: var(--ink-sepia);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-family: 'Literata', Georgia, serif;
}

.blog-excerpt {
    font-family: 'Literata', Georgia, serif;
    font-style: normal; /* pas d'italique sur un passage long : il se lit moins bien */
    color: var(--ink-sepia);
    line-height: 1.6;
    font-size: 1rem;
    padding: 0.75rem 1.5rem 0;
    margin: 0;
}

.read-more {
    display: inline-block;
    color: var(--crimson);
    font-weight: 600;
    transition: color 0.3s ease;
    font-family: 'Cinzel', serif;
    padding: 0.5rem 1.5rem 1.25rem;
    text-decoration: none;
}

.read-more:hover {
    color: var(--crimson-dark);
    text-decoration: none;
}

.blog-link:hover .read-more {
    color: var(--crimson-dark);
}

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

.pagination-btn {
    padding: 0.75rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
}








/* Responsive Design */
@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .blog-hero h1 {
        font-size: 2.5rem;
    }
    
    .blog-content {
        padding: 1rem;
    }
    
    .blog-content h2 {
        font-size: 1.2rem;
    }

} 

/* Styles pour le blog dynamique */

/* Filtres et recherche */
.blog-filters {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #8a6d3b; /* était #e1e5e9, 1,0:1 contre le fond */
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus-visible {
    outline: 3px solid var(--crimson, #8b1538);
    outline-offset: 2px;
}

.search-input:focus {
    border-color: var(--crimson);
    box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.12);
}

.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-filter {
    padding: 8px 16px;
    background: rgba(255, 251, 239, 0.88);
    border: 2px solid rgba(139, 21, 56, 0.28);
    border-radius: 20px;
    text-decoration: none;
    color: var(--crimson);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-filter:hover {
    background: rgba(139, 21, 56, 0.08);
    border-color: rgba(139, 21, 56, 0.5);
}

.category-filter.active {
    background: var(--crimson);
    border-color: var(--crimson);
    color: var(--parchment-light);
    box-shadow: 0 6px 14px rgba(139, 21, 56, 0.2);
}

/* Message d'absence d'articles */
.no-articles {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-articles h3 {
    margin-bottom: 1rem;
    color: #495057;
}

/* Pagination améliorée */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.pagination-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Interface de création d'articles */
.article-creator-ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.article-creator-panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.article-creator-panel h3 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.btn-create {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-create:hover {
    background: #0056b3;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-hero {
        padding: 6rem 1rem 3rem;
        margin-top: 70px;
    }
    
    .blog-hero h1 {
        font-size: 2.5rem;
    }
    
    .blog-filters {
        flex-direction: column;
    }
    
    .blog-categories {
        justify-content: center;
    }
    
    .category-filter {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .article-creator-panel {
        width: 95%;
        padding: 1.5rem;
    }
    
    .article-header {
        margin-top: 70px;
        padding: 2rem 0;
    }
    
    .article-header .container {
        padding: 0 1rem;
    }
}

/* Animation de chargement */
.blog-grid {
    min-height: 200px;
}

.blog-grid.loading {
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Amélioration du logo dans la navigation */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

/* Amélioration des cartes d'articles */
.blog-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.blog-card .blog-image {
    overflow: hidden;
}

.blog-card .blog-image img {
    transition: transform 0.3s ease;
}

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

/* Styles pour les articles individuels */
.article-container {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    background: #667eea; /* Couleur de fallback */
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    margin-top: 80px; /* Espace pour la navigation fixe */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
    min-height: 300px;
    /* Ni hauteur maximale ni overflow: hidden : à 320 px ou texte espacé (RGAA 10.11,
       10.12), le titre et la date sortaient du cadre, coupés. */
    display: flex;
    align-items: center;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.article-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: bold;
}

.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.8);
    z-index: 1; /* Au-dessus de l'image d'arrière-plan */
}

.article-header .container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 14px;
}

.article-meta span {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.article-excerpt {
    font-size: 18px;
    line-height: 1.6;
    color: white;
    margin-top: 1rem;
    font-weight: 500;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.content-wrapper {
    line-height: 1.8;
    font-size: 16px;
}

.content-wrapper h2 {
    color: #333;
    margin: 2rem 0 1rem 0;
    font-size: 28px;
}

.content-wrapper h3 {
    color: #495057;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 22px;
}

.content-wrapper p {
    margin-bottom: 1rem;
}

.content-wrapper ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.content-wrapper li {
    margin-bottom: 0.5rem;
}

/* Articles connexes */
.related-articles {
    background: #f8f9fa;
    padding: 3rem 0;
    margin-top: 3rem;
}

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

.related-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.related-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.related-placeholder {
    width: 100%;
    height: 100%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-content {
    padding: 1.5rem;
}

.related-content h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.related-content p {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
} 

/* Focus des cartes du blog (RGAA 10.7) : l'anneau natif était rogné par
   .blog-card { overflow: hidden } — on le dessine à l'intérieur. */
.blog-link:focus-visible {
    outline: 3px solid var(--crimson, #8b1538);
    outline-offset: -4px;
}

/* Sous 900 px, le menu du site n'est plus fixe : il occupe déjà sa hauteur dans la page.
   La marge qui le compensait laissait une bande vide de 124 à 136 px sous l'en-tête. */
@media (max-width: 900px) {
    .blog-hero,
    .article-header { margin-top: 0; }
}
