/* THE CONTENT-PAGE COMPONENT — page kit, C.58k.
 *
 * The column every page that is read rather than filled in stands in:
 * the claim and its lead (or the entry component, on a page a file can
 * be dropped on), the sections, the questions, the closing card and the
 * siblings (CONTENT_PAGE_SPECS.md 1.2). Nine templates drew the column
 * by hand as `.prose`; the rhythm is stated here once.
 *
 * EVERY SECTION IS A GROUP OF THE LAW (PAGE_DESIGN_LAWS 1): its heading
 * a rhythm step above what belongs to it, its air as padding on the
 * rhythm's own rungs, the hairline under it — the sign and the measures
 * `gate_page_design_laws` reads.
 *
 * NOT ONE LENGTH IS WRITTEN HERE (`kit-tokens`): every measure is a
 * token of `abbundo.css :root`, `0` is the only bare value.
 */

/* the one reading column, at the measure a sentence is read at */
.kit-content-body {
  max-width: var(--measure);
}

/* THE ENTRY ON A CONTENT PAGE. The start page's form keeps a band free
 * at its foot for the sticky action bar; a content page has no bar, so
 * the band would be air under the draw button and nothing else. */
.kit-content .kit-entry-form {
  padding-bottom: 0;
}

.kit-content .kit-entry-form .kit-action {
  margin-top: var(--s4);
}

/* -- the claim ------------------------------------------------------ */

.kit-content-claim {
  margin: 0 0 var(--rhythm-within);
}

.kit-content-lead {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: var(--fs-lead);
}

/* -- the parts, each a step of the rhythm under the one before ------ */

.kit-content-top,
.kit-content-sections,
.kit-content-blocks {
  margin-top: var(--rhythm-between);
}

.kit-content-top > :first-child,
.kit-content-blocks > :first-child {
  margin-top: 0;
}

.kit-content-top > :last-child,
.kit-content-blocks > :last-child {
  margin-bottom: 0;
}

/* -- a section: the law's group ------------------------------------ */

.kit-content-section {
  padding-top: var(--s4);
  padding-bottom: var(--s4);
  border-bottom: var(--hairline) solid var(--line);
}

.kit-content-section > .kit-content-heading {
  margin: 0 0 var(--rhythm-within);
}

.kit-content-section > :last-child {
  margin-bottom: 0;
}

.kit-content-section h3 {
  margin: var(--s4) 0 var(--rhythm-within);
}

/* a section with an anchor (the manual's parts) lands clear of the
 * sticky header when a link names it */
.kit-content-section[id] {
  scroll-margin-top: var(--s8);
}

/* STEPS: a walk-through (the manual's four steps, the API guide's quick
 * start), each step a heading and its sentences. Where the headings do
 * not carry their number themselves (`-numbered`, the manual) the number
 * stands in the accent colour at the step's left; the API guide's
 * headings say "1." in their own words, because they are read aloud and
 * copied out, and a marker would say it twice. */
.kit-content-steps {
  list-style: none;
  counter-reset: kit-step;
  margin: 0;
  padding: 0;
}

.kit-content-steps > li {
  counter-increment: kit-step;
  position: relative;
  margin: 0;
}

.kit-content-steps-numbered > li {
  padding-left: var(--s6);
}

.kit-content-steps > li + li {
  margin-top: var(--s4);
}

.kit-content-steps-numbered > li::before {
  content: counter(kit-step);
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: var(--accent);
}

.kit-content-steps > li > h3 {
  margin: 0 0 var(--rhythm-within);
}

/* STEPS IN A ROW (C.226, the start page's „Ablauf“): side by side where
 * the column holds them, one under the other where it does not - the
 * grid's own wrap at the token's column width, so no breakpoint and no
 * number stands here. */
.kit-content-steps-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--steps-col-min), 1fr));
  gap: var(--s4) var(--s6);
}

.kit-content-steps-row > li + li {
  margin-top: 0;
}

.kit-content-steps > li > p {
  margin: 0 0 var(--s2);
}

.kit-content-steps > li > :last-child {
  margin-bottom: 0;
}

/* ONE-LINE STEPS (C.145, the manual): each step is its bold name and one
 * sentence on one line, closer to the next step than a heading step. On a
 * phone the name stands on a line of its own and the sentence follows
 * under it, indented to the counter. */
.kit-content-steps-lines > li + li {
  margin-top: var(--s2);
}

@media (max-width: 35rem) {
  .kit-content-steps-lines > li > strong:first-child {
    display: block;
  }
}

/* THE FILE TABLE (C.145, the manual's ZIP fold): a name column in code and
 * what each file holds. On a phone the two columns stack into one block per
 * row, and a long name wraps at any character rather than scroll sideways. */
.kit-content-filetable {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s2) 0;
}

.kit-content-filetable th,
.kit-content-filetable td {
  text-align: left;
  vertical-align: top;
  padding: var(--s1) var(--s2) var(--s1) 0;
  border-bottom: var(--hairline) solid var(--line);
}

.kit-content-filetable code {
  overflow-wrap: anywhere;
}

@media (max-width: 35rem) {
  .kit-content-filetable thead {
    display: none;
  }
  .kit-content-filetable tr,
  .kit-content-filetable td {
    display: block;
  }
  .kit-content-filetable td {
    border-bottom: 0;
    padding: 0;
  }
  .kit-content-filetable tr {
    padding: var(--s2) 0;
    border-bottom: var(--hairline) solid var(--line);
  }
}

/* TERMS: a name and what it means (the feature catalogue), the meaning
 * under its name and closer to it than to the next name. */
.kit-content-terms {
  margin: 0;
}

.kit-content-terms dt {
  margin: var(--s4) 0 var(--rhythm-within);
  font-weight: 650;
}

.kit-content-terms dt:first-child {
  margin-top: 0;
}

.kit-content-terms dd {
  margin: 0;
  padding-left: var(--s4);
  border-left: var(--hairline) solid var(--line);
  color: var(--ink-soft);
}

/* a picture proves the sentence above it; its caption is one grey line */
.kit-content-figure {
  margin: var(--s4) 0 0;
}

.kit-content-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-sm);
}

.kit-content-figure figcaption {
  margin-top: var(--s2);
  color: var(--ink-soft);
  font-size: var(--fs-small);
}

/* a line of ways on, drawn as the kit's link buttons */
.kit-content-ways {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: var(--s4) 0 0;
}

/* a quiet line of the page's own: a source, a trademark notice */
.kit-content-note {
  color: var(--ink-soft);
  font-size: var(--fs-small);
}

/* -- the questions, the card, the siblings ---------------------------- */

.kit-content-faq,
.kit-content-card,
.kit-content-more,
.kit-content-end {
  margin-top: var(--rhythm-heading);
}

.kit-content-more > .kit-content-heading {
  margin: 0 0 var(--rhythm-within);
}

.kit-content-more ul {
  margin: 0;
  padding-left: var(--s5);
}

.kit-content-end > :last-child {
  margin-bottom: 0;
}

/* the way back to the index, one quiet line a step above the claim */
.kit-content-back {
  margin: 0 0 var(--s4);
  color: var(--ink-soft);
}
