/* Article (brandbook "Articles"): long reading text rendered from Markdown,
   the help center's articles and the legal documents. A card whose text is
   the serif at 18 px, every text block held to the reading measure
   (58 ch of the serif, about 66 Lithuanian characters a line, under the
   brandbook's 70); headings in the serif; links in the
   running-text look (.mm-link); tables scroll sideways inside the card,
   never the page; images fit the card.

   The Markdown renderer emits bare elements, so the rules select them under
   .mm-article (templates/help-center/mamaney-help-center-article.html.twig,
   templates/legal/mamaney-legal-document.html.twig). */
.mm-article {
  font-family: var(--mm-serif);
  font-size: 18px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.mm-article > :where(p, ul, ol, h2, h3, h4, blockquote, dl) {
  max-width: 58ch;
}

.mm-article > * + * {
  margin-top: var(--mm-space-4);
}

.mm-article > :first-child {
  margin-top: 0;
}

.mm-article :where(ul, ol) {
  padding-left: var(--mm-space-6);
}

.mm-article li + li {
  margin-top: var(--mm-space-1);
}

.mm-article h2 {
  font-size: 21px;
  line-height: 1.25;
  text-wrap: balance;
}

.mm-article h3 {
  font-size: 19px;
  line-height: 1.3;
}

.mm-article h4 {
  font-family: var(--mm-serif);
  font-size: 18px;
  font-weight: 600;
}

.mm-article > * + h2 {
  margin-top: var(--mm-space-8);
}

.mm-article > * + :where(h3, h4) {
  margin-top: var(--mm-space-6);
}

/* An anchored heading (the table of contents, a glossary link) lands below
   the page's top edge, not under it. */
.mm-article :where(h2, h3, h4)[id] {
  scroll-margin-top: var(--mm-space-4);
}

.mm-article strong {
  font-weight: 600;
}

.mm-article a {
  color: var(--mm-primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--mm-underline);
  text-underline-offset: 3px;
}

.mm-article a:hover {
  text-decoration-color: currentColor;
}

.mm-article img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--mm-line);
  border-radius: var(--mm-radius-card);
}

.mm-article code {
  font-family: var(--mm-mono);
  font-size: .875em;
}

.mm-article blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: var(--mm-space-4);
  color: var(--mm-muted);
}

.mm-article hr {
  border: 0;
  border-top: 1px solid var(--mm-line);
}

/* The renderer emits a bare <table>; the table itself scrolls sideways.
   Table text is the sans, like every table (brandbook "Tables"). */
.mm-article table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--mm-sans);
  font-size: 15px;
  line-height: 1.45;
}

.mm-article :where(th, td) {
  padding: var(--mm-space-2) var(--mm-space-3);
  border: 1px solid var(--mm-line);
  text-align: left;
  vertical-align: top;
}

.mm-article th {
  background: var(--mm-page);
  font-weight: 600;
}

/* Callouts (the module's CalloutRenderer: > [!NOTE], > [!WARNING]) take the
   brandbook's message band: a tinted surface, a 3 px rule on the start edge,
   the kind's icon before the title (or before the text when the callout
   has no title: the head only groups, so icon and text share a grid).
   Sans, like every message; as wide as the article's text (58 ch of the
   18 px serif). Help articles and legal documents both carry them. */
.mm-article .help-callout {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: var(--mm-space-2) 10px;
  max-width: 35.5rem;
  padding: var(--mm-space-3) 14px;
  border-left: 3px solid;
  border-radius: var(--mm-radius-field);
  color: var(--mm-text);
  font-family: var(--mm-sans);
  font-size: 15px;
  line-height: 1.45;
}

.mm-article .help-callout > * {
  grid-column: 2;
  margin: 0;
}

.mm-article .help-callout > .help-callout__head {
  display: contents;
}

.mm-article .help-callout--note {
  background: var(--mm-primary-surface);
  border-color: var(--mm-primary);
}

.mm-article .help-callout--warning {
  background: var(--mm-action-surface);
  border-color: var(--mm-action);
}

.mm-article .help-callout__icon {
  grid-column: 1;
  grid-row: 1;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.mm-article .help-callout--note .help-callout__icon {
  color: var(--mm-primary);
}

.mm-article .help-callout--warning .help-callout__icon {
  color: var(--mm-action);
}

.mm-article .help-callout__title {
  grid-column: 2;
  font-weight: 600;
}

@media (min-width: 768px) {
  .mm-article {
    padding: var(--mm-space-8) var(--mm-space-8) var(--mm-space-6);
  }
}
