/* ==========================================================================
   PAGE ARTICLE : DESIGN ÉDITORIAL & INTERACTIF
   ========================================================================== */

/* --- 1. CONFIGURATION GÉNÉRALE & LAYOUT --- */
.article-page { 
    background-color: var(--beige);
    color: var(--primary);
}

.magazine-layout {
    width: 100%;
    max-width: 1400px;
    margin: 100px auto 50px;
    padding: 0 40px;
}

/* --- 2. TITRES DE SECTIONS --- */
.section-title {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 1.1rem;
    margin: 60px 0 40px;
}

.title-latest { color: var(--accent); }
.title-previous { color: var(--primary); }

/* --- 3. GRILLE DES DERNIERS ARTICLES --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.grid-item {
    position: relative;
    aspect-ratio: 16/10;
    border-radius: 35px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.grid-item.active { border: 3px solid var(--accent); }

.grid-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.6s ease; 
}

.grid-item:hover .grid-img { transform: scale(1.05); }

.grid-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,31,63,0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 25px;
}

.grid-overlay span { 
    color: white; 
    font-weight: 700; 
    text-transform: uppercase; 
    font-size: 0.9rem; 
    letter-spacing: 1px; 
}

/* --- 4. BARRE DE RECHERCHE & SUGGESTIONS --- */
.search-divider {
    margin: 100px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-box-alt { 
    width: 100%;
    max-width: 700px; 
    background: white;
    padding: 10px 10px 10px 35px; 
    border-radius: 100px; 
    display: flex; 
    align-items: center; 
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.08); 
    border: 1px solid rgba(0,31,63,0.05);
    position: relative;
}

.search-box-alt input { 
    flex: 1; border: none; outline: none; 
    font-size: 1rem; background: transparent; 
}

.search-box-alt .btn-search { 
    background: var(--primary); 
    color: white; border: none; 
    padding: 14px 35px; border-radius: 50px; 
    font-weight: 700; text-transform: uppercase;
    font-size: 0.75rem; cursor: pointer; transition: 0.3s;
}

.search-box-alt .btn-search:hover { 
    background: var(--accent); 
    transform: scale(1.02); 
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 15px);
    left: 0; right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    border: 1px solid rgba(0,31,63,0.05);
}

.suggestion-item {
    display: flex; align-items: center; gap: 15px; padding: 12px;
    text-decoration: none; border-radius: 18px; transition: 0.3s;
}

.suggestion-item:hover { background: var(--beige); transform: translateX(5px); }

.suggestion-item img { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; }

/* --- 5. EN-TÊTE DE L'ARTICLE & INTRO --- */
.article-display { margin-top: 40px; }

.article-intro-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 70px;
    max-width: 1200px;
    margin: 0 auto 60px;
    align-items: start;
}

.article-tags-wrapper { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }

.tag-badge {
    color: var(--accent); font-weight: 700; text-transform: uppercase;
    font-size: 0.75rem; letter-spacing: 1px; background: rgba(233, 30, 99, 0.05);
    padding: 4px 12px; border-radius: 50px;
}

.article-header h1 { 
    font-size: 3.5rem; color: var(--primary); 
    line-height: 1.1; margin: 10px 0; 
}

.intro-text { 
    font-size: 1.3rem; line-height: 1.8; 
    color: #333; margin-bottom: 40px; 
}

/* --- 6. CARROUSEL INTERACTIF --- */
.photo-carousel-container { width: 100%; margin-bottom: 80px; position: relative; }

.photo-carousel-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 30px; padding: 40px 5%; cursor: grab;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}

.photo-carousel-track::-webkit-scrollbar { display: none; }

