/* Importation de la police */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400&display=swap');

/* ============================================
   STYLES GÉNÉRAUX
   ============================================ */

body {
    background-color: white;
    font-family: 'Quicksand', 'Calibri', 'Garamond', 'Arial', sans-serif;
    width: 100%;
    max-width: 1200px;
    margin: auto;
    margin-top: 20px;
    margin-bottom: 20px;
    overflow-x: hidden;
    line-height: 1.6;
}

p {
    text-align: justify;
}

h1 {
    text-align: center;
    color: black;
}

h2 {
    text-align: left;
    color: black;
}

a {
    color: black;
    text-decoration: none;
}

/* ============================================
   HEADER
   ============================================ */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    background-color: gray;
    top: 0;
    z-index: 1000;
    border-radius: 15px 15px 0 0;
    position: relative;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hidden-header {
    opacity: 0;
    transform: translateY(-100%);
}

/* ============================================
   LOGO
   ============================================ */

#logo {
    display: block;
    width: 100%;
    height: auto;
    max-width: 1200px;
    margin-bottom: 1px;
}

.logo {
    max-height: 180px;
    margin-left: 60px;
    margin-top: 40px;
    margin-right: 80px;
    order: 1;
}

/* ============================================
   NAVIGATION
   ============================================ */

nav {
    position: sticky;
    top: 0;
    background-color: gray;
    padding: 10px 0;
    z-index: 1000;
    border-radius: 0 0 15px 15px;
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    background-color: gray;
    border-radius: 0 0 15px 15px;
}

nav ul li {
    position: relative;
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: black;
    padding: 10px 20px;
    line-height: 1.5;
    display: block;
}

/* Sous-menus */
nav ul li .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: dimgray;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    text-align: left;
}

nav ul li:hover .submenu {
    display: block;
}

nav ul li .submenu li {
    width: 200px;
}

/* Menu burger (caché pour ordinateur) */
.menu-burger {
    display: none;
    font-size: 2em;
    cursor: pointer;
}

/* ============================================
   TABLE DES MATIÈRES
   ============================================ */

/* Liste principale — sans puces, interligne constant */
.genres-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Chaque entrée a une hauteur minimale fixe pour garder
   l'interligne constant à l'état plié */
.genres-list > li {
    margin: 0;
    padding: 0;
    cursor: pointer;
    position: relative;
    min-height: 2em;        /* hauteur minimale = 1 ligne */
    line-height: 2em;       /* interligne constant entre les noms */
}

/* Titres h3 — interligne serré et constant, même graisse pour tous */
.genres-list > li > h3 {
    margin: 0;
    padding: 0;
    line-height: 2em;
    font-size: 1.0em;
    font-weight: normal;    /* même graisse que les synonymes */
    color: black;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.genres-list > li > h3:hover {
    color: #555;
}

/* Synonymes sur leur propre ligne (pas dans un <li>) */
.genres-list > h3 {
    margin: 0;
    padding: 0;
    line-height: 2em;
    font-size: 1.0em;
    color: black;
    font-weight: normal;
}

/* Zone des détails (cachée par défaut) */
.details {
    display: none;
    margin-top: 5px;
    margin-bottom: 10px;
    padding-left: 20px;
    border-radius: 5px;
    font-size: 1em;
    line-height: 1.6;       /* interligne normal dans les détails */
}

/* Liste des livres AVEC puces */
.livres-list {
    list-style-type: disc;
    padding-left: 20px;
    margin: 0;
}

.livres-list li {
    margin: 4px 0;
    padding: 0;
    cursor: default;
    display: flex;
    align-items: baseline;
    line-height: 1.6;
}

/* Titres des livres en bleu sombre */
.livres-list li strong {
    display: inline-block;
    min-width: 350px;
    color: #1a3a6b;         /* bleu sombre, distinct du bleu des synonymes */
    font-weight: bold;
}

/* Le lien vers resume.html hérite de l'aspect du titre de livre */
.livres-list li strong a {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.livres-list li strong a:hover {
    text-decoration: underline;
}

/* Numéros de page en noir normal */
.page-number {
    display: inline-block;
    text-align: left;
    color: black;
    font-weight: normal;
}

/* ============================================
   EXPOSANTS ET NOTES DE BAS DE PAGE
   ============================================ */

/* Exposant à côté du nom */
.note-ref {
    font-size: 0.7em;
    vertical-align: super;
    color: black;
    font-weight: bold;
    margin-left: 2px;
    cursor: help;
}

/* Barre de notes de bas de page — toujours visible en bas de page */
#footnotes-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1200px;
    background-color: #f8f8f8;
    border-top: 2px solid #ccc;
    padding: 6px 20px;
    font-size: 0.85em;
    color: #333;
    z-index: 2000;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
}

#footnotes-bar span {
    white-space: nowrap;
}

#footnotes-bar .note-num {
    font-size: 0.75em;
    vertical-align: super;
    color: black;
    font-weight: bold;
    margin-right: 2px;
}

/* Marge en bas du contenu pour ne pas être caché par la barre */
main {
    padding-bottom: 50px;
}

/* ============================================
   IMAGES ET FIGURES
   ============================================ */

