/*
Text zum Lesen: Lesetext (Impressum, Datenschutz, Doku), Gedichte,
anderer Text, Doku-Abschnitte und aufklappbarer Code
*/

/*
Einstellungen sollte der Text auch lesbar sein
*/

.lesetext {
  max-width: 65ch;
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: 1.125rem;
  line-height: 1.7;
  hyphens: auto;
}

.lesetext .projekt-kopf {
  font-family: "Special Elite", "Courier New", monospace;
  margin-bottom: 2.5rem;
}

.lesetext p + p {
  margin-top: 1em;
}

.lesetext h2 {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
}

.lesetext blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid currentColor;
  opacity: 0.85;
}

.lesetext blockquote footer {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

/*
Fußnoten (Essay): im HTML am Ende, auf breiten Bildschirmen als Randnoten daneben (/lib/randnoten.js)

  schmal:                         breit (ab 80rem):
  Text mit Verweis¹ …             Text mit Verweis¹ …        1 Die Fußnote,
  …                               …                            auf gleicher Höhe
  Anmerkungen
  1 Die Fußnote ↩
*/

.lesetext sup.fussnote {
  line-height: 0; /* die hochgestellte Zahl drückt die Zeile sonst auseinander */
}

.lesetext sup.fussnote a {
  color: inherit;
  text-decoration: none;
  padding: 0 0.1em; /* etwas größere Fläche zum Tippen */
}

.fussnoten {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  font-size: 0.9em;
}

.fussnoten h2 {
  margin-top: 0;
}

.fussnoten ol {
  padding-left: 1.5em;
}

.fussnoten li + li {
  margin-top: 0.5em;
}

.fussnoten a[href^="#ref-"] {
  color: inherit;
  text-decoration: none;
  opacity: 0.6;
}

/* Randnoten: gibt es nur, wenn randnoten.js sie gebaut hat und der Bildschirm breit ist */
.lesetext {
  position: relative; /* Bezug für die Randnoten (top in Pixeln ab Oberkante des Artikels) */
}

.randnote {
  display: none;
}

.mit-rand .randnote {
  display: block;
  position: absolute;
  left: calc(100% + 2.5rem); /* rechts neben der Textspalte */
  width: 14rem;
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0.75; /* Nebensache, Regel 4 */
}

.mit-rand .randnote p {
  margin: 0;
}

.randnote-nummer {
  font-weight: bold;
}

/* kurz aufleuchten, wenn man im Text auf die Nummer klickt */
.randnote.hervor {
  animation: hervor 1.2s ease-out;
}

@keyframes hervor {
  from {
    opacity: 1;
    background: color-mix(in srgb, currentColor 15%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .randnote.hervor {
    animation: none;
    opacity: 1;
  }
}

/* breit: die Liste am Ende nur fürs Auge verstecken, Screenreader lesen sie weiter
   (die Randnoten selbst sind aria-hidden). display: none würde sie für alle entfernen */
.mit-rand .fussnoten {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/*
besondere Formatierung für Gedichte: eine Strophe = ein <p>, eine Zeile = ein <span class="zeile">

Hängender Einzug: die ganze Zeile rückt 2em ein (padding-left), die erste Teilzeile holt sich
die 2em mit einem negativen Einzug zurück (text-indent). Bricht eine lange Zeile am Handy um,
steht der Rest eingerückt darunter; ein echtes Zeilenende fängt wieder ganz links an.

  Eine lange Zeile, die am Handy nicht
    mehr passt, läuft eingerückt weiter
  Die nächste Zeile beginnt links

Einrückung als Form: <span class="zeile einzug">, mehr davon mit style="--einzug: 3"
*/

.gedicht .zeile {
  display: block;
  padding-left: calc(2em + var(--einzug, 0) * 2em);
  text-indent: -2em;
}

.gedicht .einzug {
  --einzug: 1;
}

.gedicht p + p {
  margin-top: 1.75em; /* Abstand zwischen den Strophen */
}

/*
Anderer Text
*/

.text {
  max-width: 65ch;
  line-height: 1.6;
  margin: 2rem 0 3rem;
}

.text p + p {
  margin-top: 1em;
}

/*
Dokumentation unter den Projekten
*/

.doku {
  margin-top: 4rem;
}

.doku ul {
  padding-left: 1.25rem;
  margin-top: 1rem;
}

.doku li + li {
  margin-top: 0.4rem;
}

.code {
  margin-top: 2.5rem;
}

.code summary {
  font-family: "Special Elite", "Courier New", monospace;
  cursor: pointer;
}
