/* ============================================================
   DESIGN NAVIGATION - SPÉCIAL METISMENU (JOOMLA 6)
   ============================================================ */

/* --- 1. BARRE DE NAVIGATION (HEADER) --- */
.container-header {
    background-color: #1a237e !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.3);
}

/* --- 2. LIENS PRINCIPAUX (NIVEAU 1) --- */
.metismenu-item > a {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    text-transform: uppercase;
    padding: 0.8rem 1.2rem !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.metismenu-item.active > a, 
.metismenu-item > a:hover {
    color: #ffca28 !important;
    border-bottom: 3px solid #ffca28;
}

/* --- 3. GESTION DU SURVOL SUR DESKTOP (Min 992px) --- */
@media (min-width: 992px) {
    /* On positionne le parent en relatif pour que le menu enfant se cale dessous */
    .metismenu-item {
        position: relative;
    }

    /* On force l'affichage du sous-menu (mm-collapse) au survol */
    .metismenu-item:hover > .mm-collapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: absolute; /* Flotte au-dessus du contenu */
        top: 100%;
        left: 0;
        background: #ffffff !important;
        min-width: 260px;
        z-index: 1000;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        border-top: 4px solid #ffca28;
        padding: 10px 0;
        animation: fadeInMenu 0.3s ease;
    }

    /* LE PONT INVISIBLE : Zone de 20px pour éviter la fermeture au mouvement */
    .metismenu-item:hover > .mm-collapse::before {
        content: "";
        position: absolute;
        top: -20px;
        left: 0;
        right: 0;
        height: 20px;
        display: block;
    }

    /* Cache le bouton (+) de MetisMenu sur Desktop car inutile au survol */
    .metismenu-item .mm-toggler {
        display: none !important;
    }
}

/* --- 4. STYLE DES LIENS DANS LE SOUS-MENU --- */
.mm-collapse .metismenu-item a {
    color: #1a237e !important;
    padding: 0.7rem 1.5rem !important;
    border-bottom: 1px solid #f1f1f1 !important;
    display: block !important;
    text-transform: none !important;
    font-weight: 400;
    width: 100%;
    border-left: 0px solid transparent;
}

.mm-collapse .metismenu-item:last-child a {
    border-bottom: none !important;
}

.mm-collapse .metismenu-item a:hover {
    background-color: #f8f9fa !important;
    color: #8b0000 !important;
    padding-left: 2rem !important;
    border-left: 4px solid #8b0000;
}

/* --- 5. ANIMATION ET ADAPTATION MOBILE --- */
@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    .metismenu-item > a {
        border-bottom: none !important;
    }
    /* Sur mobile, on laisse MetisMenu gérer le clic normalement */
    .mm-collapse {
        position: static;
        box-shadow: none;
    }
}



/* ============================================================
   3. CADRE SACRÉ (PHOTO DU VÉNÉRABLE)
   ============================================================ */
.portrait-frame, .portrait-wrapper {
    margin: 20px auto;
    border: 2px solid #fff5e6; /* Nacre */
    outline: 5px solid #bf9b30; /* Or riche */
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5), 0 10px 30px rgba(0,0,0,0.4);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.5s ease;
}

.portrait-frame:hover {
    outline-color: #ffd700;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.7), 0 15px 40px rgba(0,0,0,0.5);
    transform: translateY(-5px);
}

.portrait-frame img {
    transition: transform 0.6s ease;
}

.portrait-frame:hover img {
    transform: scale(1.05);
}

/* ============================================================
   4. AJUSTEMENTS RESPONSIVE (MOBILE)
   ============================================================ */
/* --- 6. ADAPTATION MOBILE (Tablettes et Smartphones) --- */
@media (max-width: 991px) {
    /* Style des liens du menu mobile */
    .navbar-nav .nav-link {
        border-bottom: none !important; /* Supprime la ligne horizontale du desktop */
        border-left: 4px solid transparent; /* Prépare la ligne verticale à gauche */
        padding: 0.8rem 1rem !important;
        transition: all 0.3s ease;
    }

    /* Indicateur visuel pour la page active en mobile */
    .navbar-nav .active > .nav-link,
    .navbar-nav .nav-link:hover {
        border-left: 4px solid #ffca28 !important; /* Ligne jaune à gauche */
        background-color: rgba(255, 255, 255, 0.05); /* Léger fond pour le clic */
    }

    /* Ajustement des images de carrousel pour petit écran */
    #carouselMigration img, 
    #carouselHome img {
        height: 250px !important;
        object-fit: cover; /* Évite de déformer l'image malgré la hauteur forcée */
    }
}

/*Survol sur une image, effet zoom */
/* Seules les images à l'intérieur d'un lien 'hover-zoom' bougeront */
.hover-zoom-sb:hover img {
    transform: scale(1.05); /* Agrandissement de 5% */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2); /* Ajoute une ombre pour donner du relief */
}

.hover-zoom-sb img {
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Pour que le mouvement soit fluide */
}

/* Conteneur principal pour Thong Tin */
.thong-tin-box {
    background-color: #e9eff5; /* Fond gris très clair */
    border: 1px solid #b8c9d9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    font-family: Arial, sans-serif;
}

