@charset "UTF-8";

/* The folded apparatus.
 *
 * Below 1180 px the column of sources falls into the flow between two parts,
 * and js/flap.js puts it behind a `details`. Taken out of css/reading.css on
 * 25 August 2026, when „Imkern ohne Rähmchen" needed the same thing: one file,
 * three pages, as with the lightbox.
 *
 * The rules hold without a media query of their own, because the flap only
 * exists where the script builds it.
 */

/* ---------- Die zusammengeklappte Quelle ------------------------------ */

/* It is built by js/reading.js and only below 1180 px; the rules here therefore
   hold without a media query of their own. */
.source-flap > summary {
  padding: var(--air) var(--margin);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--apparatus);
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-far);
  cursor: pointer;
}
.source-flap > summary::marker,
.source-flap > summary::-webkit-details-marker { color: var(--gold); }
.source-flap > summary:hover { color: var(--ink); }
.source-flap[open] > summary { border-bottom-color: var(--rule-fine); }

/* „Imkern ohne Rähmchen" calls its apparatus a margin. Its content is wrapped
   so that the script has one element to move and one to measure. A plain block,
   which is what a div is anyway: `display: contents` stood here first and made
   the wrapper boxless, so its scrollHeight was 0, the two-screen test always
   passed and no flap was ever built. */
.margin-inner { display: block; }
.source-flap .margin-mark { display: none; }

/* The folded margin of the treatise is a box in the stack under a part, and it
   stands directly above „Lies mehr darüber". It therefore takes that box's
   width and its metrics instead of the column's: `.margin` is held to the
   measure, which pressed the flap in, and it brings a rule of its own, which
   stood above the summary's as a second line. */
/* One box metric for the two that stand under a part, the folded sources and
   „Lies mehr darüber". They are laid out by different parents — the margin is a
   grid item inside `.strata`, the nav a child of the chapter — so each needs
   saying, and without the shared rule they stood at different widths and offset
   against each other. `border-box`, or the padding of the one and the padding of
   the other would part them again. Stefan on 25 August 2026: „damit die gut
   aussehen sollen brauchen sie links und rechts ebenfalls margin." */
.margin.is-folded,
.chapter > .more {
  box-sizing: border-box;
  width: calc(100% - 2 * var(--margin));
  max-width: 46rem;
  margin-inline: auto;
}
.margin.is-folded {
  /* `justify-self`, not `margin: auto`. The margin is a grid item, and an auto
     side margin switches off its stretching there: measured on 25 August 2026 it
     shrank to its summary, 211px inside a column of 753. */
  justify-self: center;
  margin-top: calc(var(--air) * 1.2);
  margin-bottom: calc(var(--air) * -1.2 - 1px);
  padding: 0;
  border-top: 0;
}
.margin.is-folded .source-flap > summary {
  padding: 1rem 1.3rem 1.1rem;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--desk) 14%, var(--sheet));
  font-size: .7rem;
  letter-spacing: .12em;
}
.margin.is-folded .source-flap[open] > summary { border-bottom-color: var(--rule); }
.margin.is-folded .margin-inner {
  padding: 0 1.3rem 1.1rem;
  border: 1px solid var(--rule);
  border-top: 0;
}
