/* ==========================================================
 * ebook-livre.aepm.fr – feuille de style
 * Refonte 09/10/2026 (même principe que poèmes / citations) :
 * menu déroulant collé en haut, plus de colonne de gauche,
 * partenaires en pied de page, couleurs bleues du site
 * (#007BFF / #8EC5FC) gardées, avec des teintes plus foncées
 * pour le menu et les titres afin que le texte blanc reste lisible.
 * ========================================================== */
* { margin: 0; padding: 0; }
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1em;
    line-height: 1.6;
    background-color: #D5E3EA;
}

/* ---------- Menu du haut (commande/haut.php + js/menu.js) ---------- */
#menu_haut {
    width: 100%;
    background: linear-gradient(90deg, #0B3A86, #1E56B3); /* bleu foncé : texte blanc lisible */
    position: sticky;   /* le menu reste en haut de l'écran quand on descend */
    top: 0;
    z-index: 100;
}
#menu_haut .menu-inner {
    max-width: 1053px;
    margin: 0 auto;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
#menu_haut ul { list-style: none; }
#menu_haut .menu-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
#menu_haut .menu-links a,
#menu_haut .plus-btn,
#menu_haut .menu-toggle,
#menu_haut .btn-member {
    font-family: tahoma, sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 6px;
}
#menu_haut .menu-links a:hover,
#menu_haut .plus-btn:hover,
#menu_haut .menu-toggle:hover,
#menu_haut .btn-member:hover { background: rgba(255, 255, 255, 0.18); }
#menu_haut .menu-toggle { display: none; }
#menu_haut .menu-toggle svg,
#menu_haut .btn-member svg { width: 24px; height: 24px; display: block; }
#menu_haut .menu-toggle .icon-close { display: none; }
#menu_haut .btn-member { margin-left: auto; }
#menu_haut .menu-plus { position: relative; }
#menu_haut .plus-title { display: none; }
#menu_haut .plus-list {
    display: none;
    position: absolute;
    top: 46px;
    left: 0;
    z-index: 50;
    min-width: 230px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
    padding: 6px 0;
}
#menu_haut .menu-plus.plus-ouvert .plus-list { display: block; }
#menu_haut .plus-list a {
    color: #1e293b;
    display: block;
    min-height: 0;
    padding: 10px 18px;
    border-radius: 0;
    font-size: 14px;
}
#menu_haut .plus-list a:hover { background: #e3edfb; color: #0B3A86; }

@media (max-width: 768px) {
    #menu_haut .menu-inner { flex-wrap: wrap; padding: 4px 8px; }
    #menu_haut .menu-toggle { display: flex; }
    #menu_haut .btn-member { order: 2; }
    #menu_haut .menu-links {
        display: none;
        order: 3;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: calc(100% + 16px);
        margin: 4px -8px -4px;
        background: #fff;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    }
    #menu_haut.menu-ouvert .menu-links {
        display: flex;
        max-height: calc(100vh - 56px); /* la liste défile si elle est trop longue */
        overflow-y: auto;
    }
    #menu_haut.menu-ouvert .menu-toggle .icon-open { display: none; }
    #menu_haut.menu-ouvert .menu-toggle .icon-close { display: block; }
    #menu_haut .menu-links a {
        color: #1e293b;
        min-height: 50px;
        padding: 0 20px;
        border-radius: 0;
        border-bottom: 1px solid #e2e8f0;
        font-size: 16px;
    }
    #menu_haut .menu-links a:hover { background: #e3edfb; color: #0B3A86; }
    #menu_haut .plus-btn { display: none; }
    #menu_haut .plus-title {
        display: block;
        padding: 12px 20px 4px;
        font-family: tahoma, sans-serif;
        font-size: 12px;
        font-weight: bold;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #475569;
        background: #f8fafc;
    }
    #menu_haut .plus-list {
        display: block;
        position: static;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        min-width: 0;
        background: #f8fafc;
    }
}

