/* ------------------------------------
   BIBLIOGRAPHIE & NOTES
------------------------------------- */
#biblio, #footnotes {
  font-size: 0.9em;
  color: #444;
  line-height: 1.4;
  margin-top: 1.5em;
  text-align: justify;
}

#biblio h2, #footnotes h2 {
  font-size: 1em;
  font-weight: bold;
  margin-bottom: 0.6em;
  text-align: left;
}

/* ------------------------------------
   TITRE DE L’ARTICLE
------------------------------------- */
.main-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #222;
  line-height: 1.2;
}

/* ------------------------------------
   MÉTADONNÉES (auteur, pages, numéro…)
------------------------------------- */
.main-content section.ltr,
.main-content section.rtl {
  background-color: #f7f7f7;
  padding: 16px;
  border-radius: 4px;
  margin-bottom: 24px;
}

.main-content section.ltr div,
.main-content section.rtl div {
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.4;
}

.main-content section div span {
  color: #666;
  font-style: italic;
  margin-left: 6px;
}

.main-content section div strong {
  font-weight: 600;
  color: #333;
}

/* Direction LTR vs RTL */
.main-content section.ltr { direction: ltr; text-align: left; }
.main-content section.rtl { direction: rtl; text-align: right; }

/* ------------------------------------
   CONTENU DE L’ARTICLE
------------------------------------- */
.main-content article {
  margin-top: 20px;
  font-size: 1rem;
  line-height: 1.7;
  color: #333;
  word-break: break-word;
}

.main-content article p {
  text-align: justify;
  margin-bottom: 1em;
}

.main-content article h2,
.main-content article h3 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-weight: 600;
  color: #222;
  line-height: 1.3;
}

.main-content article h2 { font-size: 1.5rem; }
.main-content article h3 { font-size: 1.3rem; }

.main-content article ul,
.main-content article ol {
  margin: 1em 0 1em 1.4em;
  color: #333;
}

.main-content article ul li,
.main-content article ol li {
  margin-bottom: 0.5em;
}

.main-content article blockquote {
  margin: 1.5em 0;
  padding: 12px 16px;
  border-left: 4px solid #ccc;
  background-color: #f5f5f5;
  color: #555;
  font-style: italic;
}

.main-content article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 4px;
}

.main-content article a {
  color: #0066cc;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.main-content article a:hover {
  color: #004a99;
}

/* ------------------------------------
   RESPONSIVE <= 600px (Mobile)
------------------------------------- */
@media (max-width: 600px) {
  .main-content h1 {
    font-size: 1.6rem;
    margin-bottom: 16px;
  }

  .main-content section.ltr,
  .main-content section.rtl {
    padding: 12px;
    margin-bottom: 20px;
  }

  .main-content section div {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .main-content article {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .main-content article h2 { font-size: 1.4rem; }
  .main-content article h3 { font-size: 1.2rem; }
}

/* ------------------------------------
   RESPONSIVE 601px à 768px (Tablettes)
------------------------------------- */
@media (min-width: 601px) and (max-width: 768px) {
  .main-content h1 { font-size: 1.8rem; }

  .main-content article { line-height: 1.6; }
  .main-content article h2 { font-size: 1.45rem; }
  .main-content article h3 { font-size: 1.25rem; }

  #note-bubble {
    max-width: min(90vw, 360px);
    right: 10px;
    left: auto;
    top: 12px;
  }
}

/* ------------------------------------
   RESPONSIVE <= 360px (petits écrans)
------------------------------------- */
@media (max-width: 360px) {
  .main-content h1 { font-size: 1.5rem; }
  .main-content article { font-size: 0.94rem; }
}

/* ------------------------------------
   AJUSTEMENTS BIBLIO / NOTES
------------------------------------- */
#biblio-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#biblio-body li,
#footnotes-body li,
#biblio-body p,
#footnotes-body p,
#biblio-body div,
#footnotes-body div {
  margin-bottom: 0.9em;
  line-height: 1.6;
}

/* ------------------------------------
   BULLE DE NOTE
------------------------------------- */
#note-bubble {
  position: fixed;
  max-width: 320px;
  right: 10px;
  top: 100px;
  background: #fffef7;
  border: 1px solid #e0d9b0;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.1);
  padding: 10px 14px;
  color: #333;
  font-size: 0.9rem;
  line-height: 1.4;
  z-index: 9999;
  text-align: left;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ------------------------------------
   SÉCURITÉ CONTENU (overflow)
------------------------------------- */
.main-content article,
#biblio, #footnotes {
  overflow-wrap: anywhere;
}

.main-content article table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.main-content article pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.main-content article video,
.main-content article iframe {
  max-width: 100%;
  height: auto;
}
