/* --- VARIABLES & RESET (Thème Light & Orange) --- */
:root {
    --bg-body: #f4f7f6;       /* Gris très clair apaisant */
    --bg-card: #ffffff;       /* Blanc pur pour les contenus */
    --primary: #ff6b00;       /* Orange Vibrant (Action) */
    --primary-hover: #e65100; /* Orange plus foncé au survol */
    --text-main: #2d3436;     /* Gris foncé presque noir (lisibilité) */
    --text-muted: #636e72;    /* Gris moyen */
    --border-color: #dfe6e9;  /* Bordures subtiles */
    --shadow-soft: 0 4px 15px rgba(0,0,0,0.05); /* Ombre élégante */
    --font-main: 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    font-family: var(--font-main); 
    line-height: 1.6;
    /* DEMANDE : Contenu de la page en 16px normal */
    font-size: 16px; 
    font-weight: 400;
}

a { text-decoration: none; color: inherit; transition: 0.2s ease; }
ul { list-style: none; }

/* --- HEADER --- */
header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0; /* Un peu moins de padding car l'image a sa propre hauteur */
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

/* DEMANDE : Affichage Full-Width (95% de la largeur) */
.container { 
    max-width: 95%; 
    margin: 0 auto; 
    padding: 0 20px; 
}

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

/* NOUVEAU STYLE POUR LE LOGO IMAGE */
.logo a {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px; /* Taille idéale pour le header */
    width: auto;  /* Largeur automatique pour garder les proportions */
    display: block;
}

/* Le reste du menu ne change pas */
.menu { display: flex; gap: 30px; }
.menu a { 
    font-weight: 600; 
    font-size: 1rem; 
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.9rem;
}
.menu a:hover { color: var(--primary); }

/* Zone Recherche */
.search-box input {
    background: #f1f2f6;
    border: 1px solid transparent;
    padding: 10px 20px;
    border-radius: 50px;
    color: var(--text-main);
    width: 250px;
    outline: none;
    transition: 0.3s;
    font-size: 0.9rem;
}
.search-box input:focus { 
    background: #fff; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1); 
    width: 280px; 
}

/* --- HERO SECTION (Dégradé Orange) --- */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #ff9966 0%, #ff5e62 100%);
    color: white;
    margin-bottom: 40px;
}
.hero h1 { font-size: 3rem; margin-bottom: 10px; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.hero p { font-size: 1.3rem; opacity: 0.95; max-width: 600px; margin: 0 auto; font-weight: 500; }

/* --- TITRES --- */
/* DEMANDE : Titres en 18px Gras */
.section-title {
    font-size: 24px; /* On garde les titres de section un peu plus grands pour la hiérarchie */
    color: var(--text-main);
    margin: 40px 0 25px;
    position: relative;
    padding-left: 15px;
    border-left: 5px solid var(--primary);
    font-weight: 700;
}

/* --- GRILLE DE JEUX --- */
.games-grid {
    display: grid;
    /* Changement de 260px à 220px pour des cartes plus fines et élégantes */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 30px;
    padding-bottom: 60px;
}

.game-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(255, 107, 0, 0.15);
    border-color: var(--primary);
}

/* --- MISE À JOUR : Images carrées (512x512 supportées) --- */
.game-card img {
    width: 100%;
    /* On supprime la hauteur fixe de 170px */
    height: auto; 
    /* On force un ratio Carré (1:1) pour respecter le format GameDistribution */
    aspect-ratio: 1 / 1; 
    object-fit: cover; /* Garantit que l'image remplit le carré sans être déformée */
    display: block;
    border-bottom: 1px solid var(--border-color); /* Petite séparation propre avec le titre */
}

.game-info { padding: 20px; }

