/* =========================================================================
   GEEKTHINK V8 - MOBILE & TABLET MASTER OVERRIDE (COMPLETE)
   Standard 0.01% - Zero Compromise Architecture
   ========================================================================= */

/* --- TABLETTE LARGE (Max 1400px) --- */
@media (max-width: 1400px) { 
    .showcase-pane { flex: 0 0 calc(100vw / 2.5); min-width: 350px; } 
}

/* --- TABLETTE STANDARD (Max 1200px) --- */
@media (max-width: 1200px) {
    .n3xus-bento { grid-template-columns: 1fr 1fr; }
    .bento-col.main-col { grid-column: span 2; order: -1; }
    .bento-card.hero { min-height: 500px; }
}

/* --- TABLETTE & HYBRIDE (Max 1024px) --- */
@media (max-width: 1024px) { 
    .showcase-pane { flex: 0 0 calc(100vw / 2); padding: 3rem 2rem; } 
    .showcase-title { font-size: 2.2rem; } 
    .article-layout { grid-template-columns: 1fr; gap: 4rem; padding-top: 4rem; }
    .article-sidebar { position: static; flex-direction: row; flex-wrap: wrap; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 2rem;}
    .share-network { flex-direction: row; }
    .news-item { grid-template-columns: 1fr; gap: 1.5rem; padding: 2rem; margin: 0; }
    .news-thumbnail { max-width: 300px; }
}

/* --- SMARTPHONE LARGE (Max 900px) --- */
@media (max-width: 900px) {
    .bento-wrapper { grid-template-columns: 1fr; grid-template-rows: auto; }
    .bento-item { grid-column: auto !important; grid-row: auto !important; height: 350px; }
}

