/*
Theme Name: Valeriane Theme
Author: Gemini
Description: Theme Custom avec Menu Déroulant
Version: 1.3
*/

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    color: #333;
    background: #fff;
    line-height: 1.6;
}

/* --- LE CONTENEUR --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- HEADER --- */
header {
    background: #fff;
    padding: 20px 0;
}

.site-title {
    margin: 0;
    font-size: 2.2rem;
    line-height: 1.2;
    text-align: center;
}

.site-title a {
    color: #3B82F6 !important; /* Force le BLEU */
    text-decoration: none !important;
    font-weight: 800 !important;      /* Force le GRAS */
}

.site-description {
    color: #666;
    margin-top: 5px;
    text-align: center;
}

/* --- NAVIGATION PRINCIPALE --- */
.main-navigation {
    background-color: #E68A2E;
    position: relative; /* Important pour le z-index global */
    z-index: 100;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

/* On cible l'élément parent (ex: Mes livres) */
.main-navigation ul li {
    position: relative; /* LE SECRET : Le sous-menu se positionnera par rapport à ce LI */
}

.main-navigation li a {
    display: block;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* --- LE SOUS-MENU (DROPDOWN) --- */
.main-navigation ul ul {
    display: none;            /* Caché par défaut */
    position: absolute;       /* Sort du flux pour se placer sous le parent */
    top: 100%;                /* Aligné exactement au bas du bouton parent */
    left: 0;                  /* Aligné au bord gauche du bouton parent */
    background-color: #D67A1E; /* Un orange légèrement plus foncé pour contraster */
    min-width: 220px;         /* Largeur minimale du panneau */
    flex-direction: column;   /* Empile les liens verticalement */
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 999;
}

/* Affichage au survol de l'élément parent */
.main-navigation ul li:hover > ul {
    display: flex;
}

/* Style des liens à l'intérieur du dropdown */
.main-navigation ul ul li a {
    padding: 12px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;      /* Empêche le titre du livre de revenir à la ligne */
}

.main-navigation ul ul li:last-child a {
    border-bottom: none;
}
}

/* --- ACTUS & LAYOUT --- */
.site-content {
    padding: 40px 0;
    min-height: 60vh;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}
.news-item h2 {
    font-size: 1.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
}
.news-image-wrapper {
    width: 100%;
    aspect-ratio: 1/1;
    background: #eee;
    margin-bottom: 10px;
}
.news-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-link {
    color: #3B82F6;
    font-weight: bold;
    text-decoration: underline;
}

/* --- FOOTER BLEU --- */
.site-footer {
    background: #548BF4; 
    color: white;
    padding: 40px 0;
    margin-top: 50px;
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* --- MOBILE --- */
@media (max-width: 768px) {
    .footer-widgets { grid-template-columns: 1fr; }
    
    /* Sur mobile, on affiche tout en vertical */
    .main-navigation ul { flex-direction: column; align-items: stretch; }
    .main-navigation ul ul { 
        position: static; /* Pas de flottement sur mobile */
        display: none;    /* Toujours caché sauf clic (natif WP gère mal le hover mobile) */
        background-color: rgba(0,0,0,0.05);
    }
    /* Petite astuce mobile : on affiche les sous-menus tout le temps ou au survol */
    .main-navigation li:hover > ul { display: flex; }
    
    .site-title a { font-size: 1.8rem; }
}