/* Hallmark · shape: Long Document · genre: editorial · theme: brand · redesign: full · copy: verbatim · hero: none, the article body only · nav: kept · footer: kept · signature: one reading column where every old post's inline design is replaced by the same quiet vocabulary
 * contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P3 H4 E4 S3 R4 V3 · weakest: S, reading text for a journal fits the category by design; the answer callout and the table scroll shadow are the only particular details, and nothing decorative was added to earn more */

/* Everything the cleaner (frontend/components/ArticleContent.php) can output, and everything the
   publishing cron may write, is styled here. The vocabulary is documented in
   docs/blog-revamp/ARTICLE-HTML.md. Tokens only: no literal colour or font-family below.
   Weights in use: 400 body, --mg-weight-title headings, --mg-weight-strong emphasis and labels.
   Nothing animates, so there is no motion to reduce. */

.article-prose {
    --prose-flow: 1.15em;
    --prose-heading-clear: calc(var(--mg-header-h, 60px) + 24px);
    box-sizing: border-box;
    width: 100%;
    max-width: var(--mg-measure);
    min-width: 0;
    margin-inline: auto;
    font-family: var(--mg-font-body);
    font-size: var(--mg-size-prose);
    font-weight: 400;
    line-height: var(--mg-leading-body);
    color: var(--mg-body);
    overflow-wrap: break-word;
}

.article-prose *,
.article-prose *::before,
.article-prose *::after {
    box-sizing: border-box;
}

.article-prose:lang(de),
.article-prose :lang(de) {
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
}

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

.article-prose > :last-child {
    margin-bottom: 0;
}

/* ---------- Text ---------- */

.article-prose p {
    margin: 0 0 var(--prose-flow);
    text-wrap: pretty;
}

.article-prose strong {
    font-weight: var(--mg-weight-strong);
    color: var(--mg-ink);
}

.article-prose em {
    font-style: italic;
}

.article-prose strong em,
.article-prose em strong {
    font-style: normal;
}

.article-prose sup,
.article-prose sub {
    font-size: 0.75em;
    line-height: 0;
}

/* ---------- Headings: h2 clearly above h3, twice the space above that there is below ---------- */

.article-prose h2,
.article-prose h3 {
    font-family: var(--mg-font-title);
    font-weight: var(--mg-weight-title);
    letter-spacing: var(--mg-tracking-title);
    color: var(--mg-ink);
    min-width: 0;
    overflow-wrap: break-word;
    text-wrap: balance;
    scroll-margin-top: var(--prose-heading-clear);
}

.article-prose h2 {
    margin: 2.6em 0 0.7em;
    font-size: calc(var(--mg-size-h2) * 1.12);
    line-height: 1.2;
}

.article-prose h3 {
    margin: 2em 0 0.55em;
    font-size: var(--mg-size-h3);
    line-height: var(--mg-leading-snug);
}

.article-prose h2 + h3 {
    margin-top: 1.2em;
}

.article-prose h2 strong,
.article-prose h3 strong {
    font-weight: inherit;
    color: inherit;
}

/* ---------- Links: one look for every link in the text, auto-links included ---------- */

.article-prose a,
.article-prose a.auto-link {
    color: var(--mg-link);
    font-weight: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
    overflow-wrap: break-word;
}

.article-prose a:hover,
.article-prose a.auto-link:hover {
    color: var(--mg-blue-strong);
    text-decoration-thickness: 2px;
}

.article-prose a:active,
.article-prose a.auto-link:active {
    color: var(--mg-teal);
}

.article-prose a:focus-visible,
.article-prose a.auto-link:focus-visible,
.article-prose .table-scroll:focus-visible {
    outline: 2px solid var(--mg-focus);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---------- Lists ---------- */

.article-prose ul,
.article-prose ol {
    margin: 0 0 var(--prose-flow);
    padding-left: 1.45em;
}

.article-prose li {
    margin: 0 0 0.5em;
    padding-left: 0.2em;
}

.article-prose li::marker {
    color: var(--mg-muted);
}

.article-prose ol > li::marker {
    font-variant-numeric: tabular-nums;
}

.article-prose li > p {
    margin-bottom: 0.5em;
}

.article-prose li > ul,
.article-prose li > ol {
    margin-top: 0.5em;
    margin-bottom: 0;
}

.article-prose li:last-child {
    margin-bottom: 0;
}

/* ---------- Quotation: real quotations only, set in the title face rather than ruled ---------- */

.article-prose blockquote {
    margin: 1.9em 0;
    padding: 0.1em 0 0.1em 1.4em;
    font-family: var(--mg-font-title);
    font-size: 1.12em;
    font-style: italic;
    line-height: 1.5;
    color: var(--mg-ink);
}

.article-prose blockquote > :last-child {
    margin-bottom: 0;
}

.article-prose blockquote strong {
    font-style: normal;
}

/* ---------- Callouts: one calm style; the answer is a little more present ---------- */

.article-prose .callout {
    margin: 1.9em 0;
    padding: 1.05em 1.3em 1.1em;
    border-left: 3px solid var(--mg-callout-rule);
    border-radius: 0 var(--mg-radius-md) var(--mg-radius-md) 0;
    background: var(--mg-callout-bg);
    font-style: normal;
}

.article-prose .callout > * {
    margin-top: 0;
}

.article-prose .callout > :last-child {
    margin-bottom: 0;
}

.article-prose .callout p,
.article-prose .callout li {
    font-style: normal;
}

.article-prose .callout ul,
.article-prose .callout ol {
    margin-bottom: 0.75em;
}

.article-prose .callout__label {
    margin: 0 0 0.4em;
    font-size: var(--mg-size-small);
    font-weight: var(--mg-weight-strong);
    line-height: var(--mg-leading-snug);
    letter-spacing: normal;
    text-transform: none;
    color: var(--mg-ink);
}

.article-prose .callout--answer {
    padding-block: 1.2em 1.25em;
    border-left-width: 4px;
    background: var(--mg-wash-blue);
}

.article-prose .callout--answer > p {
    font-size: 1.04em;
    color: var(--mg-ink);
}

.article-prose .callout--warning {
    border-left-color: var(--mg-danger);
    background: var(--mg-danger-bg);
}

.article-prose .callout--warning .callout__label {
    color: var(--mg-danger);
}

/* ---------- Figures and images ---------- */

.article-prose figure {
    margin: 2em 0;
}

.article-prose img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--mg-radius-md);
}