/* --- KERNEL MOBILE (Max 768px) : THE NUCLEAR ZONE --- */
@media (max-width: 768px) {
    
    /* ANTI-BLEED & LOCK */
    html, body { overflow-x: hidden !important; width: 100%; position: relative; }
    .n3xus-container, .n3xus-container-narrow { padding: 0 1rem; }

    /* OS UI & HUD */
    .os-system-bar { display: none; }
    .os-viewport { padding-top: calc(var(--header-height) + 1rem); }
    .os-header { top: 0; }
    .os-header .n3xus-container { justify-content: space-between; padding: 0 1.5rem; }
    .os-header .os-nav-wrapper { display: none; }

    /* NAVIGATION DRAWER V8 */
    .mobile-nav-toggle {
        display: block; background: none; border: none; cursor: pointer; color: var(--text-pure);
        position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
        z-index: 2001; padding: 5px; width: 30px; height: 30px;
    }
    .mobile-nav-toggle line { transform-origin: center; transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); }
    .mobile-nav-toggle.active .burger-line-1 { transform: translateY(6px) rotate(45deg); color: var(--cyber-red); }
    .mobile-nav-toggle.active .burger-line-2 { opacity: 0; }
    .mobile-nav-toggle.active .burger-line-3 { transform: translateY(-6px) rotate(-45deg); color: var(--cyber-red); }

    .mobile-nav-overlay-bg {
        position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85) !important;
        backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
        z-index: 1999; opacity: 0; pointer-events: none; transition: opacity 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
    .mobile-nav-overlay-bg.active { opacity: 1; pointer-events: all; }

    .mobile-nav-sheet {
        box-sizing: border-box; position: fixed; top: 0; right: 0; bottom: 0; 
        width: 320px; max-width: 85vw; height: 100vh !important; overflow-y: auto; 
        background-color: #0a0a0c !important; border-left: 1px solid rgba(255, 40, 81, 0.2); 
        box-shadow: -20px 0 60px rgba(0,0,0,0.9); z-index: 2000;
        display: flex; flex-direction: column; padding: 6rem 2.5rem 4rem 2.5rem;
        transform: translateX(100%); transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
    .mobile-nav-sheet.active { transform: translateX(0); }
    
    .mobile-nav-list a {
        font-size: 1.1rem; letter-spacing: 0.1em; font-family: var(--font-mono); font-weight: 500;
        padding: 0.8rem 0; width: 100%; border-bottom: 1px solid rgba(255,255,255,0.03);
        color: var(--text-mineral); display: flex; align-items: center; justify-content: space-between;
        text-decoration: none; transition: all 0.3s ease;
    }

    /* SINGLE ARTICLE TUNING */
    .article-title { font-size: clamp(2.2rem, 10vw, 3.2rem); word-break: break-word; line-height: 1.1; margin-bottom: 1.5rem; }
    .article-hero { 
        height: auto !important; 
        min-height: 70vh !important; 
        
        /* On annule le margin négatif sur mobile également */
        margin-top: 0 !important; 
        
        /* Plus besoin de compenser le menu avec un padding géant */
        padding-top: 4rem !important; 
        padding-bottom: 4rem !important; 
    }
    .content-box { padding: 1rem 0; border: none; background: transparent; }

    /* =========================================================================
       NUCLEAR RESET V3 : ÉCRAN DE CONTRÔLE 16/9 & TÉLÉMÉTRIE INLINE
       ========================================================================= */

    /* RESET DE LA GRILLE PARENTE */
    .article-layout.archive-mode { 
        display: flex !important; flex-direction: column !important; 
        width: 100% !important; padding: 3rem 0 !important; gap: 2rem !important; 
    }

    .news-item { 
        display: flex !important; flex-direction: column !important; 
        background: transparent !important; border: none !important; 
        margin-bottom: 4rem !important; width: 100% !important; overflow: visible !important; 
    }

    /* 1. LE CONTENEUR IMAGE : Écran de Contrôle Encadré (V3) */
    .news-image-wrapper {
        width: calc(100vw - 2rem) !important; 
        max-width: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important; 
        margin-left: 0 !important; 
        margin-right: 0 !important;
        aspect-ratio: 16 / 9 !important; 
        position: relative !important;
        overflow: hidden !important; 
        
        /* LA MATRICE ROUGE INTÉGRALE */
        border: 1px solid #ff2851 !important; 
        border-radius: 2px !important; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 20px rgba(255, 40, 81, 0.15) !important; 
        
        display: block !important;
        margin-bottom: 1.5rem !important;
    }

    @supports not (aspect-ratio: 1) { 
        .news-image-wrapper { padding-bottom: 56.25% !important; height: 0 !important; } 
    }

    /* 2. L'IMAGE : Killswitch de sécurité absolue */
    .news-thumbnail {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important; 
        aspect-ratio: auto !important; 
        background-size: cover !important;
        background-position: center center !important;
        filter: brightness(0.9) contrast(1.08) !important;
        border: none !important; 
        border-radius: 0 !important; 
        margin: 0 !important;
        padding: 0 !important;
        transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.6s ease !important;
    }

    .news-thumbnail:hover { 
        transform: scale(1.04) !important; 
        filter: brightness(1.05) !important; 
    }

    /* 3. L'OVERLAY : HUD ancré au sol */
    .news-thumbnail::after {
        content: '' !important;
        position: absolute !important;
        bottom: -1px !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        height: 35% !important;
        background: linear-gradient(to bottom, transparent 0%, rgba(10,10,12,0.98) 100%) !important;
        pointer-events: none !important;
        z-index: 2 !important;
    }

    /* 4. TELEMETRIE & TEXTE : Sécurité de l'alignement Inline */
    .news-content-wrapper { width: 100% !important; padding: 0 1rem !important; }
    
    .news-telemetry-top { 
        display: flex !important; 
        flex-direction: row !important; 
        align-items: center !important; 
        gap: 8px !important; 
        margin-bottom: 15px !important; 
        flex-wrap: nowrap !important; /* Force le maintien sur une ligne */
    }
    
    .news-date { 
        color: var(--cyber-red) !important; 
        font-size: 0.85rem !important; 
        font-weight: 700 !important; 
        letter-spacing: 0.1em !important; 
        display: inline-block !important; 
        white-space: nowrap !important; /* Interdit la coupure de la date */
    }
    
    .news-tags { 
        color: var(--text-pure) !important; 
        font-size: 0.8rem !important; 
        display: inline-flex !important; 
        align-items: center !important;
        white-space: nowrap !important;
    }
    
    .gt-separator { 
        display: none !important; /* Exécution de l'élément sur mobile */
    }
    
    .news-title { font-size: 1.8rem !important; line-height: 1.15 !important; margin-bottom: 12px !important; letter-spacing: -0.02em !important; color: var(--text-pure) !important; }
    .news-excerpt { font-size: 1rem !important; color: var(--text-mineral) !important; line-height: 1.6 !important; margin-bottom: 20px !important; }

} /* FIN STRICTE DU BLOC MOBILE 768px */

