/* ==========================================================================
   0. RESET & CORRECTIONS GLOBALES (CRÉCIAL POUR ÉVITER LES DÉCALAGES)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box; /* Empêche les paddings de casser les pourcentages */
}

img {
    max-width: 100%;
    display: block; /* Supprime les espaces fantômes sous les images */
}

/* ==========================================================================
   1. VARIABLES SPÉCIFIQUES AU BLOG
   ========================================================================== */
:root {
    --blog-c-orange: #FAA940; 
    --blog-c-rose: #FF006B; 
    --blog-c-rouge: #da0a0e; 
    --blog-c-mauve: #d00bf4;
    --blog-c-vert: #54ef54;
    
    --blog-bg: #0f1117; 
    --blog-txt: #f3f4f6;

    --blog-glass: rgba(10, 10, 14, 0.4);
    --blog-border: rgba(255, 255, 255, 0.14);
    --blog-blur: blur(16px);
    --blog-shadow: 0 30px 90px rgba(0, 0, 0, 0.60);

    --blog-grad: linear-gradient(90deg, var(--blog-c-rose), var(--blog-c-orange));
}

body.go-dashboard {
    font-family: 'Outfit', sans-serif;
    background: var(--blog-bg);
    color: var(--blog-txt);
    min-height: 100vh;
    overflow-x: hidden; /* Coupe tout débordement horizontal */
    position: relative;
    margin: 0;
    padding: 0;
}

/* Halos animés en arrière-plan */
.go-dashboard::before {
    content: ""; position: fixed; inset: -30%;
    background:
        radial-gradient(900px 520px at 20% 20%, rgba(255,0,107,.15), transparent 60%),
        radial-gradient(900px 520px at 85% 25%, rgba(208,11,244,.12), transparent 62%),
        radial-gradient(900px 520px at 55% 85%, rgba(250,169,64,.15), transparent 62%);
    filter: blur(16px); z-index: -1; 
    animation: floatBG 10s ease-in-out infinite alternate;
}

@keyframes floatBG {
    0% { transform: translate3d(-1.2%, -1.2%, 0) scale(1.02); }
    100% { transform: translate3d(1.2%, 1.2%, 0) scale(1.06); }
}

/* Utilitaires texte du blog */
.text-rose { color: var(--blog-c-rose); }
.text-orange { color: var(--blog-c-orange); }
.text-mauve { color: var(--blog-c-mauve); }
.text-vert { color: var(--blog-c-vert); }
.text-white { color: #fff; }

/* Bouton principal */
.go-btn {
    display: inline-flex; align-items: center; justify-content: center; 
    padding: 14px 24px; border-radius: 14px; 
    font-weight: 900; text-transform: uppercase; font-size: 13px; 
    text-decoration: none; border: 1px solid transparent; 
    transition: all .2s ease;
}
.go-btn--primary { background: var(--blog-grad); color: #000; box-shadow: 0 10px 30px rgba(255,0,107,.3); }
.go-btn--primary:hover { transform: translateY(-2px); filter: brightness(1.1); }

/* ==========================================================================
   2. HEADER MINIMALISTE & COLLANT
   ========================================================================== */
.blog-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 50px; position: sticky; top: 0; z-index: 999;
    background: rgba(15, 17, 23, 0.75); 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06); transition: all 0.3s ease;
}

.nav-brand { font-size: 1.3rem; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; text-align: center; }
.nav-link { color: var(--blog-txt); text-decoration: none; font-size: 0.85rem; font-weight: 600; letter-spacing: 1px; margin: 0 15px; opacity: 0.7; transition: all 0.3s ease; }
.nav-link:hover { opacity: 1; color: var(--blog-c-orange); }

.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-social-link { color: var(--blog-txt); opacity: 0.6; display: inline-flex; transition: all 0.3s ease; text-decoration: none; }
.nav-social-link:hover { opacity: 1; color: var(--blog-c-rose); transform: translateY(-2px); }

/* ==========================================================================
   3. LAYOUT PRINCIPAL & DOUBLE EXPOSITION
   ========================================================================== */
.blog-layout {
    position: relative; max-width: 1400px; margin: 0 auto; padding: 40px 20px; 
    min-height: calc(100vh - 100px); display: flex; align-items: center;
}

.background-title {
    position: absolute; top: 5%; left: 45%; transform: translateX(-50%);
    font-family: 'Great Vibes', cursive; font-size: 12vw; line-height: 0.8;
    color: rgba(255, 255, 255, 0.03); white-space: nowrap; pointer-events: none; z-index: 0;
}

.content-grid {
    display: grid; 
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) 80px; /* Sécurise la largeur des colonnes */
    gap: 40px; align-items: center; width: 100%; z-index: 2;
}

.image-zone { position: relative; display: flex; justify-content: center; width: 100%; }

.double-exposure-wrapper {
    width: 100%; max-width: 550px; 
    aspect-ratio: 1 / 1; /* Remplace le height fixe pour garder des proportions parfaites */
    height: auto;
    mask-image: radial-gradient(circle at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 70%);
    mix-blend-mode: lighten;
}

.blended-img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(20%) contrast(120%); }

.glass-panel {
    background: var(--blog-glass); backdrop-filter: var(--blog-blur); -webkit-backdrop-filter: var(--blog-blur);
    border: 1px solid var(--blog-border); box-shadow: var(--blog-shadow); padding: 50px; border-radius: 24px; position: relative;
    width: 100%; /* S'assure de ne pas dépasser de sa colonne */
}