/* DEMANDE : Titres des jeux en 18px Gras */
.game-info h3 { 
    font-size: 18px; 
    font-weight: 700;
    margin-bottom: 8px; 
    color: var(--text-main); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.play-btn {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.game-card:hover .play-btn { color: var(--primary-hover); }

/* --- PAGE CONTACT STYLE --- */
.contact-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 50px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.contact-form .form-row { display: flex; gap: 20px; margin-bottom: 20px; }
.contact-form .form-group { flex: 1; display: flex; flex-direction: column; margin-bottom: 20px; }
.contact-form label { font-weight: 600; margin-bottom: 8px; color: var(--text-main); font-size: 0.95rem; }

.contact-form input, 
.contact-form textarea {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 16px; /* Texte input 16px */
    outline: none;
    transition: 0.3s;
}

.contact-form input:focus, 
.contact-form textarea:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.btn-submit {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}
.btn-submit:hover { background: var(--primary-hover); transform: translateY(-2px); }
.success-box { background: #e8f5e9; border: 1px solid #c8e6c9; padding: 15px; border-radius: 8px; color: #2e7d32; text-align: center; }
.error-box { background: #ffebee; border: 1px solid #ffcdd2; padding: 15px; border-radius: 8px; color: #c62828; margin-bottom: 20px; }

/* --- BLOG & CONTENU --- */
.blog-card-horizontal {
    display: flex; gap: 25px; 
    background: var(--bg-card); 
    margin-bottom: 25px; 
    padding: 25px; 
    border-radius: 12px; 
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    transition: 0.3s;
}
.blog-card-horizontal:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.08); border-color: var(--primary); }

/* Titres des articles blog */
.blog-content h2 a { 
    color: var(--text-main); 
    text-decoration: none; 
    font-size: 20px; /* Un peu plus grand pour les titres H2 */
    font-weight: 700;
}
.blog-content h2 a:hover { color: var(--primary); }

/* DEMANDE : Chiffres/Dates en 18px Sans Gras */
.meta-date, .article-meta { 
    color: var(--text-muted); 
    font-size: 18px; 
    font-weight: 400; /* Normal (Sans gras) */
    margin-bottom: 12px; 
    display: block;
}

.excerpt { color: #555; margin-bottom: 15px; line-height: 1.6; font-size: 16px; }
.read-more { color: var(--primary); font-weight: 700; }

/* --- SIDEBAR & WIDGETS --- */
.widget { background: var(--bg-card); padding: 25px; border-radius: 12px; margin-bottom: 25px; border: 1px solid var(--border-color); box-shadow: var(--shadow-soft); }

/* DEMANDE : Titres Widgets 18px Gras */
.widget h3 { 
    border-bottom: 2px solid var(--primary); 
    padding-bottom: 10px; 
    margin-bottom: 20px; 
    color: var(--text-main);
    font-size: 18px;
    font-weight: 700;
}

.sidebar-list li { border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 10px; }
.sidebar-list a { color: var(--text-main); font-weight: 500; font-size: 16px; }
.sidebar-list a:hover { color: var(--primary); padding-left: 5px; }

/* --- PAGE JEU & ARTICLE SINGLE --- */
.article-h1 { font-size: 28px; font-weight: 800; color: var(--text-main); margin-bottom: 10px; }
.article-body { font-size: 16px; line-height: 1.8; color: var(--text-main); }
.article-body h2, .article-body h3 { font-weight: 700; margin-top: 30px; margin-bottom: 15px; color: var(--primary); }

/* --- FOOTER --- */
footer {
    background: #1e272e;
    color: #b2bec3;
    padding: 50px 0;
    margin-top: 60px;
    text-align: center;
}
footer a { color: #dfe6e9; margin: 0 15px; font-weight: 500; font-size: 16px; }
footer a:hover { color: var(--primary); }
.copyrights { margin-top: 20px; font-size: 14px; opacity: 0.7; }

/* --- RESPONSIVE --- */
@media(max-width: 768px) {
    .blog-card-horizontal { flex-direction: column; }
    .header-flex { flex-direction: column; gap: 15px; }
    .menu { gap: 15px; font-size: 0.9rem; }
    .hero h1 { font-size: 2rem; }
}

/* --- ZONES PUBLICITAIRES --- */
.ad-zone {
    background: #f1f2f6; /* Gris clair pour visualiser la zone */
    border: 1px dashed #ced6e0;
    text-align: center;
    margin: 30px auto;
    padding: 10px;
    border-radius: 8px;
    color: #a4b0be;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    overflow: hidden;
}

.ad-leaderboard { width: 100%; max-width: 728px; height: auto; min-height: 90px; }
.ad-rectangle { width: 100%; max-width: 300px; height: auto; min-height: 250px; }
.ad-responsive { width: 100%; min-height: 100px; }
.ad-zone.active { background: transparent; border: none; }

/* --- HEADER BAR JEUX (Titre + Menu Déroulant) --- */
.games-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 20px 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
}

.cat-dropdown {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    min-width: 220px;
    transition: 0.3s;
    appearance: none; /* Enlève le style par défaut du navigateur */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ff6b00%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
}

.cat-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
    background-color: #fff;
}

/* Petit tag de catégorie sur la carte du jeu */
.category-tag {
    display: inline-block;
    font-size: 11px;
    background: #f1f2f6;
    padding: 2px 8px;
    border-radius: 4px;
    color: #636e72;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 700;
}

/* RESPONSIVE */
@media(max-width: 768px) {
    .games-header-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        align-items: stretch;
    }
    .cat-dropdown {
        width: 100%;
        text-align: center;
        background-position: right 20px top 50%;
    }
}

/* RESPONSIVE LAYOUT FILTRES : Sur mobile, la sidebar passe au-dessus ou devient un menu déroulant */
@media(max-width: 900px) {
    .games-page-layout {
        flex-direction: column;
    }
    .filters-sidebar {
        width: 100%;
    }
    .cat-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .cat-list li { border:none; width: auto; }
    .cat-list a { 
        background: #fff; 
        border: 1px solid #ddd; 
        padding: 8px 15px; 
    }
    .cat-list a.active { border-color: var(--primary); }
}