/* --- FOOTER & MISC (Max 600px) --- */
@media (max-width: 600px) {
    .gt-social-dock { flex-wrap: wrap; justify-content: center; gap: 15px; }
    
    /* =========================================================================
       NUCLEAR OVERRIDE : RECALIBRAGE SINGLE.PHP MOBILE
       ========================================================================= */
       
    /* 1. LECTURE OPTIMISÉE (Le Texte) */
    .article-main-column { width: 100% !important; padding: 0 !important; }
    .content-box.article-content { padding: 0 15px !important; }
    .article-content { font-size: 1.05rem !important; line-height: 1.6 !important; }
    .n3xus-drop-cap { font-size: 3.8rem !important; margin-right: 12px !important; }
    .article-content h2 { font-size: 2.2rem !important; margin-top: 2.5rem !important; }
    .article-content h3 { font-size: 1.5rem !important; margin-top: 2rem !important; }
    .article-content blockquote { padding: 1rem !important; font-size: 1.05rem !important; margin: 2rem 0 !important; }

    /* 2. RÉSEAU DE COMMENTAIRES */
    .comments-terminal-wrap { padding: 0 15px !important; overflow: hidden !important; }
    #respond { padding: 15px !important; margin-top: 1rem !important; }
    .comment-input-row { grid-template-columns: 1fr !important; gap: 15px !important; } /* Empile les inputs Nom et Email */
    .comment-body { grid-template-columns: 30px 1fr !important; padding: 0.8rem !important; }
    .comment-avatar { width: 30px !important; height: 30px !important; }

    /* 3. WIDGETS ET SIDEBARS (Boutons de Transmission) */
    .article-sidebar { padding: 0 15px !important; margin-top: 2rem !important; width: 100% !important; }
    .share-network { display: flex !important; flex-direction: column !important; gap: 10px !important; width: 100% !important; }
    .share-btn { padding: 12px 15px !important; font-size: 0.75rem !important; justify-content: flex-start !important; }

    /* 4. LIGHTBOX V8 (Sécurité Anti-Overlap) */
    .lightbox-hud-meta { top: 10px !important; left: 10px !important; font-size: 9px !important; }
    .lightbox-hud-meta span:nth-child(2) { display: none !important; } /* Destruction de l'affichage de la résolution */
    .lightbox-close-v8 { 
        top: 6px !important; 
        right: 10px !important; 
        font-size: 10px !important; 
        background: rgba(0,0,0,0.8) !important; /* Ajoute un fond au cas où une image claire passerait dessous */
        padding: 5px !important; 
    }
    .lightbox-stage-frame { padding: 35px 10px 10px 10px !important; width: 95vw !important; }
    
    /* =========================================================================
       MODULE: WIDGETS & SIDEBAR (MOBILE TERMINAL UPGRADE)
       ========================================================================= */
       
    /* 1. LA BOÎTE : Alignement Mathématique et Carrure */
    .article-sidebar .author-card {
        width: calc(100vw - 2rem) !important; /* Même largeur exacte que l'image */
        max-width: 100% !important;
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important; /* Centrage absolu sur l'écran */
        margin: 0 0 3rem 0 !important; 
        padding: 2rem !important;
        background: #050505 !important; /* Noir profond */
        border: 1px solid rgba(255, 40, 81, 0.4) !important; /* Liseré rouge matrice */
        box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 20px rgba(255, 40, 81, 0.05) !important;
        border-radius: 2px !important;
    }

    /* 2. LE TITRE : Centrage et Autorité */
    .article-sidebar .author-card .sidebar-block-title {
        font-size: 1rem !important;
        color: var(--cyber-red) !important;
        justify-content: center !important; /* Centre "// CATEGORIES.SYS" et le point vert */
        gap: 12px !important;
        margin-bottom: 2rem !important;
        letter-spacing: 0.15em !important;
        border-bottom: 1px solid rgba(255, 40, 81, 0.2) !important;
        padding-bottom: 1rem !important;
    }

    /* 3. LES DONNÉES : Liste de catégories claire et centrée */
    .cat-list-sidebar li {
        text-align: center !important; /* Centre les textes "GAMING (1)" */
        padding: 15px 0 !important;
        font-size: 0.95rem !important;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.05) !important;
    }
    
    .cat-list-sidebar li:last-child {
        border-bottom: none !important; /* Nettoie la dernière ligne */
        padding-bottom: 0 !important;
    }
    
    .cat-list-sidebar li a {
        font-weight: 700 !important;
        letter-spacing: 0.05em !important;
        color: var(--text-pure) !important;
    }
    
    /* 5. RESTRUCTURATION SIDEBAR GAUCHE (Stack Vertical Strict) */
    .article-layout .article-sidebar.left {
        display: flex !important;
        flex-direction: column !important; /* Force l'empilement vertical absolu */
        align-items: flex-start !important; /* Aligne tout à gauche */
        gap: 2.5rem !important; /* Espace respirable entre chaque bloc */
        width: 100% !important;
        padding: 0 15px !important;
    }

    /* Empêche les éléments de se tasser ou de s'aligner côte à côte */
    .article-layout .article-sidebar.left > div {
        width: 100% !important;
        flex: 0 0 auto !important;
        margin: 0 !important; /* Le gap gère l'espacement */
    }
    
    /* =========================================================================
       FINITIONS V8 : LIGHTBOX & ESPACEMENT FOOTER
       ========================================================================= */
       
    /* 1. LIGHTBOX : Recalibrage du point d'ancrage (Ignore la Topbar invisible) */
    .n3xus-lightbox {
        top: var(--header-height) !important;
        height: calc(100vh - var(--header-height)) !important;
    }

    /* 2. RESPIRATION FOOTER : Dégagement de sécurité sous le dernier bloc */
    .article-sidebar.right {
        margin-bottom: 4rem !important;
    }
} /* FIN STRICTE DU BLOC FOOTER 600px */