/* Docs pages only. The site layout is in app/pages.py; the cite rules are
   in cites.css, copied from the app. */

h2 {
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 2.25rem 0 0.75rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

/* A heading is a link to itself, so a section's address can be copied. */
h1 a,
h2 a,
h3 a {
  color: inherit;
  text-decoration: none;
}

h1 a:hover,
h2 a:hover,
h3 a:hover {
  text-decoration: underline;
}

ul,
dl {
  margin: 0 0 1rem;
}

dt {
  font-weight: 600;
}

dd {
  margin: 0 0 0.75rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

/* Text typed into a body, shown as typed: a code block, display maths. */
pre {
  margin: 0 0 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #e2e2dc;
  border-radius: 4px;
  overflow-x: auto;
}

figure {
  margin: 1.25rem 0 1.5rem;
}

figure img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* The model: a list's tree on one side, the verification and its run on
   the other, joined by mappings. Stacks when the window is narrow. */
.model-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

@media (min-width: 40rem) {
  .model-grid {
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    column-gap: 0.75rem;
  }
}

.model .card {
  border: 1px solid #c8c8c2;
  border-radius: 4px;
  padding: 0.6rem 0.7rem 0.45rem;
}

.model .kind {
  margin: 0;
  font-weight: 600;
}

.model .ex,
.model .aside,
.model .step {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
}

.model .aside,
.model .step,
.model-join {
  color: #555;
}

.model .step {
  margin: 0.45rem 0;
  text-align: center;
  font-size: 0.8rem;
}

.model .run {
  background: #fafaf8;
}

.model .tree {
  margin: 0.45rem 0 0.15rem;
}

.model-rows {
  list-style: none;
  margin: 0.35rem 0 0.15rem;
  padding: 0;
}

.model-rows li {
  padding: 0.1rem 0;
}

.model-join {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0;
  font-size: 0.8rem;
}

.model-join::before,
.model-join::after {
  content: "";
  flex: 1;
  border-top: 1px solid #8f8f8a;
}

@media (min-width: 40rem) {
  /* Sit the join beside the two requirements that are mapped, not the titles. */
  .model-join {
    min-width: 6.25rem;
    margin: 4.6rem 0 0;
  }
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

table {
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.35rem 0.75rem 0.35rem 0;
  border-bottom: 1px solid #e2e2dc;
}

th {
  font-weight: 600;
  border-bottom-color: #ccc;
}

td .cite + .cite {
  margin-left: 0.4rem;
}

/* A table wider than a phone scrolls inside itself, not the page. */
.wide {
  overflow-x: auto;
  margin: 0 0 1rem;
}

.wide table {
  margin: 0;
}

table.limits td:last-child,
table.limits th:last-child {
  white-space: nowrap;
  width: 1%;
}

blockquote {
  margin: 0 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid #e2e2dc;
}

/* A worked example: a small requirement tree, often before and after an
   event. Rows are cites and titles, with a rail for each level, as in the
   workspace's tree. */
.tree,
.tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree ul {
  margin-left: 0.55rem;
  padding-left: 0.9rem;
  border-left: 1px solid #d6d6d0;
}

.tree li {
  padding: 0.15rem 0;
}

.t {
  margin-left: 0.45rem;
  font-size: 0.9rem;
}

.tree .m {
  margin-left: 0.35rem;
  font-size: 0.8rem;
  color: #555;
}

.example {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e2e2dc;
  border-radius: 4px;
}

.example .tree {
  margin-bottom: 0.6rem;
}

.example > p:last-child,
.example > ul:last-child {
  margin-bottom: 0;
}

.example .event {
  margin: 0 0 0.6rem;
  font-weight: 600;
}

.before-after {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.25rem;
  margin: 0 0 0.75rem;
}

@media (min-width: 34rem) {
  .before-after {
    grid-template-columns: 1fr 1fr;
  }
}

.before-after h4 {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
}

.split {
  font-size: 0.9rem;
}

.split .cite {
  margin-left: 0.25rem;
}

.split .badge {
  margin: 0 0.15rem;
  vertical-align: 0.05rem;
}

/* A status badge's mark (Badge.svelte, whose scoped style is not in app.css). */
.badge .glyph {
  flex: 0 0 auto;
  width: 0.8em;
  height: 0.8em;
}

.badges .badge {
  margin: 0 0.3rem 0.3rem 0;
}

.muted {
  color: #555;
}

/* From component styles in web/src (not in app.css, so not copied by
   scripts/docs_css.py): a backlink's cited target (Backlinks.svelte) and
   a maths error (TeX.svelte). */
.target {
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
  font-weight: 700;
  color: #111;
}

.tex-error {
  padding: 0 0.2em;
  border-radius: 2px;
  background: #fbe9e7;
  color: #b3261e;
  font-size: 0.85em;
  white-space: nowrap;
}

.example .source {
  margin: 0 0 0.25rem;
}

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8em;
  padding: 0 0.3em;
  border: 1px solid #ccc;
  border-bottom-width: 2px;
  border-radius: 3px;
  background: #fafaf8;
  white-space: nowrap;
}

.docs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: #555;
}

/* The site's nav spaces adjacent links; the gap above does it here. */
.docs-nav a + a,
.docs-nav a + strong,
.docs-nav strong + a {
  margin-left: 0;
}

.docs-nav strong {
  color: #222;
  font-weight: 600;
}

/* Also copied by hand from components, for the mock-ups on the workspace
   and model pages: the body mark at the end of a tree row's text
   (BodyTip.svelte), a run row's status buttons (RunPlace.svelte), and the
   tag on a drag's drop line (InsertLine.svelte). */
.has-body {
  display: inline-block;
  vertical-align: -0.05rem;
  width: 0.6rem;
  height: 0.72rem;
  box-sizing: border-box;
  border: 1.3px solid #69727d;
  border-radius: 1.5px;
  background:
    linear-gradient(#69727d, #69727d) 1.5px 2.5px / 4px 1px no-repeat,
    linear-gradient(#69727d, #69727d) 1.5px 5px / 4px 1px no-repeat;
}

.status-buttons {
  display: inline-flex;
  gap: 0.25rem;
}

.status-buttons span {
  padding: 0.05rem 0.45rem;
  border: 1px solid #ccc;
  border-radius: 2px;
  background: #fff;
  color: #444;
  font-size: 0.78rem;
  white-space: nowrap;
}

.status-buttons .on {
  background: var(--tone);
  border-color: var(--tone);
  color: #fff;
}

.tone-pass {
  --tone: #2e7d32;
}

.tone-fail {
  --tone: #c62828;
}

.tone-nocover {
  --tone: #6b6b67;
}

.drop-tag {
  padding: 0 0.35rem;
  border-radius: 2px;
  background: #333;
  color: #fff;
  font-size: 0.72rem;
  line-height: 18px;
  white-space: nowrap;
}

/* A sketch of a workspace screen: boxes in the app's greys, with real
   cites in them. Not a screenshot. */
.screen {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #c8c8c2;
  border-radius: 4px;
  background: #fff;
  font-size: 0.8rem;
}

@media (min-width: 34rem) {
  .screen {
    grid-template-columns: 7.5rem 1fr 1fr;
  }
}

.screen > div {
  padding: 0.45rem 0.5rem;
  border-radius: 3px;
}

.screen .side {
  background: #f3f3f0;
}

.screen .box {
  border: 1px solid #d6d6d0;
}

.screen .pane-box {
  background: #f6f6f2;
}

.screen .label {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #777;
}

.screen .side ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.screen li {
  padding: 0.1rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen p {
  margin: 0 0 0.3rem;
}

.screen .rule {
  margin: 0.4rem 0;
  border-top: 1px solid #d6d6d0;
}

/* One tree row, drawn out so its parts can be named. */
.row-mock {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #d6d6d0;
  border-radius: 3px;
  font-size: 0.9rem;
}

.row-mock .rail {
  align-self: stretch;
  width: 0.9rem;
  border-left: 1px solid #d6d6d0;
  margin-left: 0.35rem;
}

.row-mock .twist {
  color: #777;
  font-size: 0.7rem;
}

.row-mock .stmt {
  flex: 1;
  min-width: 0;
}

.row-mock .stmt strong {
  font-weight: 600;
  color: #1b1f24;
}

/* The drop line while dragging, with its tag. */
.drop-mock {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.1rem 0 0.1rem 1.45rem;
}

.drop-mock::before {
  content: "";
  flex: 1;
  height: 2px;
  background: #333;
}

.drop-mock .drop-tag {
  order: 1;
}

/* A sequence of states or events, left to right; top to bottom on a phone. */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.4rem;
  margin: 1rem 0 1.25rem;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.flow > li {
  flex: 1 1 8rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #c8c8c2;
  border-radius: 4px;
}

.flow > li.arrow {
  flex: 0 0 auto;
  align-self: center;
  padding: 0;
  border: 0;
  color: #777;
}

.flow .state {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.flow p {
  margin: 0;
  color: #444;
}

.flow .cite {
  margin-bottom: 0.25rem;
}

/* The status legend, as StatusFilter.svelte draws it: picked entries are
   the statuses shown; the others are greyed while any is picked. */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.legend span.entry {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #434b55;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.legend .entry b {
  font-weight: 650;
  color: #1b1f24;
}

.legend .entry.picked {
  border-color: #a9c1e6;
  background: #e9f0fa;
  color: #1b1f24;
}

.legend .entry.hidden-status,
.legend .entry.hidden-status b {
  color: #9aa2ac;
}

.legend .entry.hidden-status .swatch {
  opacity: 0.35;
}
