/* ==========================================================
 * timbrophilie.aepm.fr – feuille de style
 * Refonte 14/10/2026 (même principe qu'ebook-livre / poèmes) :
 * menu déroulant collé en haut, plus de colonne de gauche,
 * partenaires en pied de page, couleurs bordeaux du site
 * (#BD164C) 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, #7E0D33, #BD164C); /* bordeaux du site : 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: #fbe4ea; color: #6E0B2C; }

@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: #fbe4ea; color: #6E0B2C; }
    #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, #85102F, #C2185B);
}
main h2 { font-size: 1.1rem; margin: 0.6rem 0.4rem; }
main p { margin: 0.4rem; }
main a { font-weight: bold; color: #9E1240; 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: #9E1240; 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: #9E1240; 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 #9E1240;
    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 #f3d9e0; }
.autres-sites { background: #fdf1f4; 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 #9E1240;
    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: #9E1240; color: #fff; border: 0; border-radius: 4px; padding: 8px 14px; cursor: pointer; font-weight: bold; }
.form-recherche button:hover { background: #6E0B2C; }
.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: #9E1240; 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 #9E1240;
    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: #85102F; 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: #fdf1f4; border-left: 4px solid #9E1240; 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 #9E1240;
    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: #9E1240;
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
}
.form-contact button:hover { background-color: #6E0B2C; }

/* ---------- 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 timbres (outils.php : tp_grille_timbres) ---------- */
.grille-timbres {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 10px 0 16px;
}
.carte-timbre {
    background: #fff;
    border: 1px solid #f1c9d4;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.carte-timbre:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); }
.carte-image {
    display: flex; align-items: center; justify-content: center;
    height: 150px; padding: 8px; box-sizing: border-box;
    background: #fdf1f4;
}
.carte-image img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.sans-image { font-size: 3rem; color: #c9a3ae; }
.carte-texte { padding: 6px 8px 8px; line-height: 1.3; display: flex; flex-direction: column; gap: 2px; }
.carte-ref { font-size: 0.78em; color: #666; }
.carte-nom { color: #1e293b; font-size: 0.9em; }
.compte { color: #555; font-size: 0.9em; }

/* ---------- 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 #9E1240; border-radius: 20px; }
.liens-accueil a:hover { background: #fbe4ea; text-decoration: none; }

/* ---------- Pays émetteurs ---------- */
.liste-pays {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 6px 14px;
    margin: 10px 0 16px;
}
.liste-pays li { padding: 0; }
.liste-pays a { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.liste-pays a:hover { background: #fdf1f4; text-decoration: none; }
.liste-pays img { width: 32px; height: auto; border: 1px solid #000; flex: none; }
.liste-pays .sans-drapeau { width: 32px; flex: none; }
.liste-pays small { color: #666; font-weight: normal; }
.valeurs-faciales { font-size: 0.9em; }

/* ---------- Séries ---------- */
.liste-series li { padding: 4px 6px; border-bottom: 1px solid #f3d9e0; }
.liste-series .date-serie { display: inline-block; min-width: 9em; color: #666; font-size: 0.85em; }

/* ---------- Fiche d'un timbre / d'une série ---------- */
.fiche-timbre { display: flex; flex-wrap: wrap; gap: 18px; margin: 6px 0 12px; align-items: flex-start; }
.fiche-images { flex: 0 1 320px; max-width: 100%; display: flex; flex-direction: column; gap: 10px; }
.fiche-images figure { margin: 0; text-align: center; }
.fiche-images img { max-width: 100%; height: auto; display: inline-block; border: 1px solid #f1c9d4; border-radius: 4px; background: #fff; }
.fiche-images figcaption { font-size: 0.8em; color: #666; }
.fiche-infos { flex: 1; min-width: 240px; }
.fiche-infos dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0.4rem; }
.fiche-infos dt { color: #666; font-style: italic; }
.fiche-infos dd { margin: 0; }
.fiche-description { margin: 8px 0 14px; }
.en-vente { background: #fdf1f4; border-left: 4px solid #9E1240; border-radius: 6px; padding: 6px 10px; margin: 10px 0.4rem; }
.timbre-utilise { margin: 10px 0.4rem; }

@media (max-width: 480px) {
    .grille-timbres { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .carte-image { height: 120px; }
    .fiche-infos dl { grid-template-columns: 1fr; gap: 0; }
    .fiche-infos dd { margin-bottom: 6px; }
}
.box_aut_presentation .nb { display: block; font-size: 0.8em; color: #666; font-weight: normal; }
#reseau .partenaire { display: block; margin-top: 4px; }
@media (max-width: 480px) {
    .fiche-images img { max-height: 300px; width: auto; }
}
