/*
Theme Name: Megatest Reloaded
Author: Gemini
Description: Thème à modules optimisé pour Megatest.fr (Tests, Retro, Actu)
Version: 1.4
*/

/* --- VARIABLES --- */
:root {
    --bg: #0b0e14;
    --card: #161b22;
    --accent: #3fb1ff;
    --text: #f0f6fc;
    --text-dim: #8b949e;
    --header-h: 70px;
}

/* --- RESET & BASES --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    background-color: var(--bg) !important; 
    color: var(--text) !important; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    line-height: 1.6;
    overflow-x: hidden;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; height: auto; display: block; }

/* --- TOP BAR (SOCIAL) --- */
.top-bar { 
    background: #000; 
    padding: 8px 0; 
    font-size: 11px; 
    border-bottom: 1px solid #21262d;
}

.bar-flex { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.social-icons a { 
    color: var(--accent); 
    margin-right: 15px; 
    font-weight: bold; 
    text-transform: uppercase;
}

.top-msg { color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* --- NAVIGATION (On la rend plus discrète et scrollable) --- */
header { 
    background: var(--card); 
    border-bottom: 2px solid var(--accent);
    position: relative; /* On change 'sticky' en 'relative' pour que ça disparaisse au scroll */
    z-index: 99;
}

nav.container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: var(--header-h);
}

.logo { 
    font-size: 1.6rem; 
    font-weight: 900; 
    color: #fff; 
    flex-shrink: 0;
    letter-spacing: -1px;
}

.logo span { color: var(--accent); }

/* Menu WordPress Clean */
nav ul { 
    display: flex; 
    list-style: none; 
    gap: 20px;
    align-items: center;
}

nav ul li a { 
    color: #fff; 
    font-size: 0.85rem; 
    font-weight: 700; 
    text-transform: uppercase;
    white-space: nowrap;
}

nav ul li a:hover { color: var(--accent); }

/* --- MODULE HIGHLIGHT (FOCUS) --- */
.highlight-module { margin: 40px 0; }

.hero-card {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #30363d;
    max-height: 500px;
}

.hero-img { height: 500px; background: #000; overflow: hidden; }

.hero-img img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; /* L'image remplit la zone sans déformer */
}

.hero-content { 
    padding: 40px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

.badge { 
    background: var(--accent); 
    color: #000; 
    font-weight: 800; 
    padding: 4px 12px; 
    border-radius: 4px; 
    font-size: 11px; 
    width: fit-content; 
    margin-bottom: 20px;
}

.hero-content h2 { 
    font-size: 2.4rem; 
    line-height: 1.1; 
    margin-bottom: 15px; 
    color: #fff;
}

.hero-content p { color: var(--text-dim); margin-bottom: 25px; }

.btn-hero { 
    background: var(--accent); 
    color: #000 !important; 
    padding: 12px 30px; 
    border-radius: 6px; 
    font-weight: bold; 
    width: fit-content;
}

/* --- GRID DES ANCIENS ARTICLES --- */
.section-divider { 
    margin: 40px 0 25px; 
    padding-bottom: 10px;
    border-bottom: 1px solid #30363d;
    color: var(--accent);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.articles-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 30px; 
    margin-bottom: 60px;
}

.grid-card { 
    background: var(--card); 
    border-radius: 10px; 
    overflow: hidden; 
    border: 1px solid #30363d;
    transition: 0.3s;
}

.grid-card:hover { transform: translateY(-5px); border-color: var(--accent); }

.grid-img img { width: 100%; height: 200px; object-fit: cover; }

.grid-body { padding: 20px; }

.cat-label { 
    font-size: 10px; 
    color: var(--accent); 
    font-weight: bold; 
    text-transform: uppercase; 
    display: block;
    margin-bottom: 10px;
}

.grid-body h3 { font-size: 1.1rem; color: #fff; line-height: 1.4; }

/* --- FOOTER --- */
footer { 
    background: var(--card); 
    padding: 50px 0; 
    text-align: center; 
    border-top: 1px solid #30363d;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .hero-card { grid-template-columns: 1fr; max-height: none; }
    .hero-img { height: 300px; }
    .hero-content h2 { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    nav.container { flex-direction: column; height: auto; padding: 15px; }
    nav ul { flex-wrap: wrap; justify-content: center; margin-top: 15px; gap: 10px; }
    .logo { margin-bottom: 10px; }
}

/* --- PAGE ARTICLE (SINGLE.PHP) FIX --- */
.post-full {
    max-width: 900px; /* Un peu plus large pour le confort */
    margin: 0 auto; /* Suppression des grosses marges du haut */
    background: transparent; /* Fond transparent pour ne pas faire de gros bloc lourd */
    padding: 20px;
    border: none;
}

.post-header {
    background: #000; /* Fond noir derrière le titre pour le faire ressortir */
    padding: 60px 40px;
    margin: 0 -20px 40px -20px; /* On fait déborder le fond noir sur les côtés */
    text-align: center;
    border-bottom: 3px solid var(--accent);
}

.post-header h1 {
    font-size: 2.8rem;
    line-height: 1.1;
    color: #fff;
    margin: 10px 0;
    font-weight: 900;
}

.post-meta {
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.post-featured-img img {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 40px;
}

.post-content {
    background: var(--card); /* Le texte reste dans un bloc sombre propre */
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #30363d;
    font-size: 1.15rem;
}

.post-content p { margin-bottom: 20px; }
.post-content h2, .post-content h3 { color: var(--accent); margin: 30px 0 15px; }

/* Correction liens titres accueil */
.hero-content h2 a:hover, .grid-body h3 a:hover {
    color: var(--accent);
}

/* --- GESTION DES SOUS-MENUS --- */

/* 1. On positionne le parent pour que le sous-menu s'aligne dessous */
nav ul li {
    position: relative;
}

/* 2. On cache le sous-menu par défaut */
nav ul li ul {
    display: none; /* Cache complètement */
    position: absolute;
    top: 100%; /* Juste en dessous du lien parent */
    left: 0;
    background: #161b22; /* Même fond que le header */
    min-width: 200px;
    padding: 10px 0;
    border: 1px solid var(--accent);
    border-top: 3px solid var(--accent);
    z-index: 9999;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* 3. On affiche le sous-menu quand on survole le parent */
nav ul li:hover > ul {
    display: block;
}

/* 4. Style des liens à l'intérieur du sous-menu */
nav ul li ul li {
    width: 100%;
    border: none;
}

nav ul li ul li a {
    padding: 10px 20px;
    display: block;
    font-size: 12px;
    text-transform: none; /* Plus lisible en minuscule pour les sous-menus */
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

nav ul li ul li a:hover {
    background: rgba(63, 177, 255, 0.1);
    color: var(--accent);
}

/* 5. Petit indicateur (optionnel) pour montrer qu'il y a un sous-menu */
.menu-item-has-children > a::after {
    content: ' ▾';
    font-size: 10px;
    vertical-align: middle;
    opacity: 0.6;
}

.loader {
    color: var(--accent);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}