.subtitle { font-size: 0.9rem; letter-spacing: 3px; color: var(--blog-c-orange); font-weight: 600; margin-bottom: 10px; display: block; }
.main-heading { font-size: 3.5rem; font-weight: 300; line-height: 1.1; margin-bottom: 25px; letter-spacing: 2px; }
.description { font-size: 1.1rem; line-height: 1.8; opacity: 0.8; margin-bottom: 40px; }

.stats-row { display: flex; align-items: center; gap: 30px; border-top: 1px solid var(--blog-border); padding-top: 30px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-val { font-size: 1.8rem; font-weight: 900; }
.stat-label { font-size: 0.7rem; letter-spacing: 1px; opacity: 0.5; }
.stats-row .go-btn { margin-left: auto; }

/* ==========================================================================
   4. TIMELINE VERTICALE
   ========================================================================== */
.vertical-timeline { position: relative; display: flex; flex-direction: column; align-items: center; gap: 60px; height: 100%; justify-content: center; }
.timeline-line {
    position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); width: 1px;
    background: repeating-linear-gradient(to bottom, var(--blog-border) 0, var(--blog-border) 10px, transparent 10px, transparent 20px); z-index: 0;
}
.timeline-item { position: relative; z-index: 1; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.timeline-item .icon {
    width: 45px; height: 45px; border-radius: 50%; background: var(--blog-bg); border: 1px solid var(--blog-border);
    display: grid; place-items: center; font-size: 1.2rem; transition: all 0.3s ease;
}
.timeline-item.active .icon { border-color: var(--blog-c-rose); box-shadow: 0 0 20px rgba(255,0,107,0.4); transform: scale(1.2); }
.tooltip {
    position: absolute; right: 60px; background: rgba(0,0,0,0.8); padding: 5px 12px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 600; opacity: 0; pointer-events: none; transform: translateX(10px); transition: all 0.3s ease; white-space: nowrap; border: 1px solid var(--blog-border);
}
.timeline-item:hover .tooltip, .timeline-item.active .tooltip { opacity: 1; transform: translateX(0); }

/* ==========================================================================
   5. SECTION HISTOIRE PERSONNELLE
   ========================================================================== */
.personal-history-section { padding: 100px 20px; position: relative; z-index: 2; }
.history-container {
    max-width: 1200px; margin: 0 auto; display: grid; 
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* Minmax(0) empêche le débordement de l'image */
    gap: 80px; align-items: flex-start; /* Aligné en haut pour éviter que l'image ne s'étire bizarrement */
}

.history-intro { font-size: 1.1rem; line-height: 1.8; color: rgba(255, 255, 255, 0.8); margin-bottom: 40px; }

.history-tabs-nav { display: flex; gap: 20px; border-bottom: 1px solid var(--blog-border); margin-bottom: 30px; padding-bottom: 15px; flex-wrap: wrap; }
.tab-btn { background: transparent; border: none; color: var(--blog-txt); font-family: inherit; font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: 0.4; cursor: pointer; transition: all 0.3s ease; position: relative; }
.tab-btn:hover { opacity: 0.8; }
.tab-btn.active { opacity: 1; color: var(--blog-c-orange); }
.tab-btn::after { content: ''; position: absolute; bottom: -16px; left: 0; width: 0%; height: 3px; background: var(--blog-grad); transition: width 0.3s ease; border-radius: 3px; }
.tab-btn.active::after { width: 100%; box-shadow: 0 0 10px rgba(250, 169, 64, 0.6); }

.history-tabs-content em, .search-excerpt em, .featured-excerpt em { color: #ffffffcd; font-style: italic; }
.tab-pane { display: none; animation: fadeInTab 0.5s ease forwards; }
.tab-pane.active { display: block; }
.tab-title { font-size: 1.5rem; font-weight: 900; margin-bottom: 15px; text-transform: uppercase; }

/* Image Histoire (Correction du bug de dimension) */
.history-visual { display: flex; justify-content: center; align-items: flex-start; width: 100%; position: sticky; top: 100px; }
.gradient-border-wrapper {
    width: 100%; max-width: 500px; 
    aspect-ratio: 4 / 5; /* Ratio portrait fixe au lieu de height: 600px qui débordait */
    height: auto; position: relative; padding: 6px; border-radius: 20px; overflow: hidden; z-index: 1; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}
.gradient-border-wrapper::before, .gradient-border-wrapper::after { content: ''; position: absolute; inset: 0; background-size: 300% 300%; animation: moveGradient 6s ease infinite alternate; }
.gradient-border-wrapper::before { background-image: linear-gradient(135deg, #FAA940, #FF006B, #da0a0e, #d00bf4, #fef00e); z-index: -1; transition: opacity 0.5s ease; }
.gradient-border-wrapper::after { background-image: linear-gradient(135deg, #f89310, #dc0b63, #971012, #9f07bb, #d6cc25); z-index: -2; }
.gradient-border-wrapper:hover::before { opacity: 0; }
.history-img-container { width: 100%; height: 100%; border-radius: 14px; overflow: hidden; background: var(--blog-bg); }
.history-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.gradient-border-wrapper:hover .history-img { transform: scale(1.05); }

/* Typographie Histoire */
.history-tabs-content p, .search-excerpt p, .featured-excerpt p { margin-bottom: 25px; line-height: 1.9; color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; }
.history-tabs-content strong, .search-excerpt strong, .featured-excerpt strong { color: #ffffff; font-weight: 800; }
.history-tabs-content em, .search-excerpt em, .featured-excerpt em { color: var(--blog-c-rose); font-style: italic; }
.history-tabs-content ul, .search-excerpt ul, .featured-excerpt ul { margin-bottom: 24px; padding-left: 20px; list-style: none; }
.history-tabs-content ul li, .search-excerpt ul li, .featured-excerpt ul li { margin-bottom: 12px; position: relative; padding-left: 15px; color: rgba(255, 255, 255, 0.9); line-height: 1.8; }
.history-tabs-content ul li::before, .search-excerpt ul li::before, .featured-excerpt ul li::before { content: "•"; color: var(--blog-c-orange); font-size: 1.5rem; position: absolute; left: -5px; top: -6px; }
blockquote.history-quote { border-left: 4px solid #0cf60c; background: rgba(12, 246, 12, 0.05); padding: 20px 25px; margin: 35px 0; border-radius: 0 12px 12px 0; }
blockquote.history-quote p { font-size: 1.15rem; font-style: italic; color: #ffffff; margin-bottom: 15px; }
blockquote.history-quote footer { font-weight: 800; color: #0cf60c; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; }
.history-hidden-content { display: none; animation: fadeInTab 0.5s ease forwards; }
.history-hidden-content.is-expanded { display: block; }

.btn-read-more {
    background: transparent; border: 1px solid var(--blog-border); color: var(--blog-txt); padding: 10px 24px; border-radius: 50px; cursor: pointer; transition: all 0.3s ease; margin-top: 10px; font-size: 0.85rem; font-family: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; display: inline-flex; align-items: center; gap: 8px;
}
.btn-read-more:hover { border-color: var(--blog-c-orange); color: var(--blog-c-orange); background: rgba(250, 169, 64, 0.1); }
@keyframes fadeInTab { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   6. SECTION ROADMAP (ALIGNEMENT PARFAIT)
   ========================================================================== */
.roadmap-section { padding: 100px 20px; position: relative; z-index: 2; overflow: hidden; }
.roadmap-header { text-align: center; margin-bottom: 80px; }

.roadmap-timeline { max-width: 1100px; margin: 0 auto; position: relative; padding: 40px 0; }

.roadmap-line {
    position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
    background: repeating-linear-gradient(to bottom, var(--blog-c-orange) 0, var(--blog-c-orange) 10px, transparent 10px, transparent 20px);
    transform: translateX(-50%); opacity: 0.3; z-index: 0;
}

.roadmap-item {
    display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 120px; position: relative; z-index: 1;
}
.roadmap-item:nth-child(even) { flex-direction: row-reverse; }

.roadmap-dot {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); /* Centrage absolu sur la ligne */
    width: 16px; height: 16px; border-radius: 50%; background: var(--blog-bg);
    border: 3px solid var(--blog-c-orange); box-shadow: 0 0 15px var(--blog-c-orange); z-index: 5;
}

/* Texte (45%) | Espace (10%) | Image (45%) */
.roadmap-text { width: 45%; padding: 40px; display: flex; flex-direction: column; }
.step-num { font-size: 0.8rem; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; display: block; margin-bottom: 10px; }
.roadmap-text h3 { font-size: 1.8rem; font-weight: 800; margin-bottom: 15px; line-height: 1.2; }
.roadmap-text p { font-size: 1.05rem; opacity: 0.8; line-height: 1.6; margin-bottom: 25px; }
.roadmap-text .roadmap-btn { margin-top: auto; width: 100%; color: #ffffff !important; text-align: center; }

.roadmap-visual { width: 45%; position: relative; height: 350px; display: flex; justify-content: center; align-items: center; }
.diamond {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); -webkit-clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    object-fit: cover; position: absolute; transition: transform 0.4s ease, filter 0.4s ease; filter: grayscale(30%) brightness(0.8);
}
.roadmap-visual:hover .diamond { filter: grayscale(0%) brightness(1); }
.diamond-main { width: 100%; max-width: 280px; height: 280px; z-index: 2; box-shadow: var(--blog-shadow); }
.roadmap-visual:hover .diamond-main { transform: scale(1.05); }
.diamond-small-1 { width: 160px; height: 160px; top: 5%; left: 5%; z-index: 1; opacity: 0.7; }
.roadmap-visual:hover .diamond-small-1 { transform: scale(1.1) translate(-10px, -10px); opacity: 1; }
.diamond-small-2 { width: 140px; height: 140px; bottom: 5%; right: 5%; z-index: 3; opacity: 0.9; }
.roadmap-visual:hover .diamond-small-2 { transform: scale(1.1) translate(10px, 10px); }

/* ==========================================================================
   7. SECTION EXPLORE & CATÉGORIES
   ========================================================================== */
.explore-section.with-hero-bg {
    position: relative; padding: 100px 50px; min-height: 85vh; display: flex; align-items: center; overflow: hidden;
    background-image: linear-gradient(to right, rgba(15, 17, 23, 0.95) 0%, rgba(15, 17, 23, 0.7) 45%, rgba(15, 17, 23, 0) 100%), url('../img/background_japon.png'); 
    background-size: cover; background-position: center right; background-repeat: no-repeat; z-index: 2;
}
.explore-bg-title { top: 5%; left: 30%; font-size: 15vw; opacity: 0.03; }

.explore-container {
    max-width: 1400px; width: 100%; margin: 0 auto; position: relative; z-index: 3; 
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 50px;
}

.explore-content-left { flex: 1 1 55%; min-width: 300px; max-width: 800px; }
.explore-content-right { flex: 1 1 35%; max-width: 500px; z-index: 5; position: sticky; top: 120px; }

.explore-header.left-aligned { text-align: left; max-width: 800px; margin-bottom: 50px; }

.search-wrapper {
    display: flex; align-items: center; padding: 10px 10px 10px 25px; border-radius: 50px; margin-top: 30px; max-width: 600px;
    background: rgba(10, 10, 14, 0.6); transition: all 0.3s ease; border: 1px solid var(--blog-border);
}
.search-wrapper:focus-within { border-color: var(--blog-c-orange); box-shadow: 0 0 25px rgba(250, 169, 64, 0.2); transform: translateY(-2px); }
.search-input { flex: 1; background: transparent; border: none; color: var(--blog-txt); font-family: inherit; font-size: 1.1rem; outline: none; width: 100%; }
.search-btn { background: var(--blog-grad); border: none; width: 50px; height: 50px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; color: #000; transition: all 0.3s ease; flex-shrink: 0; }
.search-btn:hover { transform: scale(1.05); filter: brightness(1.1); }

/* Cartes Catégories */
.category-cards-row.compact-row { display: flex; justify-content: flex-start; align-items: flex-end; gap: 15px; flex-wrap: wrap; }
.cat-vertical-card {
    position: relative; width: 180px; height: 320px; border-radius: 12px; overflow: hidden; cursor: pointer; flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1); box-shadow: 0 15px 35px rgba(0,0,0,0.6); transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.cat-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(40%) brightness(0.6); transition: all 0.5s ease; }
.cat-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15, 17, 23, 0.95) 0%, rgba(15, 17, 23, 0.1) 60%, transparent 100%); }
.cat-content { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px; z-index: 2; transition: transform 0.3s ease; }
.cat-number { font-weight: 900; font-size: 0.9rem; letter-spacing: 2px; display: block; margin-bottom: 8px; }
.cat-title { font-size: 1.1rem; font-weight: 800; line-height: 1.2; text-transform: uppercase; color: #fff; }

.cat-vertical-card:hover { transform: translateY(-10px); border-color: rgba(255,255,255,0.4); }
.cat-vertical-card:hover .cat-bg-img { transform: scale(1.1); filter: grayscale(0%) brightness(0.8); }
.cat-vertical-card.is-active { border-color: var(--blog-c-rose); box-shadow: 0 0 30px rgba(255, 0, 107, 0.4); transform: translateY(-10px); }
.cat-vertical-card.is-active .cat-bg-img { filter: grayscale(0%) brightness(1); transform: scale(1.05); }

/* ==========================================================================
   8. RECHERCHE AJAX & ARTICLE A LA UNE
   ========================================================================== */
#search-results-box { margin-top: 20px; display: none; animation: fadeInTab 0.3s ease; width: 100%; }
.search-results-container { display: flex; flex-direction: column; gap: 20px; width: 100%; }

.search-result-item { display: flex; flex-direction: column; gap: 15px; padding: 35px !important; width: 100%; }
.search-result-img { width: 100%; height: 320px; border-radius: 8px; overflow: hidden; }
.search-result-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.search-result-item:hover .search-result-img img { transform: scale(1.05); }

.search-result-content { display: flex; flex-direction: column; width: 100%; }
.search-result-title { color: var(--blog-c-orange); font-size: 1.8rem; margin-bottom: 20px; line-height: 1.3; font-weight: 800; }

.featured-article { padding: 35px; display: flex; flex-direction: column; gap: 20px; position: relative; overflow: hidden; background: rgba(15, 17, 23, 0.6); width: 100%; }
.featured-badge { position: absolute; top: 20px; left: 20px; background: var(--blog-c-rose); color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 900; letter-spacing: 1px; z-index: 3; box-shadow: 0 5px 15px rgba(255, 0, 107, 0.4); }
.featured-img-wrapper { width: 100%; height: 280px; border-radius: 12px; overflow: hidden; }
.featured-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.featured-article:hover .featured-img { transform: scale(1.05); }
.featured-title { font-size: 1.8rem; font-weight: 800; line-height: 1.3; margin-bottom: 20px; }

.search-excerpt, .featured-excerpt { opacity: 0.9; }

.search-meta, .featured-meta { 
    display: flex; justify-content: space-between; align-items: center; 
    border-top: 1px solid var(--blog-border); padding-top: 25px; margin-top: 40px; flex-wrap: wrap; gap: 15px;
}
.search-meta .go-btn, .featured-meta .go-btn { margin-left: auto; }

.meta-stats { display: flex; gap: 15px; }
.meta-item { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 800; }

/* ==========================================================================
   9. SECTION ARTICLES TENDANCES (GRILLE SÉCURISÉE)
   ========================================================================== */
.trending-section { padding: 100px 20px; position: relative; z-index: 2; background: var(--blog-bg); }
.trending-container { max-width: 1400px; margin: 0 auto; width: 100%; }
.trending-header { text-align: center; margin-bottom: 60px; }

.trending-grid { 
    display: grid; 
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* Minmax 0 empêche la carte de grandir à l'infini */
    gap: 30px; 
    transition: grid-template-columns 0.6s cubic-bezier(0.25, 1, 0.5, 1); 
    width: 100%;
}

.trending-grid:has(.card-1:hover) { grid-template-columns: 2fr 1fr 1fr; }
.trending-grid:has(.card-2:hover) { grid-template-columns: 1fr 2fr 1fr; }
.trending-grid:has(.card-3:hover) { grid-template-columns: 1fr 1fr 2fr; }

.trending-card {
    position: relative; border-radius: 20px; padding: 3px; background: rgba(255, 255, 255, 0.06);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); overflow: hidden; height: 100%; width: 100%;
}

.trending-inner { background: var(--blog-bg); border-radius: 17px; height: 100%; display: flex; flex-direction: column; overflow: hidden; }

/* FIX: Image des articles tendances contenue */
.trending-img-wrapper { width: 100%; height: 220px; flex-shrink: 0; overflow: hidden; }
.trending-img { width: 100%; height: 100%; object-fit: cover; }

.trending-content { padding: 30px; display: flex; flex-direction: column; flex: 1; }
.trending-title { font-size: 1.3rem; font-weight: 800; line-height: 1.3; margin-bottom: 15px; transition: font-size 0.4s ease; }
.trending-excerpt { font-size: 0.95rem; opacity: 0.8; line-height: 1.6; margin-bottom: 25px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: opacity 0.4s ease; }
.trending-meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--blog-border); padding-top: 20px; flex-wrap: wrap; gap: 10px; }

.trending-card .go-btn { opacity: 0; transform: scale(0.9); pointer-events: none; transition: all 0.4s ease; }

.trending-grid:not(:hover) .card-1 .trending-title, .trending-card:hover .trending-title { font-size: 1.7rem; }
.trending-grid:not(:hover) .card-1 .go-btn, .trending-card:hover .go-btn { opacity: 1; transform: scale(1); pointer-events: auto; }
.trending-grid:hover .trending-card:not(:hover) { opacity: 0.4; }

.trending-grid:not(:hover) .card-1, .trending-card:hover {
    background: linear-gradient(135deg, #FAA940, #FF006B, #da0a0e, #d00bf4, #fef00e);
    background-size: 300% 300%; animation: trendingGradient 6s ease infinite; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.category-badge { position: absolute; top: 20px; left: 20px; color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; z-index: 3; }

/* ==========================================================================
   10. NEWSLETTER & FOOTER (ALIGNEMENT CORRIGÉ)
   ========================================================================== */
.site-footer-modern { background: var(--blog-bg); position: relative; z-index: 2; border-top: 1px solid rgba(255, 255, 255, 0.05); }

.newsletter-glass-panel {
    width: 100%; border-radius: 0; border-left: none; border-right: none; padding: 0; overflow: hidden; margin-bottom: 0;
    background: var(--blog-glass); backdrop-filter: var(--blog-blur); -webkit-backdrop-filter: var(--blog-blur);
    border-top: 1px solid var(--blog-border); border-bottom: 1px solid var(--blog-border);
}

.newsletter-visual { position: relative; width: 100%; height: 380px; }
.newsletter-img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.6) grayscale(20%); }

.newsletter-visual-overlay {
    position: absolute; inset: 0; background: linear-gradient(to top, var(--blog-bg) 0%, transparent 100%);
    display: flex; flex-direction: column; justify-content: flex-end; padding: 40px; text-align: center;
}
.newsletter-visual-overlay .main-heading { margin-bottom: 10px; font-size: 2.5rem; }
.newsletter-visual-overlay .description { margin-bottom: 0; max-width: 600px; margin: 0 auto; font-size: 1.05rem; }

.newsletter-form-wrapper { max-width: 1000px; margin: 0 auto; padding: 60px 20px; width: 100%; }
.newsletter-form-wrapper .form-row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.newsletter-form-wrapper .form-group { display: flex; flex-direction: column; flex: 1 1 calc(50% - 20px); min-width: 250px; margin-bottom: 20px; }
.newsletter-form-wrapper .form-group label { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: rgba(255, 255, 255, 0.8); margin-bottom: 8px; }

.newsletter-form-wrapper .form-group input:not([type="checkbox"]) {
    background: rgba(0, 0, 0, 0.4); border: 1px solid var(--blog-border); border-radius: 10px;
    padding: 15px 20px; color: var(--blog-txt); font-family: inherit; font-size: 1rem; transition: all 0.3s ease; outline: none; width: 100%;
}
.newsletter-form-wrapper .form-group input::placeholder { color: rgba(255, 255, 255, 0.3); }
.newsletter-form-wrapper .form-group input:focus { border-color: var(--blog-c-mauve); background: rgba(0, 0, 0, 0.6); box-shadow: 0 0 15px rgba(208, 11, 244, 0.2); }

.newsletter-form-wrapper .checkbox-wrapper { margin-top: 10px; margin-bottom: 30px; }
.newsletter-form-wrapper .checkbox-group { display: flex; align-items: flex-start; gap: 12px; }
.newsletter-form-wrapper .checkbox-group input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; width: 20px; height: 20px; min-width: 20px;
    border: 2px solid var(--blog-border); border-radius: 5px; background: rgba(0, 0, 0, 0.4);
    cursor: pointer; position: relative; transition: all 0.2s ease; margin-top: 2px;
}
.newsletter-form-wrapper .checkbox-group input[type="checkbox"]:checked { background: var(--blog-c-rose); border-color: var(--blog-c-rose); }
.newsletter-form-wrapper .checkbox-group input[type="checkbox"]:checked::after { content: '✔'; position: absolute; color: #fff; font-size: 12px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.newsletter-form-wrapper .checkbox-group label { font-size: 0.9rem; font-weight: 400; line-height: 1.5; opacity: 0.8; cursor: pointer; }
.newsletter-form-wrapper .form-submit-btn { width: 100%; padding: 18px; font-size: 1rem; letter-spacing: 2px; cursor: pointer; border: none; }

.footer-bottom-bar { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 30px 20px; font-size: 0.85rem; color: rgba(255, 255, 255, 0.5); flex-wrap: wrap; gap: 20px; }
.footer-legal-links { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.footer-legal-links a { color: rgba(255, 255, 255, 0.5); text-decoration: none; transition: color 0.3s ease; }
.footer-legal-links a:hover { color: var(--blog-c-orange); }

/* ==========================================================================
   11. POPUP FORMATION
   ========================================================================== */
.popup-overlay {
    position: fixed; inset: 0; background: rgba(15, 17, 23, 0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 9999; display: flex; justify-content: center; align-items: center; padding: 15px; opacity: 1; visibility: visible; transition: opacity 0.4s ease, visibility 0.4s ease;
}
.popup-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.popup-modal {
    position: relative; max-height: 90vh; overflow-y: auto; overflow-x: hidden; padding: 0; 
    border-radius: 20px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8); transform: translateY(0) scale(1); transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-sizing: border-box; background: var(--blog-glass); width: 100%; max-width: 75vw;
}
.popup-modal::-webkit-scrollbar { width: 6px; }
.popup-modal::-webkit-scrollbar-track { background: transparent; }
.popup-modal::-webkit-scrollbar-thumb { background: var(--blog-c-rose); border-radius: 10px; }

.popup-overlay.hidden .popup-modal { transform: translateY(30px) scale(0.95); }

.popup-close {
    position: absolute; top: 15px; right: 15px; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--blog-border);
    color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 1.5rem; display: flex; justify-content: center; align-items: center;
    cursor: pointer; z-index: 10; transition: all 0.3s ease;
}
.popup-close:hover { background: var(--blog-c-rose); border-color: var(--blog-c-rose); transform: rotate(90deg); }

.popup-grid { display: flex; flex-direction: column; width: 100%; box-sizing: border-box; }
.popup-left { position: relative; background: linear-gradient(135deg, rgba(20,20,30,1) 0%, rgba(10,10,15,1) 100%); padding: 50px 30px 30px; display: flex; justify-content: center; align-items: center; border-bottom: 1px solid var(--blog-border); width: 100%; box-sizing: border-box; }
.popup-image-wrapper { position: relative; width: 100%; max-width: 300px; margin: 0 auto; }
.popup-img { width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 15px 30px rgba(0,0,0,0.5)); animation: floatPopupImg 6s ease-in-out infinite alternate; }
.popup-badge { position: absolute; top: -10px; right: -15px; background: var(--blog-grad); color: #000; font-weight: 900; padding: 6px 14px; border-radius: 30px; font-size: 0.75rem; text-transform: uppercase; box-shadow: 0 5px 15px rgba(255, 0, 107, 0.4); }

@keyframes floatPopupImg { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }

.popup-right { padding: 25px 30px; display: flex; flex-direction: column; justify-content: center; width: 100%; box-sizing: border-box; }
.popup-header .main-heading { font-size: 1.8rem !important; line-height: 1.2; margin-bottom: 10px !important; }
.popup-header .description { font-size: 0.95rem !important; margin-bottom: 20px !important; line-height: 1.5; }

#popupBoostRegisterForm { width: 100%; box-sizing: border-box; }
#popupBoostRegisterForm .form-row { display: flex; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }
#popupBoostRegisterForm .form-group { flex: 1 1 100%; margin-bottom: 15px; width: 100%; box-sizing: border-box; }
#popupBoostRegisterForm .form-group label { font-size: 0.85rem; margin-bottom: 6px; display: block; color: rgba(243, 244, 246, 0.9); }
#popupBoostRegisterForm .form-group input:not([type="checkbox"]) { background: rgba(0, 0, 0, 0.5); border: 1px solid var(--blog-border); border-radius: 8px; padding: 12px 15px; color: var(--blog-txt); font-family: inherit; font-size: 0.95rem; width: 100%; box-sizing: border-box; transition: all 0.3s ease; outline: none; }
#popupBoostRegisterForm .form-group input:not([type="checkbox"]):focus { border-color: var(--blog-c-orange); background: rgba(0, 0, 0, 0.7); box-shadow: 0 0 15px rgba(250, 169, 64, 0.2); }
#popupBoostRegisterForm .checkbox-wrapper { margin-bottom: 20px; }
#popupBoostRegisterForm .checkbox-group { display: flex; align-items: flex-start; gap: 12px; }
#popupBoostRegisterForm .checkbox-group input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; min-width: 20px; border: 2px solid var(--blog-border); border-radius: 5px; background: rgba(0, 0, 0, 0.4); cursor: pointer; position: relative; transition: all 0.2s ease; margin-top: 2px; }
#popupBoostRegisterForm .checkbox-group input[type="checkbox"]:checked { background: var(--blog-c-rose); border-color: var(--blog-c-rose); }
#popupBoostRegisterForm .checkbox-group input[type="checkbox"]:checked::after { content: '✔'; position: absolute; color: #fff; font-size: 12px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
#popupBoostRegisterForm .checkbox-group label { font-size: 0.8rem; line-height: 1.4; margin: 0; cursor: pointer; opacity: 0.8; }
#popupBoostRegisterForm .form-submit-btn { padding: 14px; font-size: 1rem; border-radius: 10px; width: 100%; }

/* ==========================================================================
   OPTIMISATIONS POPUP FORMATION (IMAGE ET FORMULAIRE)
   ========================================================================== */

/* 1. Ajustement de l'image pour qu'elle prenne toute la largeur disponible */
.popup-image-wrapper { 
    position: relative; 
    width: 100%; 
    max-width: 100%; /* Écrase l'ancien max-width: 300px */
    margin: 0 auto; 
}

.popup-img { 
    width: 100%; 
    height: auto; 
    max-height: 280px; /* Empêche l'image de devenir trop grande verticalement et de créer du scroll */
    object-fit: contain; /* Garde les proportions de l'image */
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.5)); 
    animation: floatPopupImg 6s ease-in-out infinite alternate; 
}

/* 2. Mise en page du formulaire sur 2 colonnes via Grid */
.form-inputs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colonnes de même taille */
    gap: 15px; /* Espace entre les colonnes et les lignes */
    margin-bottom: 20px;
}

/* On retire la marge basse des éléments internes car la grille (gap) s'en charge */
.form-inputs-grid .form-group {
    margin-bottom: 0; 
    width: 100%;
}

/* Permet à un champ spécifique de prendre toute la largeur des 2 colonnes */
.form-group-full {
    grid-column: 1 / -1;
}

/* ==========================================================================
   RESPONSIVE (SMARTPHONES)
   ========================================================================== */
@media (max-width: 768px) {
    /* Sur mobile, on repasse sur une seule colonne pour éviter les inputs trop petits */
    .form-inputs-grid {
        grid-template-columns: 1fr;
    }
    
    .popup-img {
        max-height: 200px; /* L'image se réduit pour libérer de l'espace sur petit écran */
    }
}

/* ==========================================================================
   12. MEDIA QUERIES GLOBALES (RESPONSIVE)
   ========================================================================== */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; text-align: center; }
    .background-title { font-size: 15vw; top: 2%; }
    
    .vertical-timeline { flex-direction: row; justify-content: center; margin-top: 30px; }
    .timeline-line { width: 100%; height: 1px; top: 50%; left: 0; transform: translateY(-50%); background: repeating-linear-gradient(to right, var(--blog-border) 0, var(--blog-border) 10px, transparent 10px, transparent 20px); }
    .tooltip { top: -40px; right: auto; transform: translateY(10px); }
    .timeline-item:hover .tooltip { transform: translateY(0); }

    .explore-content-left { max-width: 100%; margin-bottom: 50px; }
    .explore-content-right { max-width: 100%; width: 100%; position: relative; top: 0; }
    .category-cards-row.compact-row { justify-content: center; }
    .explore-section.with-hero-bg { 
        background-position: center center; 
        background-image: linear-gradient(to bottom, rgba(15, 17, 23, 0.9) 0%, rgba(15, 17, 23, 0.7) 100%), url('../assets/img/background_japon.png');
    }

    .trending-grid, 
    .trending-grid:has(.card-1:hover), 
    .trending-grid:has(.card-2:hover), 
    .trending-grid:has(.card-3:hover) { grid-template-columns: 1fr; }
    .trending-card .go-btn { opacity: 1; transform: scale(1); pointer-events: auto; }
    .trending-grid:hover .trending-card:not(:hover) { opacity: 1; }
    .trending-title { font-size: 1.5rem !important; }
}

