/* Stein's Method, Part 7. Every colour is a theme token, so both halves of the
   light/dark pair repaint without a reload.

   1. Phone widths: a long display or a wide table scrolls inside its own box (the
      rule the six earlier parts carry), with room below so descenders and the
      scrollbar do not clip an equation.
   2. Display maths: more air above and below, a little larger than body text.
   3. .eq-hero: the few results the post is built on, set on a panel with a small
      caption line, and term colours that match the widget's arrows.
   4. Statements: the house markup (callout-important for a theorem, callout-note for
      a definition) restyled from an alert box into a quiet theorem block. */

/* 1 ---------------------------------------------------------------- phone widths */
main table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
main table th mjx-container,
main table th .math {
  text-transform: none;
}

/* 2 ----------------------------------------------------------------- display maths */
/* Font, size and spacing of the maths come from theme/math.css and theme/mathjax.html,
   like every other post. Only this post's own additions live here. */

/* term colours, set in TeX with \class{t1}{...} */
.t1 { color: var(--w-c1); }
.t2 { color: var(--w-c2); }
.t3 { color: var(--w-c3); }
.t4 { color: var(--w-c4); }
.tm { color: var(--w-muted); }

/* 3 ------------------------------------------------------------------- hero panels */
.eq-hero {
  position: relative;
  margin: 2rem 0 2.2rem;
  padding: 0.95rem 1.4rem 0.5rem;
  background: var(--w-paper);
  border: 1px solid var(--w-rule);
  border-radius: 10px;
}
.eq-hero::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 2px;
  background: var(--w-accent);
}
.eq-hero > p:first-child {
  margin: 0 0 0.1rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--w-muted);
}
.eq-hero > p:first-child mjx-container {
  text-transform: none;
}
.eq-hero mjx-container[display="true"] {
  margin: 0.7em 0 0.2em !important;
}
.eq-hero span.math.display {
  padding-bottom: 0;
  font-size: 128%;
}
.eq-hero > p:has(> span.math.display) {
  margin-bottom: 0.4rem;
}
.eq-hero > p:last-child:not(:first-child) {
  margin: 0.2rem 0 0.55rem;
  font-size: 0.92rem;
  color: var(--w-muted);
}

/* 4 -------------------------------------------------------------------- statements */
.callout.callout-important,
.callout.callout-note {
  border: 1px solid var(--w-rule) !important;
  border-left: 1px solid var(--w-rule) !important;
  border-radius: 10px !important;
  background: var(--w-surface) !important;
  box-shadow: none !important;
  margin: 1.8rem 0 !important;
  position: relative;
}
.callout.callout-important::before,
.callout.callout-note::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: var(--w-accent);
}
.callout.callout-note::before {
  background: var(--w-c2);
}
.callout.callout-important .callout-header,
.callout.callout-note .callout-header {
  background: transparent !important;
  border: 0 !important;
  padding: 0.85rem 1.3rem 0 !important;
}
.callout.callout-important .callout-icon-container,
.callout.callout-note .callout-icon-container {
  display: none !important;
}
.callout.callout-important .callout-title-container,
.callout.callout-note .callout-title-container {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--w-ink) !important;
  opacity: 1;
}
.callout.callout-important .callout-body-container,
.callout.callout-note .callout-body-container {
  padding: 0.35rem 1.3rem 0.4rem !important;
}
.callout.callout-important .callout-body-container mjx-container[display="true"],
.callout.callout-note .callout-body-container mjx-container[display="true"] {
  margin: 0.8em 0 !important;
}

/* proof steps: a hairline down the left, so a proof reads as one block */
.stein-proof {
  margin: 0 0 1.6rem;
  padding: 0 0 0 1.1rem;
  border-left: 1px solid var(--w-rule);
}
.stein-proof > p:first-child strong:first-child {
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

@media (max-width: 575px) {
  .eq-hero {
    padding: 0.8rem 0.85rem 0.4rem;
    margin-left: -4px;
    margin-right: -4px;
  }
  .eq-hero span.math.display {
    font-size: 112%;
  }
  .stein-proof {
    padding-left: 0.7rem;
  }
}

/* The chart's two toggles have five and six options; on a phone the kit's one-row pill
   would run off the page, so here they wrap. Post-local, to leave the kit's chrome alone. */
@media (max-width: 700px) {
  #widget-forces .widget-toggle {
    display: flex;
    flex-wrap: wrap;
    border-radius: 12px;
  }
  #widget-forces .widget-toggle-btn {
    flex: 1 1 auto;
  }
}