/* En-tête avec dégradé bleu */
.thong-tin-header {
    background: linear-gradient(to bottom, #9dc2e5 0%, #70a1d7 100%);
    color: #000;
    text-align: center;
    padding: 15px 5px;
    font-size: 24px;
    font-weight: bold;
    border-bottom: 1px solid #b8c9d9;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.5);
}

/* Style de la liste */
.thong-tin-list {
    list-style: none;
    padding: 15px;
    margin: 0;
}

.thong-tin-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Création des puces bleues personnalisées */
.thong-tin-list li::before {
    content: "●";
    color: #4a7ebb;
    font-size: 18px;
    position: absolute;
    left: 0;
    top: -2px;
}

/* Style des liens */
.thong-tin-list li a {
    color: #4a7ebb;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.thong-tin-list li a:hover {
    color: #2a4d7d;
    text-decoration: underline;
}

/* ============================================================
   DESIGN HARMONISÉ COLONNE DROITE (SIDEBAR)
   ============================================================ */

/* Conteneur identique à Thong Tin */
.sidebar-nav-block {
    background-color: #e9eff5; /* Fond gris bleu clair */
    border: 1px solid #b8c9d9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    font-family: Arial, sans-serif;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.05);
}

/* En-tête avec dégradé bleu identique */
.sidebar-nav-header {
    background: linear-gradient(to bottom, #9dc2e5 0%, #70a1d7 100%);
    color: #000;
    text-align: center;
    padding: 12px 5px;
    font-size: 18px; /* Un peu plus petit pour les blocs secondaires */
    font-weight: bold;
    border-bottom: 1px solid #b8c9d9;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.5);
    text-transform: uppercase;
}

/* Liste de liens */
.sidebar-nav-list {
    list-style: none;
    padding: 10px 15px;
    margin: 0;
}

.sidebar-nav-list li {
    position: relative;
    padding-left: 25px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(184, 201, 217, 0.3);
    line-height: 1.4;
}

.sidebar-nav-list li:last-child {
    border-bottom: none;
}

/* Puce point bleu identique */
.sidebar-nav-list li::before {
    content: "●";
    color: #4a7ebb;
    font-size: 16px;
    position: absolute;
    left: 0;
    top: 6px;
}

/* Style des liens */
.sidebar-nav-list li a {
    color: #4a7ebb;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sidebar-nav-list li a:hover {
    color: #8b0000; /* Rouge au survol pour attirer l'attention */
    text-decoration: underline;
}

/* Optionnel : Style spécial pour Amazon (en orange) */
.sidebar-nav-list li a.link-amazon:hover {
    color: #ff9900;
}


/* Bloc de compteur de visite */
/* Style harmonisé pour le compteur JO Visitor Counter */
.mod_jovisitorcounter { 
    background-color: #e9eff5 !important; /* Même fond gris clair que Thông Tin */
    border: 1px solid #b8c9d9 !important;
    border-radius: 10px;
    padding: 0 !important; /* On enlève le padding pour que le header touche les bords */
    overflow: hidden;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}

/* On crée un bandeau de titre pour le compteur comme pour Thông Tin */
.mod_jovisitorcounter::before {
    content: "Statistiques";
    display: block;
    background: linear-gradient(to bottom, #9dc2e5 0%, #70a1d7 100%);
    color: #000;
    text-align: center;
    padding: 10px 5px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #b8c9d9;
}

/* Style des lignes de statistiques à l'intérieur */
.mod_jovisitorcounter .jo-visitor-counter-item, 
.mod_jovisitorcounter ul, 
.mod_jovisitorcounter li {
    list-style: none;
    padding: 8px 15px !important;
    margin: 0;
    color: #4a7ebb;
    font-weight: bold;
    border-bottom: 1px solid #dee2e6;
}

/* On enlève la bordure sur la dernière ligne */
.mod_jovisitorcounter li:last-child {
    border-bottom: none;
}


/*Style pour afficher des livres */
<style>
  /* Conteneur global */
  .collection-container {
    max-width: 1020px;
    margin: 20px auto !important;
    display: flex !important;
    flex-direction: column !important; /* Aligne les éléments verticalement */
    align-items: center !important;    /* Centre horizontalement tous les enfants directs */
    justify-content: center !important;
    text-align: center !important;
  }

  /* Rectangle Titre */
  .main-title-box {
    /* --- Gardez vos styles de design (couleurs, bordures, etc.) --- */
    background: linear-gradient(to bottom, #4a322d, #63463e, #4a322d);
    color: #f1d3a1; 
    padding: 15px 30px;
    border: 2px solid #8d7561;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);

    /* --- LES 3 LIGNES POUR LE CENTRAGE DIRECT --- */
    display: table !important;      /* Se comporte comme un bloc mais s'ajuste au texte */
    margin-left: auto !important;   /* Pousse à gauche */
    margin-right: auto !important;  /* Pousse à droite */
    
    /* Optionnel : pour l'espacement avec les livres */
    margin-bottom: 50px;
}

  /* Grille réactive */
  .books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    padding: 20px;
    perspective: 1500px;
  }

  /* Conteneur individuel du livre */
  .book-item {
    width: 190px;
    height: 300px;
    margin: 0 auto;
    text-decoration: none;
    display: block;
    position: relative;
  }

  /* La carte qui pivote */
  .book-card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    transform-origin: left center;
  }

  /* Effet d'ouverture au survol */
  .book-item:hover .book-card {
    transform: rotateY(-135deg);
  }

  /* Faces du livre */
  .book-front, .book-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 3px 8px 8px 3px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
  }

  /* Couverture (Avant) */
  .book-front {
    background: #800000;
    z-index: 2;
  }

  .book-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px 8px 8px 3px;
    display: block;
  }

  /* Intérieur */
  .book-back {
    background: #fff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    padding: 15px;
    box-sizing: border-box;
    background-image: linear-gradient(90deg, #e0e0e0 0%, #ffffff 15%);
  }

  .book-back span {
    color: #800000;
    font-weight: bold;
    font-size: 0.9rem;
  }

  /* Ombre portée */
  .book-item::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 5%;
    width: 90%;
    height: 10px;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    filter: blur(5px);
    z-index: -1;
  }
</style>