/* ---------- Page ---------- */
main {
    background-color: white;
    width: 100%;
    max-width: 1053px;
    margin: auto;
    border-bottom: 1px solid #fff;
}
.bandeau { display: block; line-height: 0; }
.bandeau img { width: 100%; height: auto; max-height: 220px; object-fit: cover; display: block; }
main h1 {
    padding: 0.4rem 0.6rem;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(90deg, #174A9C, #2F6FD1);
}
main h2 { font-size: 1.1rem; margin: 0.6rem 0.4rem; }
main p { margin: 0.4rem; }
main a { font-weight: bold; color: #1E56B3; text-decoration: none; }
main a:hover { text-decoration: underline; }
main ul { margin: 0 10px 14px 0; }
main li { list-style: none; text-align: left; padding-left: 10px; }
.ptitre { margin: 0.4rem; font-size: 1.2rem; font-weight: bold; padding-top: 1.2rem; }
.voir-plus { text-align: right; }

/* Fil d'Ariane */
.breadcrumb { list-style: none; font-size: 0.8em; padding: 0; margin: 0; display: flex; flex-wrap: wrap; line-height: 1.2; }
.breadcrumb li { padding: 5px 0 5px 5px; }
.breadcrumb li + li::before { content: ">"; margin: 0 5px 0 2px; }
.breadcrumb a { color: #1E56B3; text-decoration: none; font-weight: normal; }
.breadcrumb a:hover { text-decoration: underline; }

#deuxcol { display: flex; flex-wrap: wrap; align-items: flex-start; }
#article { flex: 1; min-width: 0; padding: 0 10px; box-sizing: border-box; }
#texteunique h2 { margin: 0.4rem; }

/* ---------- Lettres et pages ---------- */
.pagenumero, .alpha {
    background-color: #f3f3f3;
    text-align: center;
    word-spacing: 0.5rem;
    padding: 0.5rem 0;
    border-radius: 6px;
    margin: 6px 0;
}
.pagenumero p, .alpha p { font-size: 0.9em; font-weight: bold; }
.pagenumero a, .alpha a { color: #1E56B3; text-decoration: none; font-weight: normal; }
.alpha a.actif { font-weight: bold; text-decoration: underline; }
.alpha .sous-lettres { font-size: 0.9em; margin-top: 4px; }
.alpha .sous-lettres a { display: inline-block; padding: 0 4px; }

/* ---------- Listes d'auteurs (vignettes centrées) ---------- */
.liste-noms {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 20px;
}
.box_aut_presentation {
    width: 240px;
    height: 50px;
    border: 1px solid #1E56B3;
    border-radius: 8px;
    background-color: white;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0 0 0 5px;
    box-sizing: border-box;
}
.box_aut_presentation:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); }
.photo-aut-mini { display: flex; align-items: center; }
.photo-aut-mini img { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.box_aut_presentation .text-container { margin-left: 6px; flex-grow: 1; line-height: 1.2; }
.box_aut_presentation .text-container a { color: #1e293b; }

/* ---------- Page d'un auteur ---------- */
.auteur-tete { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.auteur-tete img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; border: 2px solid #dbe6f5; }
.autres-sites { background: #f1f6fd; border-radius: 8px; padding: 4px 10px 8px; margin: 12px 0; }
.autres-sites ul { margin: 0; }

/* ---------- Recherche ---------- */
.form-recherche {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 480px;
    margin: 10px 0 20px;
    padding: 10px;
    border: 1px solid #1E56B3;
    border-radius: 6px;
    background: #f9f9f9;
}
.form-recherche input { flex: 1; min-width: 180px; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font: inherit; }
.form-recherche button { background: #1E56B3; color: #fff; border: 0; border-radius: 4px; padding: 8px 14px; cursor: pointer; font-weight: bold; }
.form-recherche button:hover { background: #0B3A86; }
.titre-resultats { font-size: 1.05rem; }
.resultat-item { margin-bottom: 14px; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.resultat-titre .de { color: #666; font-size: 0.9em; }
.resultat-extrait { color: #555; font-size: 0.9em; line-height: 1.4; }
.pagination-recherche { margin: 16px 0; text-align: center; line-height: 2.4; }
.pagination-recherche a, .pagination-recherche .page-actuelle {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    margin: 2px;
    font-size: 0.85em;
    border-radius: 3px;
    background: #eee;
    color: #333;
    font-weight: normal;
}
.pagination-recherche .page-actuelle { background: #1E56B3; color: #fff; font-weight: bold; }

/* ---------- 404 ---------- */
.image-404 img { max-width: 100%; height: auto; border: 5px solid white; border-radius: 6px; }

/* ---------- Publicité ---------- */
#pub, #encart-local {
    width: 95%;
    max-width: 750px;
    margin: 0.4rem auto;
    font-size: 0.6rem;
    text-align: center;
    border: 2px dashed #1E56B3;
    border-radius: 6px;
    background-color: #eee;
}
#pub img, #encart-local img {
    width: 99%;
    max-width: 720px;
    height: auto;
    max-height: 270px;
    object-fit: contain;
    background-color: white;
    margin: 0.5rem auto;
}

/* ---------- Partenaires institutionnels (cbdd/partenaires-pied.php) ---------- */
#partenaires-pied {
    max-width: 1053px;
    text-align: center;
    margin: 0 auto;
    padding: 15px 0;
    background-color: #f9f9f9;
}
#partenaires-pied p {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: bold;
}
#partenaires-pied2 { display: flex; justify-content: center; align-items: center; gap: 40px; flex-wrap: wrap; padding: 0 10px; }
#partenaires-pied2 img { height: 50px; width: auto; max-width: 100%; filter: grayscale(100%); opacity: 0.8; transition: all 0.3s ease; }
#partenaires-pied2 img:hover { filter: none; opacity: 1; }

/* ---------- Pied de page ---------- */
#mentions, #reseau {
    background-color: #ddd;
    font-size: 0.8rem;
    padding: 0.4rem;
    margin: 0 auto;
    max-width: 1053px;
    text-align: center;
}
#mentions span a, #reseau span a { font-family: tahoma, sans-serif; font-weight: bold; color: #174A9C; text-decoration: none; }
footer {
    margin: 0 auto;
    padding-top: 1rem;
    max-width: 1053px;
    height: 4rem;
    background-color: #5C5E5F;
    font-size: 0.6rem;
    color: #C8C6C6;
    text-align: center;
}
.clearthis { clear: both; }

/* ---------- Formulaire de contact (contact.php) ---------- */
.contact-note { background: #f1f6fd; border-left: 4px solid #1E56B3; border-radius: 6px; padding: 8px 12px; margin: 10px 0; }
.contact-erreurs { background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 8px 12px; margin: 10px 0; }
.contact-erreurs ul { margin: 0; }
.contact-erreurs li { padding-left: 0; }
.contact-ok { background: #dcfce7; color: #166534; font-weight: bold; border-radius: 6px; padding: 10px 12px; margin: 10px 0; }
.form-contact {
    background: #f9f9f9;
    border: 1px solid #1E56B3;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    max-width: 640px;
}
.form-contact label { font-weight: bold; display: block; margin: 10px 0 4px; }
.form-contact input[type="text"],
.form-contact input[type="email"],
.form-contact textarea {
    width: 100%;
    padding: 9px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font: inherit;
}
.form-contact button {
    margin-top: 14px;
    background-color: #1E56B3;
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
}
.form-contact button:hover { background-color: #0B3A86; }

/* ---------- Petits écrans ---------- */
@media (max-width: 768px) {
    .logo-visuel { height: 100px; }
}
@media (max-width: 480px) {
    .logo-visuel { height: 80px; }
    .grille-images { grid-template-columns: repeat(2, 1fr); }
    .box_aut_presentation { width: 100%; }
}

/* ---------- Grille de livres ---------- */
.grille-livres {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 14px;
    margin: 12px 0 18px;
}
.carte-livre {
    display: flex;
    flex-direction: column;
    border: 1px solid #8EC5FC;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.carte-livre:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16); }
.carte-couv { display: flex; align-items: center; justify-content: center; background: #f1f6fd; aspect-ratio: 2 / 3; }
.carte-couv img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sans-couv { font-size: 3rem; }
.carte-texte { padding: 6px 8px 8px; line-height: 1.3; display: flex; flex-direction: column; gap: 3px; }
.carte-titre { color: #1e293b; font-size: 0.95em; }
.carte-auteur { font-size: 0.85em; color: #555; }
.carte-auteur a { font-weight: normal; color: #174A9C; }
.badge { display: inline-block; font-size: 0.72em; font-weight: bold; padding: 1px 6px; border-radius: 3px; margin: 1px 2px 0 0; }
.badge-papier { background: #fff3cd; color: #856404; }
.badge-numerique { background: #d1ecf1; color: #0c5460; }
.badge-audio { background: #d4edda; color: #155724; }
.compte { color: #555; font-size: 0.9em; }

/* ---------- Page d'un livre ---------- */
.livre-fiche { display: flex; flex-wrap: wrap; gap: 18px; margin: 6px 0 12px; }
.livre-couv { flex: 0 0 260px; max-width: 100%; }
.livre-couv img { width: 100%; height: auto; display: block; border: 1px solid #1E56B3; border-radius: 6px; }
.livre-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.livre-photos a { flex: 0 0 60px; }
.livre-photos img { width: 60px; height: 60px; object-fit: cover; border: 1px solid #ccc; border-radius: 4px; }
.livre-infos { flex: 1; min-width: 220px; }
.livre-infos dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 4px 0.4rem 10px; }
.livre-infos dt { color: #555; }
.livre-infos dd { font-weight: bold; }
.livre-description { margin: 8px 0 14px; }
.livre-maj { color: #666; font-size: 0.85em; }

/* Vendeurs */
.vendeurs { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0.4rem 14px; }
.vendeur {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border: 1px solid #8EC5FC;
    border-radius: 24px;
    background: #f1f6fd;
}
.vendeur img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* Accueil */
.liens-accueil { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.liens-accueil li { padding: 0; }
.liens-accueil a { display: inline-block; padding: 6px 12px; border: 1px solid #1E56B3; border-radius: 16px; font-size: 0.95em; }
.liens-accueil a:hover { background: #e3edfb; text-decoration: none; }

/* Catégories */
.liste-categories { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }
.liste-categories li { padding: 0; }
.liste-categories a { display: inline-block; padding: 6px 14px; border: 1px solid #1E56B3; border-radius: 16px; }
.liste-categories a:hover { background: #e3edfb; text-decoration: none; }
.liste-categories small { color: #555; font-weight: normal; }

/* ===== Logos des catégories (09/10/2026) ===== */
.grille-categories { list-style: none; margin: 14px 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
.grille-categories li { padding: 0; margin: 0; }
.grille-categories a { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; box-sizing: border-box; padding: 16px 10px 14px; border: 1px solid #cfdcf3; border-radius: 10px; background: #f5f8fe; color: #1E56B3; text-align: center; text-decoration: none; transition: background .15s, border-color .15s; }
.grille-categories a:hover, .grille-categories a:focus { background: #e3edfb; border-color: #1E56B3; text-decoration: none; }
.rond-cat { display: flex; align-items: center; justify-content: center; width: 66px; height: 66px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #dbe5f7; }
.rond-cat .icone-cat { width: 44px; height: 44px; }
.nom-cat { color: #222; font-weight: bold; font-size: .95em; line-height: 1.25; }
.nb-cat { color: #666; font-size: .85em; }
.icone-cat-mini { width: 1.25em; height: 1.25em; vertical-align: -.25em; margin-right: 4px; }
.lien-cat { white-space: nowrap; }
.h1-cat .icone-cat-titre { width: 1.3em; height: 1.3em; vertical-align: -.28em; margin-right: 8px; }
@media (max-width: 480px) {
  .grille-categories { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .rond-cat { width: 56px; height: 56px; }
  .rond-cat .icone-cat { width: 38px; height: 38px; }
  .lien-cat { white-space: normal; }
}

/* ===== Proposer un livre (09/10/2026) ===== */
.encadre-proposer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0; padding: 14px 18px; background: #f1f6fd; border: 1px solid #cfdcf3; border-left: 5px solid #1E56B3; border-radius: 8px; }
.encadre-proposer p { margin: 0; }
.bouton-proposer, .solution-lien { display: inline-block; background: #1E56B3; color: #fff !important; padding: 9px 16px; border-radius: 6px; font-weight: bold; text-decoration: none; }
.bouton-proposer:hover, .solution-lien:hover { background: #0B3A86; text-decoration: none; }
.deux-solutions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0 20px; }
.solution { background: #f5f8fe; border: 1px solid #cfdcf3; border-radius: 10px; padding: 14px 16px; }
.solution p { margin: 6px 0; }
.solution-titre { font-weight: bold; font-size: 1.1em; color: #1E56B3; }
.solution-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #1E56B3; color: #fff; margin-right: 6px; font-size: .9em; }
.form-contact fieldset.choix-qui { border: 1px solid #cfdcf3; border-radius: 6px; padding: 8px 12px; margin: 10px 0; }
.form-contact fieldset.choix-qui legend { font-weight: bold; padding: 0 4px; }
.form-contact label.radio, .form-contact label.case { font-weight: normal; display: block; margin: 6px 0; }
.form-contact label small { font-weight: normal; color: #555; }
.partager-livre { margin: 16px 0 6px; color: #444; }
@media (max-width: 700px) { .deux-solutions { grid-template-columns: 1fr; } }
