/* Artikel (/artikel, /artikel/<slug>) und Artikel-Teaser auf der Startseite.
   Eigene Datei statt Tailwind-Klassen, damit neue Artikel keinen CSS-Build brauchen.
   Diagrammfarben kommen aus charts.json (Kategorialpalette, siehe build_article.py). */

.ar-page {
  --ar-ink: #0f172a;
  --ar-ink-2: #334155;
  --ar-muted: #64748b;
  --ar-line: #e2e8f0;
  --ar-soft: #f8fafc;
  --ar-link: #1d4ed8;
  --ar-hl: #eff6ff;
  /* gleiche Maße wie die Startseite (px-6 py-8, max-w-screen-xl, gap-8, lg:grid-cols-3):
     der Artikel beginnt genau dort, wo links der Hauptbereich der Startseite beginnt */
  padding: 32px 24px 64px;
  color: var(--ar-ink);
  background: white;
}
.ar-grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.ar-main { min-width: 0; }
.ar-side { min-width: 0; }
@media (min-width: 1024px) {
  .ar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ar-main { grid-column: span 2 / span 2; }
  .ar-side { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding-top: 38px; }
}
@media (max-width: 1023px) { .ar-side .ar-toc { display: none; } }

.ar-crumbs { font-size: 13px; color: var(--ar-muted); margin-bottom: 18px; }
.ar-crumbs a { color: var(--ar-muted); text-decoration: none; }
.ar-crumbs a:hover { color: var(--ar-link); text-decoration: underline; }
.ar-preview { background: #fef3c7; border: 1px solid #fcd34d; color: #78350f; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }

.ar-kicker { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ar-muted, #64748b); margin-bottom: 6px; }
.ar-header h1 { font-size: clamp(26px, 4.2vw, 38px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin: 0 0 14px; max-width: 26ch; }
.ar-lead { font-size: 19px; line-height: 1.6; color: var(--ar-ink-2); margin: 0 0 14px; max-width: 68ch; }
.ar-meta { font-size: 13.5px; color: var(--ar-muted); margin: 0; }
.ar-header { border-bottom: 1px solid var(--ar-line); padding-bottom: 22px; margin-bottom: 26px; }

.ar-toc { border-left: 2px solid var(--ar-line); padding: 2px 0 2px 16px; margin-bottom: 30px; }
.ar-toc-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ar-muted); margin: 0 0 8px; }
.ar-toc ol { margin: 0; padding-left: 1.2rem; list-style: decimal; }
.ar-toc li { font-size: 14.5px; line-height: 1.45; padding: 3px 0; color: var(--ar-muted); }
.ar-toc a { color: var(--ar-link); text-decoration: none; }
.ar-toc a:hover { text-decoration: underline; }

/* Fließtext: schmal für Lesbarkeit, Abbildungen dürfen breiter sein */
.ar-body > h2, .ar-body > h3, .ar-body > p, .ar-body > ul, .ar-body > ol, .ar-body > blockquote { max-width: 76ch; }
.ar-body h2 { font-size: 24px; line-height: 1.25; font-weight: 750; letter-spacing: -.01em; margin: 42px 0 12px; scroll-margin-top: 72px; }
.ar-body h3 { font-size: 18px; font-weight: 700; margin: 28px 0 8px; scroll-margin-top: 72px; }
.ar-body p, .ar-body li { font-size: 17px; line-height: 1.7; color: #1e293b; }
.ar-body p { margin: 0 0 16px; }
.ar-body ul, .ar-body ol { margin: 0 0 18px; padding-left: 1.4rem; }
.ar-body ul { list-style: disc; }
.ar-body ol { list-style: decimal; }
.ar-body li + li { margin-top: 6px; }
.ar-body a { color: var(--ar-link); text-decoration: underline; text-underline-offset: 2px; }
.ar-body strong { font-weight: 700; color: var(--ar-ink); }
.ar-body blockquote { border-left: 4px solid var(--ar-ink); background: white; border-radius: 0 8px 8px 0; margin: 24px 0; padding: 14px 20px; }
.ar-body blockquote p { font-size: 19px; line-height: 1.55; margin: 0; color: var(--ar-ink); }

.ar-box { border-radius: 12px; padding: 18px 20px 4px; margin: 26px 0; border: 1px solid var(--ar-line); background: white; max-width: 76ch; }
.ar-box-title { font-size: 12px !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ar-muted) !important; margin: 0 0 8px !important; }
.ar-box p, .ar-box li { font-size: 15.5px; line-height: 1.65; }
.ar-box-info { background: var(--ar-soft); }
.ar-box-methode { background: var(--ar-soft); border-style: dashed; }
.ar-box-fazit { background: #f0f7ff; border-color: #bfdbfe; }
.ar-box-fazit .ar-box-title { color: #1e40af !important; }
/* TL;DR: Kurzfassung ganz oben im Artikel */
.ar-box-tldr { background: #fffbeb; border-color: #fcd34d; border-left: 4px solid #d97706; margin-top: 0; }
.ar-box-tldr .ar-box-title { color: #92400e !important; }
.ar-box-tldr p, .ar-box-tldr li { font-size: 16px; }

/* Abbildungen */
.ar-figure { margin: 30px 0 34px; min-width: 0; }
.ar-figure-head { margin-bottom: 8px; }
.ar-figure-title { font-size: 16px !important; font-weight: 700; color: var(--ar-ink) !important; margin: 0 0 2px !important; line-height: 1.35 !important; }
.ar-figure-sub { font-size: 13.5px !important; color: var(--ar-muted) !important; margin: 0 !important; line-height: 1.45 !important; }
a.ar-figure-link, .ar-figure-plain { display: block; background: white; border: 1px solid var(--ar-line); border-radius: 12px; padding: 16px 16px 10px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.ar-figure-link:hover, a.ar-figure-link:focus-visible { border-color: #94a3b8; box-shadow: 0 12px 28px -20px rgba(15, 23, 42, .5); outline: none; }
.ar-open { display: flex; justify-content: flex-end; font-size: 13px; font-weight: 600; color: var(--ar-link); margin-top: 4px; }
a.ar-figure-link:hover .ar-open { text-decoration: underline; }
.ar-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px !important; color: var(--ar-ink-2) !important; margin: 0 0 6px !important; }
.ar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ar-legend i { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.ar-chart { position: relative; min-height: 120px; }
.ar-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ar-chart text { font-family: inherit; }
.ar-figure figcaption { font-size: 13px; line-height: 1.55; color: var(--ar-muted); margin-top: 8px; max-width: 80ch; }
.ar-source { display: block; margin-top: 2px; font-style: italic; }
.ar-studio-link { display: inline-block; font-size: 13px; font-weight: 600; color: var(--ar-link); text-decoration: none; margin-top: 6px; }
.ar-studio-link:hover { text-decoration: underline; }

.ar-values { margin-top: 6px; }
.ar-values summary { font-size: 13px; color: var(--ar-muted); cursor: pointer; display: inline-block; padding: 2px 0; }
.ar-values summary:hover { color: var(--ar-link); }
.ar-values[open] summary { margin-bottom: 6px; }

.ar-table-wrap { overflow-x: auto; max-width: 100%; background: white; border: 1px solid var(--ar-line); border-radius: 12px; }
.ar-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.ar-table th, .ar-table td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--ar-line); white-space: nowrap; }
.ar-table tbody tr:last-child th, .ar-table tbody tr:last-child td { border-bottom: 0; }
.ar-table thead th { font-size: 12px; font-weight: 600; color: var(--ar-muted); background: var(--ar-soft); vertical-align: bottom; white-space: normal; line-height: 1.3; }
.ar-table .ar-left { text-align: left; }
.ar-table td.ar-left, .ar-table tbody th.ar-left { white-space: normal; min-width: 9em; }
.ar-table tbody th { font-weight: 500; }
.ar-table tr.ar-hl th, .ar-table tr.ar-hl td { background: var(--ar-hl); font-weight: 650; }

.ar-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 36px 0 0; }
.ar-tags span { font-size: 12.5px; background: white; border: 1px solid var(--ar-line); color: var(--ar-ink-2); border-radius: 999px; padding: 3px 10px; }
.ar-more { border-top: 1px solid var(--ar-line); padding-top: 18px; }
.ar-more-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ar-muted); margin: 0 0 8px; }
.ar-more li { font-size: 15px; margin: 4px 0; }
.ar-more a { color: var(--ar-link); }
.ar-more time { color: var(--ar-muted); font-size: 13px; margin-left: 6px; }

/* Tooltip der Diagramme */
.ar-tooltip { position: fixed; z-index: 60; pointer-events: none; background: white; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 10px 24px -12px rgba(15, 23, 42, .35); padding: 8px 10px; font-size: 13px; line-height: 1.45; color: #0f172a; max-width: 280px; }
.ar-tooltip b { font-weight: 700; }
.ar-tooltip .ar-tt-muted { color: #64748b; }
.ar-tooltip .ar-tt-row { display: flex; align-items: center; gap: 6px; }
.ar-tooltip .ar-tt-row i { width: 9px; height: 9px; border-radius: 999px; display: inline-block; flex: none; }

/* Übersicht /artikel */
.ar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ar-card { display: grid; gap: 6px; background: white; border: 1px solid var(--ar-line); border-radius: 12px; padding: 18px 20px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.ar-card:hover { border-color: #94a3b8; box-shadow: 0 12px 28px -20px rgba(15, 23, 42, .5); }
.ar-card .ar-kicker { margin: 0; }
.ar-card-title { font-size: 21px; font-weight: 750; line-height: 1.3; }
.ar-card-teaser { display: block; font-size: 15.5px; line-height: 1.6; color: var(--ar-ink-2); }

/* Startseite: Artikel-Feed im Hauptbereich, neueste oben */
.ar-home { margin-bottom: 32px; }
.ar-home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ar-home-head h2 { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #475569; margin: 0; }
.ar-home-head a { font-size: 13px; font-weight: 600; color: #2563eb; text-decoration: none; }
.ar-home-head a:hover { text-decoration: underline; }
.ar-home-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ar-home-item { display: grid; gap: 6px; padding: 18px 22px; border: 1px solid #e2e8f0; border-radius: 12px; background: white; color: #0f172a; text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); transition: border-color .15s, box-shadow .15s; }
.ar-home-item:hover { border-color: #93c5fd; box-shadow: 0 2px 10px rgba(37, 99, 235, .08); }
.ar-home-item-new { border-left: 4px solid #2563eb; }
.ar-home-meta { font-size: 12.5px; color: #64748b; }
.ar-home-title { font-size: 20px; font-weight: 750; line-height: 1.3; letter-spacing: -.01em; }
.ar-home-item:hover .ar-home-title { text-decoration: underline; text-underline-offset: 3px; }
.ar-home-body, .ar-card-body { display: block; }
.ar-home-body::after, .ar-card-body::after { content: ""; display: table; clear: both; }
.ar-home-teaser { display: block; font-size: 15px; line-height: 1.6; color: #475569; }
.ar-home-more { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; color: #2563eb; }

/* Vorschau-Diagramm: ein Drittel der Textbreite, rechts im Text */
.ar-thumb { float: right; width: 34%; min-width: 220px; margin: 4px 0 8px 20px; padding: 10px 10px 4px; border: 1px solid #e2e8f0; border-radius: 10px; background: white; display: block; }
.ar-thumb-title { display: block; font-size: 12px; font-weight: 700; line-height: 1.35; color: #334155; margin-bottom: 4px; }
.ar-thumb .ar-legend { display: flex; font-size: 11.5px !important; gap: 2px 10px; margin: 0 0 2px !important; }
.ar-thumb .ar-chart { display: block; min-height: 90px; }
@media (max-width: 640px) {
  .ar-thumb { float: none; width: auto; min-width: 0; margin: 4px 0 10px; }
}

@media (max-width: 640px) {
  .ar-page { padding-top: 18px; }
  .ar-lead { font-size: 17px; }
  .ar-body p, .ar-body li { font-size: 16px; }
  a.ar-figure-link, .ar-figure-plain { padding: 12px 10px 8px; }
  .ar-table { font-size: 13.5px; }
  .ar-table th, .ar-table td { padding: 8px 9px; }
}
@media print {
  .ar-crumbs, .ar-open, .ar-values, .ar-more, .ar-studio-link { display: none; }
  a.ar-figure-link { border: 0; padding: 0; }
}