.article-prose p > img,
.article-prose li > img {
    margin-block: 0.4em;
}

.article-prose figcaption {
    margin-top: 0.65em;
    font-size: var(--mg-size-small);
    line-height: var(--mg-leading-snug);
    color: var(--mg-muted);
}

/* ---------- Tables: they scroll inside their own box, never the page ---------- */

.article-prose .table-scroll {
    --table-shade: color-mix(in srgb, var(--mg-teal) 9%, transparent);
    position: relative;
    max-width: 100%;
    margin: 1.9em 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border-block: 1px solid var(--mg-line-strong);
    scrollbar-width: thin;
    scrollbar-color: var(--mg-line-strong) transparent;
}

/* A soft edge appears on the side that still has more to scroll to. CSS only, no script. It is kept
   light (9% teal over 10px) so a link under it still reads at 4.5:1 or better. */
@supports (background: color-mix(in srgb, red, blue)) {
    .article-prose .table-scroll {
        background:
            linear-gradient(to right, var(--mg-paper) 30%, transparent) left center / 28px 100% no-repeat local,
            linear-gradient(to left, var(--mg-paper) 30%, transparent) right center / 28px 100% no-repeat local,
            radial-gradient(farthest-side at 0 50%, var(--table-shade), transparent) left center / 10px 100% no-repeat scroll,
            radial-gradient(farthest-side at 100% 50%, var(--table-shade), transparent) right center / 10px 100% no-repeat scroll;
    }
}

.article-prose table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    text-align: left;
}

.article-prose caption {
    padding: 0.7em 0.9em;
    text-align: left;
    font-size: var(--mg-size-small);
    color: var(--mg-muted);
}

.article-prose th,
.article-prose td {
    min-width: 7.5rem;
    padding: 0.7em 0.9em;
    vertical-align: top;
    text-align: left;
    border-bottom: 1px solid var(--mg-line);
    overflow-wrap: break-word;
}

.article-prose tbody tr:last-child td,
.article-prose tbody tr:last-child th {
    border-bottom: 0;
}

.article-prose thead th {
    font-weight: var(--mg-weight-strong);
    color: var(--mg-ink);
    background: var(--mg-wash);
    border-bottom: 2px solid var(--mg-line-strong);
    white-space: normal;
}

.article-prose tbody th {
    font-weight: var(--mg-weight-strong);
    color: var(--mg-ink);
}

.article-prose td p,
.article-prose td ul,
.article-prose td ol {
    margin-bottom: 0.4em;
}

.article-prose td > :last-child {
    margin-bottom: 0;
}

/* ---------- FAQ: a quiet, distinct section; each question is a plain label above its answer ---------- */

.article-prose .faq {
    margin: 3em 0 0;
    padding-top: 0.4em;
    border-top: 1px solid var(--mg-line);
}

.article-prose .faq > h2 {
    margin-top: 1.4em;
}

.article-prose .faq > h3 {
    margin: 1.5em 0 0.4em;
    padding-top: 1.1em;
    border-top: 1px solid var(--mg-line);
    font-family: var(--mg-font-body);
    font-size: var(--mg-size-h4);
    font-weight: var(--mg-weight-strong);
    letter-spacing: normal;
    line-height: var(--mg-leading-snug);
}

.article-prose .faq > h2 + h3,
.article-prose .faq > h2 + p + h3 {
    padding-top: 0;
    border-top: 0;
}

.article-prose .faq > h2 + h3 {
    margin-top: 0.4em;
}

/* ---------- Sources: smaller and quieter than the body ---------- */

.article-prose .sources {
    margin: 3em 0 0;
    padding-top: 0.4em;
    border-top: 1px solid var(--mg-line);
    font-size: 0.94em;
    line-height: 1.55;
    color: var(--mg-muted);
}

.article-prose .sources > h2 {
    margin: 1.4em 0 0.6em;
    font-size: var(--mg-size-h3);
    line-height: var(--mg-leading-snug);
}

.article-prose .sources li {
    margin-bottom: 0.45em;
}

.article-prose .sources a {
    overflow-wrap: anywhere;
}

/* ---------- Next step: MedGermany's own text, set apart by two hairlines, not boxed ---------- */

.article-prose .next-step {
    margin: 2.6em 0;
    padding: 1.4em 0 1.5em;
    border-block: 1px solid var(--mg-line-strong);
}

.article-prose .next-step > :first-child {
    margin-top: 0;
}

.article-prose .next-step > :last-child {
    margin-bottom: 0;
}

.article-prose .next-step > h2,
.article-prose .next-step > h3 {
    margin: 0 0 0.5em;
    font-size: var(--mg-size-h3);
    line-height: var(--mg-leading-snug);
}

/* ---------- Small screens ---------- */

@media (max-width: 575px) {
    .article-prose h2 {
        margin-top: 2.3em;
    }

    .article-prose .callout {
        padding-inline: 1.05em;
    }

    .article-prose ul,
    .article-prose ol {
        padding-left: 1.3em;
    }

}

@media print {
    .article-prose .table-scroll {
        overflow: visible;
        background: none;
    }
}