@media (max-width: 900px) {
    .history-container { grid-template-columns: 1fr; gap: 50px; }
    .gradient-border-wrapper { margin: 0 auto; }
    
    .roadmap-line { left: 20px; }
    .roadmap-dot { left: 20px; }
    .roadmap-item, .roadmap-item:nth-child(even) { flex-direction: column; align-items: flex-end; margin-bottom: 80px; }
    .roadmap-text { width: calc(100% - 50px); padding: 25px; margin-bottom: 30px; }
    .roadmap-visual { width: calc(100% - 50px); height: 250px; }
    .diamond-main { width: 200px; height: 200px; }
    .diamond-small-1 { width: 120px; height: 120px; }
    .diamond-small-2 { width: 100px; height: 100px; }
}

@media (max-width: 768px) {
    .cat-vertical-card { width: calc(50% - 10px); height: 220px; }
    .explore-header.left-aligned { text-align: center; }
    .search-wrapper { margin: 30px auto; }
    
    .search-result-img { height: 220px; }
    .featured-img-wrapper { height: 220px; }
    .search-meta, .featured-meta { flex-direction: column; align-items: flex-start; }
    .search-meta .go-btn, .featured-meta .go-btn { margin-left: 0; width: 100%; margin-top: 15px; }

    .newsletter-visual { height: 200px; }
    .newsletter-visual-overlay .main-heading { font-size: 1.8rem; }
    .newsletter-form-wrapper .form-row { flex-direction: column; gap: 0; }
    .newsletter-form-wrapper { padding: 40px 20px; }
    
    .footer-bottom-bar { flex-direction: column; gap: 20px; text-align: center; }
    .footer-legal-links { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 500px) {
    .popup-modal { border-radius: 15px; }
    .popup-left { padding: 25px 15px 15px; }
    .popup-image-wrapper { max-width: 220px; margin: 0 auto; }
    .popup-right { padding: 20px 15px; }
    .popup-header .main-heading { font-size: 1.5rem !important; }
}

/* Remplacer cette partie dans ton CSS existant */
.explore-content-left { 
    flex: 1 1 55%; 
    min-width: 300px; 
    max-width: 800px; 
    /* L'article à la une n'est pas sticky, il scrolle normalement */
}

.explore-content-right { 
    flex: 1 1 35%; 
    max-width: 500px; 
    z-index: 5; 
    position: sticky; 
    top: 120px; /* La recherche va suivre l'utilisateur au scroll, très bonne UX ! */
}

/* On ajuste l'alignement de l'en-tête de recherche */
.explore-header { 
    text-align: left; 
    margin-bottom: 50px; 
}

/* Cartes Catégories - Ajusté pour la section Trending */
.category-cards-row.compact-row { 
    display: flex; 
    justify-content: center; /* Centré pour mieux s'intégrer avec le titre Trending */
    align-items: flex-end; 
    gap: 15px; 
    flex-wrap: wrap; 
    margin-bottom: 60px; /* Espace vital entre les filtres et la grille d'articles */
}

/* Assure-toi d'avoir ces règles dans tes @media (max-width: 1024px) */
@media (max-width: 1024px) {
    .explore-content-left { max-width: 100%; margin-bottom: 50px; }
    .explore-content-right { max-width: 100%; width: 100%; position: relative; top: 0; }
    
    /* Le row des catégories est déjà centré par la modification précédente */
}

/* GAUCHE : Article à la une (prend environ 1/3 de l'espace) */
.explore-content-left { 
    flex: 1 1 33%; 
    min-width: 300px; 
    max-width: 450px; /* On limite la largeur pour forcer le 1/3 */
}

/* DROITE : Recherche et résultats (prend environ 2/3 de l'espace) */
.explore-content-right { 
    flex: 1 1 66%; 
    max-width: 900px; /* On lui donne plus d'espace */
    z-index: 5; 
    position: sticky; 
    top: 120px; 
}

/* GAUCHE : Article à la une (prend environ 1/3 de l'espace) */
.explore-content-left { 
    flex: 1 1 33%; 
    min-width: 300px; 
    max-width: 450px; /* On limite la largeur pour forcer le 1/3 */
}

/* DROITE : Recherche et résultats (prend environ 2/3 de l'espace) */
.explore-content-right { 
    flex: 1 1 66%; 
    max-width: 900px; /* On lui donne plus d'espace */
    z-index: 5; 
    position: sticky; 
    top: 120px; 
}

/* Dans ton @media (max-width: 900px) ou 768px */
@media (max-width: 768px) {
    .cat-vertical-card { 
        flex: 1 1 calc(50% - 20px); /* Passe à 2 cartes par ligne sur tablette/mobile */
        height: 250px; 
    }
}

/* Dans ton @media (max-width: 500px) */
@media (max-width: 500px) {
    .cat-vertical-card { 
        flex: 1 1 100%; /* Passe à 1 carte par ligne sur tout petit écran */
    }
}

/* ==========================================================================
   CORRECTION : PLEINE LARGEUR DES CATÉGORIES
   ========================================================================== */
.category-cards-row.compact-row { 
    display: flex; 
    /* Utilise 'space-between' si tu veux que les cartes aillent d'un bord à l'autre, 
       ou garde 'center' si tu veux juste qu'elles soient centrées dans la pleine largeur */
    justify-content: space-between; 
    align-items: flex-end; 
    gap: 15px; 
    flex-wrap: wrap; 
    margin-bottom: 60px; 
    width: 100%; /* C'est cette ligne qui force la pleine largeur */
}

/* Si tu veux que les cartes elles-mêmes s'étirent pour remplir l'espace vide restant : */
.cat-vertical-card {
    position: relative; 
    /* Modifie la largeur pour permettre l'étirement tout en gardant une base */
    flex: 1 1 180px; 
    max-width: 250px; /* Optionnel : empêche les cartes de devenir géantes sur grand écran */
    height: 320px; 
    border-radius: 12px; 
    overflow: hidden; 
    cursor: pointer; 
    border: 2px solid rgba(255, 255, 255, 0.1); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.6); 
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

#trending-grid-container {
    transition: opacity 0.3s ease-in-out;
}

