/* --- VARIABLES ET BASES --- */
:root {
    --primary: #FF004D;
    --dark: #141414;
    --nav-height: 40px;
    --banner-height: 360px; /* Hauteur de la bannière sur PC */
}

body {
    background: var(--dark);
    color: white;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* --- NAVIGATION FIXE --- */
nav {
    background: #000;
    padding: 0 1.5rem;
    border-bottom: 1px solid #333;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style-type: none;
}

.brand {
    font-weight: bold;
    color: var(--primary) !important;
    font-size: 1.5rem;
    text-decoration: none;
}

/* --- BANNIÈRE STYLE YOUTUBE --- */
.youtube-banner {
    width: 100%;
    height: var(--banner-height);
    margin-top: var(--nav-height); /* Espace pour la nav fixe */
    background-image: url('comment-creer-un-jeu-video.jpg'); /* Remplace par ton URL */
    background-size: cover 100%;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid #333;
}

/* --- LAYOUT PRINCIPAL --- */
.main-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
}

/* --- SIDEBAR (PC) --- */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 20px;
    border-right: 1px solid #333;
    background: var(--dark);
    
    /* Sticky : reste bloqué sous la bannière au scroll */
    position: sticky;
    top: var(--nav-height); 
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
}

.sidebar h3 {
    font-size: 1rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 20px;
}

/* --- SIDEBAR MENU --- */
.sidebar ul {
    list-style: none; /* Enlève les puces */
    padding: 0;       /* Enlève le décalage automatique à gauche */
    margin: 0;
}

.sidebar li {
    margin-bottom: 5px; /* Espace léger entre chaque lien du menu */
}

/* --- MENU LINKS --- */
.menu-link {
    color: #bbb;
    text-decoration: none;
    display: block;
    padding: 10px 0;
    transition: 0.2s;
    border-left: 3px solid transparent;
    list-style-type: none;
}

.menu-link:hover, .menu-link.active {
    color: white;
    border-left: 3px solid var(--primary);
    padding-left: 15px;
    background: rgba(255,255,255,0.05);
}

/* --- ZONE DE CONTENU & GRILLE --- */
main {
    flex-grow: 1;
    min-width: 0; /* Important pour éviter les bugs de débordement flex */
}

.grid-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 25px;
}

/* --- CARTES VIDÉOS --- */
article {
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, border 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
}

article:hover {
    transform: translateY(-5px);
    border: 1px solid var(--primary);
}

.thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.video-info {
    padding: 20px 15px;
    min-height: 90px;
    display: flex;
    align-items: center;
}

.video-info h3 {
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
    color: #eee;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Jusqu'à 3 lignes */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- BURGER MENU (MOBILE) --- */
.burger-label {
    display: none; /* Masqué sur PC */
    font-size: 2rem;
    color: white;
    cursor: pointer;
}



/* --- MEDIA QUERIES (TABLETTE & MOBILE) --- */
@media (max-width: 1100px) {
    .burger-label {
        display: block;
    }

    .youtube-banner {
        height: 120px; /* Plus petit sur mobile */
        background-size: cover;
    }

    .main-container {
        flex-direction: column;
    }

    .sidebar {
        display: none; /* Masqué par défaut */
        width: 100%;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        z-index: 999;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #333;
    }

    /* Affichage si checkbox cochée */
    #burger-check:checked ~ .main-container .sidebar {
        display: block;
    }

    .grid-videos {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
        padding: 15px;
    }
}