/* Self-contained mathematical textbook contract.

   The canonical page should read naturally with Lean, infrastructure and
   foundation notes collapsed.  Numbered mathematical results and equations
   carry the visual hierarchy; prose is explanatory rather than headline text.
*/

.source-result-header {
  margin: 0 0 0.42rem;
}

.source-result-kind,
.math-theorem-header .passage-label,
.math-theorem-statement > h3,
.math-theorem-proof > h3,
.source-proof-lean span {
  text-transform: none !important;
  letter-spacing: 0.01em !important;
}

.source-result-kind {
  color: var(--state-dark, var(--accent));
  font-family: var(--body-font, Charter, Georgia, serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

/* The formula, not a prose paraphrase, is the theorem-card headline. */
.source-passage > .source-formula {
  margin: 0.42rem auto 0.5rem;
  padding: 0.18rem 0;
  font-size: 1.08rem;
}

.source-result-summary {
  max-width: 70ch;
  margin: 0.25rem 0 0.65rem !important;
  color: var(--ink) !important;
  font-family: var(--body-font, Charter, Georgia, serif);
  font-size: 0.96rem !important;
  line-height: 1.58 !important;
}

.source-passage > p:not(.source-result-summary) {
  max-width: 70ch;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Source derivations are available in textbook order but do not interrupt a
   first reading. */
.source-proof-disclosure {
  max-width: 76ch;
  margin: 0.75rem 0 0.55rem;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
}

.source-proof-disclosure > summary {
  padding: 0.55rem 0;
  color: var(--ink);
  font-family: var(--body-font, Charter, Georgia, serif);
  font-size: 0.94rem;
  font-weight: 650;
}

.source-proof-disclosure > .disclosure-body {
  padding: 0.1rem 0 0.35rem;
}

.source-proof-origin {
  max-width: 68ch;
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.source-proof-disclosure .source-equation-proof {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.source-proof-step {
  padding: 0.42rem 0 0.3rem;
}

.source-proof-formula {
  font-size: 1rem;
}

.source-proof-lean {
  opacity: 0.72;
  font-size: 0.72rem;
}

/* Infrastructure is useful on demand, but the textbook itself must dominate. */
.foundation-disclosure,
.math-lean-correspondence,
.implicit-prerequisite-card > details,
.rigor-disclosure {
  margin-top: 0.65rem;
}

.foundation-disclosure > summary,
.math-lean-correspondence > summary,
.rigor-disclosure > summary {
  font-weight: 560;
  color: var(--muted);
}

@media (max-width: 700px) {
  .source-passage > .source-formula {
    font-size: 0.98rem;
  }

  .source-result-kind {
    font-size: 1rem;
  }
}