.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    padding: 6px 14px;
    border-radius: 50px; /* Forme pilule */
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    /* Effet Glassmorphism */
    background: rgba(0, 0, 0, 0.6); /* Fond sombre pour la lisibilité */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    
    /* Transition pour un effet fluide au survol */
    transition: all 0.3s ease;
}

/* Application de tes couleurs via les bordures pour marquer l'appartenance */
.category-badge.bg-rose { border-left: 4px solid var(--blog-c-rose); }
.category-badge.bg-mauve { border-left: 4px solid var(--blog-c-mauve); }
.category-badge.bg-orange { border-left: 4px solid var(--blog-c-orange); }
.category-badge.bg-vert { border-left: 4px solid var(--blog-c-vert); }

/* Petit effet au survol de la carte pour faire ressortir le badge */
.trending-card:hover .category-badge {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
}

/* Conteneur de messages AJAX */
#nl-form-messages {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

#nl-form-messages.hidden {
    display: none;
}

/* Style de succès */
#nl-form-messages.alert-success {
    background-color: rgba(46, 213, 115, 0.1); /* Vert transparent */
    border: 1px solid #2ed573;
    color: #2ed573;
}

/* Style d'erreur */
#nl-form-messages.alert-danger {
    background-color: rgba(255, 71, 87, 0.1); /* Rouge transparent */
    border: 1px solid #ff4757;
    color: #ff4757;
}

#nl-form-messages ul {
    margin: 0;
    padding-left: 20px;
}

#nl-form-messages p {
    margin: 0;
}