/* ==========================================================================
   N3XUS MAILLAGE GLITCH CORE V13.0 - PURE VANILLA (NO TAILWIND)
   GPU ACCELERATED - ZERO DEPENDENCIES
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@600;800;900&display=swap');

:root {
    --n3x-red: #ff2a2a;
    --n3x-bg: #050505;
    --n3x-card-bg: #0a0a0c;
}

/* Container Global Scoped (Évite de casser le thème WP) */
.n3x-glitch-wrapper {
    position: relative;
    background-color: var(--n3x-bg);
    font-family: 'Inter', system-ui, sans-serif;
    padding: 5rem 0 4rem 0; /* Respiration interne conservée */
    margin-top: 4rem;
    margin-bottom: 0 !important; /* KILL SWITCH : Destruction de la zone morte sous le module */
    border-top: 1px solid rgba(255, 42, 42, 0.15);
    border-bottom: none !important; /* On supprime la bordure basse pour fusionner avec celle du footer */
    overflow: hidden;
}

.n3x-glitch-wrapper * {
    box-sizing: border-box;
}

/* Background Radial Emulé */
.n3x-glitch-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, var(--n3x-bg) 82%);
    pointer-events: none;
    z-index: 0;
}

.n3x-glitch-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 10;
}

/* --- HEADER --- */
.n3x-glitch-header {
    margin-bottom: 3.5rem;
}

.n3x-glitch-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.n3x-led-pulse {
    width: 10px;
    height: 10px;
    background-color: var(--n3x-red);
    border-radius: 50%;
    animation: n3x-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes n3x-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--n3x-red); }
    50% { opacity: 0.3; box-shadow: none; }
}

.n3x-mono-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 5px;
    color: var(--n3x-red);
    text-transform: uppercase;
}

.n3x-glitch-header-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.n3x-glitch-title-main {
    font-size: clamp(2.5rem, 5vw, 66px);
    font-weight: 900;
    letter-spacing: -3.4px;
    color: #ffffff;
    line-height: 1;
    margin: 0;
    text-transform: uppercase;
}

.n3x-glitch-subtitle {
    font-size: 1.25rem;
    color: #a1a1aa; /* zinc-400 */
    margin: 8px 0 0 0;
}

.n3x-glitch-status {
    text-align: right;
    color: #71717a; /* zinc-500 */
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.n3x-glitch-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 42, 42, 0.2), transparent);
    margin-top: 1rem;
}

/* --- GRID & CARDS --- */
.n3x-glitch-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.25rem;
}

@media (min-width: 900px) {
    .n3x-glitch-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

.n3x-glitch-card {
    position: relative;
    /* La clé est ici : On abandonne la hauteur fixe pour un ratio absolu */
    aspect-ratio: 16 / 9; 
    min-height: 220px; /* Failsafe : Empêche le texte d'être écrasé sur les écrans moyens */
    background: var(--n3x-card-bg);
    border: 1px solid rgba(255, 42, 42, 0.12);
    overflow: hidden;
    transition: border-color 0.4s ease;
    text-decoration: none;
    display: block;
}

.n3x-glitch-card:hover {
    border-color: var(--n3x-red);
}

/* ... (Garde .n3x-glitch-image tel quel) ... */

.n3x-glitch-overlay {
    position: absolute;
    inset: 0;
    /* Dégradé recalibré pour le 16:9 : Protège la typographie sans boucher l'image */
    background: linear-gradient(to top, var(--n3x-bg) 5%, rgba(5, 5, 5, 0.85) 45%, transparent 85%);
    z-index: 2;
}

.n3x-glitch-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: grayscale(0.88) contrast(1.35) brightness(0.52);
    transition: filter 0.9s ease;
    z-index: 1;
    will-change: filter, transform;
}

.n3x-glitch-card:hover .n3x-glitch-image {
    filter: grayscale(0.1) contrast(1.1) brightness(0.7);
}

.n3x-glitch-overlay {
    position: absolute;
    inset: 0;
    /* Dégradé recalibré pour le 16:9 : Protège la typographie sans boucher l'image */
    background: linear-gradient(to top, var(--n3x-bg) 5%, rgba(5, 5, 5, 0.85) 45%, transparent 85%);
    z-index: 2;
}

.n3x-matrix-bg {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,42,42,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,42,42,0.025) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 2;
    pointer-events: none;
}

.n3x-scanline {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(transparent, var(--n3x-red), transparent);
    box-shadow: 0 0 18px var(--n3x-red);
    z-index: 6;
    opacity: 0;
    animation: n3x-scan-move 2.8s linear infinite;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.n3x-glitch-card:hover .n3x-scanline {
    opacity: 0.7;
    animation-duration: 0.65s;
}

@keyframes n3x-scan-move {
    0% { top: -100%; }
    100% { top: 420px; }
}

.n3x-glitch-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.1rem 1.9rem;
}

.n3x-glitch-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 3.6px;
    color: var(--n3x-red);
    font-weight: 700;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 7px;
}

.n3x-glitch-tag::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--n3x-red);
    box-shadow: 0 0 11px var(--n3x-red);
    display: block;
}

.n3x-glitch-post-title {
    color: white;
    font-size: 1.33rem;
    font-weight: 800;
    line-height: 1.13;
    margin: 0 0 1.35rem 0;
    text-shadow: 0 4px 18px rgba(0,0,0,0.9);
    font-family: 'Inter', sans-serif;
}

.n3x-glitch-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: #a1a1aa;
}

.n3x-text-red { color: var(--n3x-red); }