/* memoria's own styles.
 *
 * Every colour is a token. Not one literal appears here, so the
 * reader's light/dark choice resolves through theme.css and a passage
 * never paints against the wrong ground. Sheets enforces the same rule
 * with a test; memoria's equivalent is TestNoColourLiterals.
 */

[rst-page] { margin: 0 auto; max-width: 46rem; padding: 1.5rem 1rem 4rem; }

[rst-page-header] {
  align-items: center;
  border-bottom: 1px solid var(--rst-line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 46rem;
  padding: 0.9rem 1rem;
}
[rst-brand] {
  color: var(--rst-text);
  font-weight: 620;
  letter-spacing: -0.01em;
  text-decoration: none;
}
[rst-page-footer] {
  border-top: 1px solid var(--rst-line);
  margin: 2rem auto 0;
  max-width: 46rem;
  padding: 0.9rem 1rem 2rem;
}
[rst-inline] { display: inline; }

[rst-search] { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
[rst-search] input[type="search"] {
  background: var(--rst-bg);
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius-sm, 6px);
  color: var(--rst-text);
  flex: 1;
  font: inherit;
  padding: 0.55rem 0.7rem;
}

[rst-section] { border-top: 1px solid var(--rst-line); margin-top: 2.5rem; padding-top: 1rem; }

/* rastrillo's form bar is position:sticky; bottom:0, which is right for a
 * long settings page and wrong here — it floated the submit button over
 * the textarea it belongs under. Ours is an ordinary row. */
[rst-stack] [rst-form-bar] { position: static; margin-top: 1rem; }
[rst-stack] { display: flex; flex-direction: column; gap: 0.35rem; }
[rst-stack] label { font-weight: 560; margin-top: 0.6rem; }
[rst-stack] input[type="text"],
[rst-stack] input[type="email"],
[rst-stack] textarea {
  background: var(--rst-bg);
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius-sm, 6px);
  color: var(--rst-text);
  font: inherit;
  padding: 0.5rem 0.65rem;
  width: 100%;
}
[rst-stack] textarea { font-family: var(--rst-font-mono, ui-monospace, monospace); resize: vertical; }

[rst-results] { list-style: none; margin: 0; padding: 0; }
[rst-result] { border-top: 1px solid var(--rst-line); padding: 0.9rem 0; }
[rst-result]:first-child { border-top: 0; }
[rst-result-title] { font-weight: 600; }
[rst-result-trail] {
  color: var(--rst-text-mut);
  display: block;
  font-size: 0.8125rem;
  margin-top: 0.1rem;
}
[rst-result-snippet] { margin: 0.4rem 0 0.2rem; }
[rst-result-snippet] mark {
  background: var(--rst-accent-soft, var(--rst-line));
  color: inherit;
  padding: 0 0.1em;
}
[rst-result-meta] { font-size: 0.8125rem; margin: 0; }

[rst-prose] { line-height: 1.6; }
[rst-passage] { border-top: 1px solid var(--rst-line); padding: 0.8rem 0; }
[rst-passage]:target { border-inline-start: 3px solid var(--rst-accent, var(--rst-text)); padding-inline-start: 0.7rem; }
[rst-passage-heading] { font-size: 0.9375rem; margin: 0 0 0.4rem; text-transform: none; }
[rst-passage] p { margin: 0; white-space: pre-wrap; }

[rst-breadcrumb] { margin-bottom: 0.75rem; }

[rst-table] { border-collapse: collapse; width: 100%; }
[rst-table] th, [rst-table] td {
  border-bottom: 1px solid var(--rst-line);
  padding: 0.45rem 0.5rem 0.45rem 0;
  text-align: start;
}
[rst-table] th { font-size: 0.8125rem; font-weight: 560; }

/* 320px is the reflow floor the suite holds itself to. */
@media (max-width: 26rem) {
  [rst-search] { flex-direction: column; }
  [rst-table] { font-size: 0.875rem; }
}
