/* Habillage du wiki Luna Invicta, injecté après le build (voir deploy/deploy.sh).
 *
 * Trois partis pris :
 *   - une page se lit, elle ne se parcourt pas : mesure de ligne courte,
 *     interligne large, une serif pour le corps ;
 *   - la source est la valeur du wiki, mais elle ne doit pas encombrer :
 *     les références d'épisode s'effacent jusqu'au moment où on les cherche ;
 *   - ce qui n'est pas canon doit se voir sans être lu.
 */

/* Polices : une serif pour le corps, la lecture d'une fiche est longue.
   Déclarées ici plutôt que laissées à la seule configuration, pour que le
   rendu ne dépende pas de l'ordre des feuilles de style de Quartz. */
:root {
  --bodyFont: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --headerFont: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-text: var(--bodyFont);
}

body,
article,
p,
li,
td {
  font-family: var(--bodyFont);
}

h1, h2, h3, h4, h5, h6,
.page-title {
  font-family: var(--headerFont);
}

/* ------------------------------------------------------------ lecture */

article .markdown-preview-view,
article > :not(.infobox) {
  max-width: 44rem;
}

article p,
article li {
  line-height: 1.7;
}

article h1 {
  letter-spacing: -0.01em;
}

article h2 {
  margin-top: 2.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--lightgray);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--darkgray);
}

article h3 {
  margin-top: 1.8rem;
  font-size: 1.05rem;
}

/* La définition, en tête de fiche : c'est la phrase qui dit ce qu'est la
   chose. Elle mérite mieux qu'un italique perdu. */
article > p:first-of-type em,
article .markdown-preview-view > p:first-of-type em {
  display: block;
  font-size: 1.08rem;
  font-style: normal;
  line-height: 1.6;
  color: var(--darkgray);
}

/* L'encart « Properties » de Quartz n'affiche que les alias, en anglais. Le
   plugin reste actif parce qu'il alimente les redirections d'alias, mais son
   encart cède la place à celui d'aggregate.py. */
.note-properties {
  display: none;
}

/* ------------------------------------------------------------- encart */

.infobox {
  float: right;
  clear: right;
  width: 17rem;
  max-width: 100%;
  margin: 0 0 1.2rem 1.6rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--lightgray);
  border-radius: 6px;
  background: var(--highlight);
  font-size: 0.82rem;
  line-height: 1.45;
}

.ib-grille {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.7rem;
}

.ib-cle {
  color: var(--gray);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ib-val {
  color: var(--dark);
}

.ib-detail {
  color: var(--gray);
  font-size: 0.92em;
}

@media (max-width: 900px) {
  .infobox {
    float: none;
    width: auto;
    margin: 0 0 1.5rem 0;
  }
}

/* --------------------------------------------------------- références */

/* « ép. 31 · 15:37 » : présent sur chaque ligne, donc discret par défaut,
   lisible dès qu'on s'y arrête. C'est la promesse du wiki, pas son décor. */
article li small,
article td small {
  color: var(--gray);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

article li:hover small {
  color: var(--secondary);
}

/* Ce qui n'est pas canon se signale : inféré, contradictoire. */
article li small em,
article li small i {
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--lightgray);
  color: var(--darkgray);
  font-style: normal;
  font-size: 0.95em;
}

/* Les citations de l'œuvre : quinze mots maximum, sourcées. */
article blockquote {
  margin: 0.3rem 0 0.8rem 1.2rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--tertiary);
  color: var(--darkgray);
  font-style: italic;
}

/* Les encadrés d'avertissement produits par aggregate.py (homonymes,
   transcription incomplète) ne sont pas des citations. */
article blockquote:has(strong:first-child) {
  border-left-color: var(--gray);
  font-style: normal;
}

/* ---------------------------------------------------------- tableaux */

article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

article thead th {
  position: sticky;
  top: 0;
  background: var(--light);
  border-bottom: 2px solid var(--lightgray);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray);
}

article tbody tr:nth-child(even) {
  background: var(--highlight);
}

article td,
article th {
  padding: 0.45rem 0.6rem;
  vertical-align: top;
}

/* ------------------------------------------------------------- liens */

article a.internal {
  background: none;
  border-bottom: 1px solid var(--lightgray);
  text-decoration: none;
}

article a.internal:hover {
  border-bottom-color: var(--secondary);
}

/* ------------------------------------------------------------ divers */

.page-title a {
  letter-spacing: 0.02em;
}

footer .luna-credits {
  max-width: 44rem;
  margin: 0 auto;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--gray);
  text-align: center;
}

footer .luna-credits strong {
  color: var(--darkgray);
}