figure {
    display: block;
    text-align: center;
    margin: 20px 0;
    float: right;
    width: 40%;
    margin-left: 20px;
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
}

figcaption {
    font-size: 0.9em;
    color: #555;
    margin-top: 10px;
    text-align: center;
}

.image-petite {
    float: right;
    max-width: 60%;
    height: auto;
    margin-left: 20px;
    margin-right: 50px;
}

.image-gauche {
    float: left;
    max-width: 100%;
    height: auto;
    margin-right: 20px;
    margin-left: 20px;
}

/* ============================================
   GRILLES D'IMAGES
   ============================================ */

.grille-couvertures {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.grille-couvertures img {
    width: 120px;
    height: 180px;
    object-fit: cover;
}

.grille-resumes {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 10px;
}

.grille-resumes img {
    width: 120px;
    height: 180px;
    object-fit: cover;
}

/* ============================================
   CARTES
   ============================================ */

.cards-section {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin: 40px 0;
}

.card {
    width: 20%;
    min-width: 250px;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    text-align: center;
    overflow: hidden;
    transition: transform 0.3s ease;
    margin: 5px;
}

.card:hover {
    transform: translateY(-10px);
}

.card img {
    width: 100%;
    height: auto;
}

.card h3 {
    margin: 15px 0;
    font-size: 1.5em;
}

.card p {
    padding: 0 15px 20px;
    text-align: center;
}

/* ============================================
   CONTENEURS
   ============================================ */

.container {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    align-items: flex-start;
    width: 100%;
}

.content {
    width: 50%;
    padding-right: 20px;
    overflow: auto;
}

.encadre {
    width: 50%;
    background-color: #f9f9f9;
    border: 2px solid #ddd;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 8px;
}

.encadre_2 {
    width: 100%;
    background-color: #e0e0e0;
    border: 2px solid #ddd;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 8px;
}

/* ============================================
   FOOTER / PLAN DU SITE
   ============================================ */

footer.sitemap {
    background-color: rgba(128, 128, 128, 0.5);
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}

footer.sitemap ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

footer.sitemap ul li {
    margin: 10px 20px;
    position: relative;
}

footer.sitemap ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

footer.sitemap ul li a:hover {
    text-decoration: underline;
}

footer.sitemap ul li .submenu {
    display: none;
    list-style-type: none;
    padding: 0;
    margin: 10px 0 0;
}

footer.sitemap ul li:hover .submenu {
    display: block;
}

footer.sitemap ul li .submenu li {
    margin-top: 5px;
}

footer.sitemap ul li .submenu li a {
    font-weight: normal;
    color: #555;
}

footer p {
    text-align: center;
}

/* ============================================
   DIVERS
   ============================================ */

.indente {
    padding-left: 40px;
}

#copyright {
    padding: 2px;
    padding-left: 0px;
    margin-top: 5px;
    color: black;
    font-size: 0.8em;
    border-top: none;
    text-align: center;
}

/* ============================================
   NAVIGATION ALPHABÉTIQUE
   ============================================ */

.alphabet-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: 15px 0;
    margin: 20px 0;
    border-top: 2px solid #ddd;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 100;
}

.alphabet-nav a {
    color: #333;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    padding: 5px 15px;
    transition: all 0.3s ease;
}

.alphabet-nav a:hover {
    color: #fff;
    background-color: #555;
    border-radius: 5px;
}

/* Synonyme affiché sur la même ligne que le nom */
.synonyme-inline {
    margin-left: 15px;
    font-size: 0.9em;
    font-style: italic;
    color: #555;
}

.synonyme-inline a {
    color: #0066cc;
    text-decoration: none;
}

.synonyme-inline a:hover {
    text-decoration: underline;
}

/* ============================================
   CORRECTION SCROLL ET HIGHLIGHT
   ============================================ */

html {
    scroll-padding-top: 100px;
}

.highlight {
    background-color: #fff3cd;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.highlight-fade {
    background-color: transparent;
    box-shadow: none;
}

/* Contact dans la barre de notes */
.note-contact {
    margin-left: auto;
    font-size: 0.8em;
    color: #666;
    font-style: italic;
}

.note-contact a {
    color: #1a3a6b;
    text-decoration: none;
}

.note-contact a:hover {
    text-decoration: underline;
}

/* ── Sélecteur de langue ───────────────────────────────────────────────────── */
.selecteur-langue {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 6px 0;
  margin-bottom: 8px;
}

.lang-btn {
  padding: 3px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: white;
  color: #555;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
}

.lang-btn:hover {
  border-color: #1a3a6b;
  color: #1a3a6b;
}

.lang-btn-actif {
  background: #1a3a6b !important;
  color: white !important;
  border-color: #1a3a6b !important;
}

/* ── Pied de page crédit + inscription ─────────────────────────────────────── */
#pied-page {
    text-align: center;
    padding: 12px 24px;
    font-size: 0.82rem;
    color: #7a7672;
    border-top: 1px solid #ddd9cf;
    margin-top: 16px;
}

#pied-page a {
    color: var(--accent, #2a5fa5);
    text-decoration: underline;
}

.pied-separateur {
    margin: 0 8px;
    color: #ccc;
}
