/* Le Markdown rendu par psychopath/utils/markdown_sur.py (rendre_markdown) : classe racine .md.
   Chargée UNE fois par page par templates/simone_base.html. Sobre, dans Bootstrap 3 : rien de plus gros que les titres de page. */

.md {
  max-width: 70ch;            /* largeur de lecture */
  line-height: 1.5;
  overflow-wrap: break-word;
  color: inherit;
}
.md > :first-child, .md-apercu > :first-child { margin-top: 0; }
.md > :last-child, .md-apercu > :last-child { margin-bottom: 0; }

.md p { margin: 0 0 .6em; }

/* titres : h1→h4 … h3+→h6 (décalés au rendu), discrets */
.md h4, .md h5, .md h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1em 0 .35em;
  color: #333;
}
.md h4 { font-size: 1.1em; }
.md h5 { font-size: 1em; }
.md h6 { font-size: .95em; color: #555; }

/* listes aérées */
.md ul, .md ol { margin: 0 0 .6em; padding-left: 1.5em; }
.md li { margin: .2em 0; }
.md li > p { margin: 0 0 .3em; }

/* citations */
.md blockquote {
  margin: 0 0 .6em;
  padding: .2em 0 .2em .9em;
  border-left: 3px solid #d0d7de;
  color: #555;
  font-size: inherit;          /* Bootstrap 3 grossit les blockquote */
}
.md blockquote p:last-child { margin-bottom: 0; }

/* code */
.md code {
  font-family: Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .88em;
  background: #f5f6f7;
  color: #333;                 /* Bootstrap 3 met le code en rose */
  padding: .1em .3em;
  border-radius: 3px;
}
.md pre {
  background: #f5f6f7;
  border: 1px solid #e4e6e8;
  border-radius: 4px;
  padding: .6em .8em;
  margin: 0 0 .6em;
  white-space: pre-wrap;
  max-height: 30em;
  overflow: auto;
  font-size: .88em;
}
.md pre code { background: none; padding: 0; font-size: inherit; }

/* tableaux : filets fins, en-tête, lignes alternées ; défilement horizontal si trop large */
.md table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: .4em 0 .8em;
  font-size: .95em;
}
.md th, .md td { border: 1px solid #e1e4e8; padding: .3em .6em; vertical-align: top; text-align: left; }
.md thead th { background: #f3f4f6; font-weight: 600; }
.md tbody tr:nth-child(even) { background: #fafbfc; }

.md hr { margin: 1em 0; border: 0; border-top: 1px solid #e1e4e8; }

/* blocs repliés : « Données (JSON) » et « … lire la suite » */
.md details > summary {
  cursor: pointer;
  color: #337ab7;
  font-size: .9em;
  user-select: none;
}
.md details > summary:hover { text-decoration: underline; }
.md details.md-json { margin: .4em 0 .6em; }
.md details.md-json[open] > summary { margin-bottom: .3em; }

/* extrait : l'aperçu d'abord, puis « … lire la suite » ; ouvert, le texte entier remplace l'aperçu */
.md-extrait { display: flex; flex-direction: column; }
.md-extrait > .md-apercu { order: 0; }
.md-extrait > .md-suite { order: 1; }
.md-suite[open] { order: 0; }
.md-suite[open] + .md-apercu { display: none; }
.md-suite > summary { list-style: none; margin: .2em 0 0; }
.md-suite > summary::-webkit-details-marker { display: none; }
.md-suite .md-reduire, .md-suite[open] .md-lire { display: none; }
.md-suite[open] .md-reduire { display: inline; }
.md-suite[open] > summary { margin: 0 0 .4em; }

/* dans une cellule de liste, une largeur minimale lisible */
td > .md { min-width: 20em; }