.photo-slide {
    flex: 0 0 90%; aspect-ratio: 21/9; scroll-snap-align: center;
    border-radius: 40px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.photo-slide img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.carousel-hint {
    text-align: center; font-size: 0.75rem; color: var(--accent);
    text-transform: uppercase; letter-spacing: 2px; margin-top: 20px;
    font-weight: 600; width: 100%;
}

/* --- 7. SIDEBAR (FICHE TECHNIQUE) --- */
.article-sidebar { position: sticky; top: 120px; align-self: start; }

.info-card {
    background: white; padding: 45px; border-radius: 35px;
    border: 1px solid rgba(0,31,63,0.05);
}

.info-card h4 { 
    color: var(--primary); text-transform: uppercase; letter-spacing: 2px; 
    font-size: 0.8rem; margin-bottom: 25px; 
    border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 5px; 
}

.info-list { list-style: none; padding: 0; }
.info-list li { 
    display: flex; justify-content: space-between; 
    padding: 18px 0; border-bottom: 1px solid #f8f6f2; 
    font-size: 0.95rem; 
}

.btn-reserve, .btn-locate {
    display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: white; padding: 18px; 
    border-radius: 50px; text-decoration: none; font-weight: 700; 
    text-transform: uppercase; font-size: 0.8rem; transition: 0.3s;
}

.btn-reserve { margin-top: 30px; }
.btn-locate { margin-top: 15px; gap: 12px; box-shadow: 0 10px 20px rgba(0, 31, 63, 0.15); }

.btn-reserve:hover, .btn-locate:hover { 
    background: var(--accent); transform: translateY(-3px); 
}

/* --- 8. SECTION DE LECTURE --- */
.container-reading-centered {
    max-width: 850px; margin: 0 auto 100px;
}
.content-divider { width: 100px; height: 3px; background: var(--accent); margin: 0 auto 50px; }
.full-text { font-size: 1.25rem; line-height: 2.1; color: #222; }

/* ==========================================================================
   9. RÉPONSIVE : DESIGN ÉDITORIAL & SÉCURITÉ AFFICHAGE
   ========================================================================== */

/* --- TABLETTE (1024px) --- */
@media (max-width: 1024px) {
    .magazine-layout { 
        padding: 0 35px !important; 
        margin-top: 60px !important; 
        box-sizing: border-box !important;
    }
    
    .article-intro-grid { 
        grid-template-columns: 1fr !important; 
        gap: 40px !important;
    }

    .article-header h1 { font-size: 2.6rem !important; }
}

/* --- MOBILE (768px) --- */
@media (max-width: 768px) {
    /* Sécurité globale : on empêche tout débordement horizontal */
    .magazine-layout { 
        padding: 0 15px !important; /* Marge de sécurité optimisée */
        margin-top: 40px !important; 
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Grille d'articles : empilement vertical propre */
    .articles-grid { 
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important; 
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .grid-item { 
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 25px !important; 
        aspect-ratio: 16/9 !important; 
        box-sizing: border-box !important;
        margin: 0 auto !important;
    }

    .grid-overlay span { font-size: 0.8rem !important; }

    /* Typographie adaptée pour éviter les coupures brutes */
    .section-title { 
        font-size: 0.85rem !important; 
        letter-spacing: 2px !important;
        margin: 60px 0 20px !important;
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;    /* Centre les blocs horizontalement */
        text-align: center;      /* Centre le texte à l'intérieur */
    }

    .article-header h1 { 
        font-size: 1.7rem !important; 
        line-height: 1.2 !important;
        word-wrap: break-word !important;
        padding: 0 5px !important;
        margin: 10px auto !important;
        text-align: center;
    }

    .intro-text { 
        font-size: 1rem !important; 
        padding: 0 5px !important;
        margin: 0 auto 30px !important;
        line-height: 1.6 !important;
        display: flex;
        flex-direction: column;
        align-items: center;    /* Centre les blocs horizontalement */
        text-align: center;      /* Centre le texte à l'intérieur */
    }

    .intro-main-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important; /* Aligne tout au centre horizontalement */
        text-align: center !important;  /* Centre le texte à l'intérieur */
        width: 100% !important;
    }

    /* 2. CENTRAGE DES TAGS */
    .article-tags-wrapper {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important; /* Aligne les badges au milieu */
        gap: 8px !important;
        margin-bottom: 20px !important;
        width: 100% !important;
    }

    /* Barre de recherche : recentrée avec marges internes */
    .search-box-alt {
        width: calc(100% - 10px) !important; 
        margin: 0 auto !important;
        flex-direction: column !important;
        border-radius: 20px !important;
        padding: 12px !important;
        gap: 8px !important;
        box-sizing: border-box !important;
    }

    .search-box-alt input {
        text-align: center !important;
        padding: 8px 0 !important;
    }

    .search-box-alt .btn-search {
        width: 100% !important;
        padding: 12px !important;
    }

    /* Carrousel photo : on laisse respirer les bords */
    .photo-slide { 
        flex: 0 0 85% !important; 
        margin-right: 15px !important;
        border-radius: 20px !important; 
    }

    .photo-carousel-track { padding: 20px 0 !important; }

    /* Lecture confortable */
    .full-text { 
        font-size: 1.05rem !important; 
        line-height: 1.7 !important; 
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .info-card { 
        padding: 30px 20px !important; 
        border-radius: 25px !important;
    }
}

/* --- TRÈS PETIT MOBILE (400px) --- */
@media (max-width: 400px) {
    .magazine-layout { padding: 0 10px !important; }
    
    .article-header h1 { font-size: 1.5rem !important; }
    
    .grid-item { border-radius: 20px !important; }
}