/*
  Ratgeber-Artikelseite (article.php): Inhaltsverzeichnis, Tabellen,
  Ueberschriften-Anker, Hinweisbox. Eigene Datei statt style.css, damit sie
  unabhaengig von parallelen Aenderungen an style.css gepflegt werden kann.
  Nutzt ausschliesslich die Theme-Variablen (theme-nightreel.css).
*/

/* ---------- Layout: Text links, Inhaltsverzeichnis rechts am Seitenrand ---------- */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 56px;
    align-items: start;
}
.article-main { min-width: 0; }
.article-toc-col {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-strong) transparent;
}
/* Schmale Bildschirme: einspaltig, Inhaltsverzeichnis vor dem Text (eingeklappt, siehe article-toc.js) */
@media (max-width: 1000px) {
    .article-layout { grid-template-columns: minmax(0, 1fr); }
    .article-toc-col { position: static; max-height: none; overflow: visible; order: -1; margin-bottom: 24px; }
}

/* ---------- Ueberschriften ---------- */
.article-body h3 {
    font-size: 1.5rem;
    margin: 44px 0 14px;
    padding-top: 6px;
    scroll-margin-top: 90px;
}
.article-body h4 {
    font-size: 1.15rem;
    margin: 28px 0 10px;
    line-height: 1.3;
    scroll-margin-top: 90px;
    color: var(--color-text);
}
/* Die Spalte fuer Fliesstext bleibt schmal, Tabellen/TOC duerfen die volle
   Spaltenbreite nutzen. */
.article-body { max-width: 820px; }

/* ---------- Inhaltsverzeichnis (nummeriert, ausklappbar) ---------- */
.toc {
    margin: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.toc__summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.toc__summary::-webkit-details-marker { display: none; }
.toc__summary::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
    margin-top: -3px;
}
.toc[open] > .toc__summary::after { transform: rotate(-135deg); margin-top: 3px; }
.toc__summary:hover { color: var(--color-text); }
.toc__summary:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: -2px; border-radius: var(--radius-md); }

.toc__list, .toc__sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}
.toc__list { padding: 8px 14px 10px; border-top: 1px solid var(--color-border); }
.toc__sublist { margin: 0 0 2px 22px; }
.toc__item { margin: 0; padding: 0; }
.toc__link {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    line-height: 1.3;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
}
.toc__link:hover .toc__text { text-decoration: underline; color: var(--color-accent-light); }
.toc__num {
    flex: 0 0 auto;
    min-width: 2em;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}
.toc__sublist .toc__link { font-size: 0.88rem; color: var(--color-text-muted); }

/* ---------- Tabellen im Seitendesign ---------- */
.table-scroll {
    margin: 22px 0 26px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.5;
    min-width: 420px;
}
.article-body th,
.article-body td {
    text-align: left;
    vertical-align: top;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
}
.article-body thead th {
    background: var(--color-surface-alt);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--color-border-strong);
}
.article-body tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.article-body tbody tr:hover { background: rgba(var(--color-accent-rgb), 0.35); }
.article-body tbody tr:last-child td { border-bottom: 0; }
.article-body tbody th { color: var(--color-text); font-weight: 600; }
.article-body td:first-child { color: var(--color-text); }

/* ---------- Hinweisbox unter dem Artikel ---------- */
.article-disclaimer {
    margin: 40px 0 8px;
    padding: 16px 18px;
    max-width: 820px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent-light);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
    line-height: 1.6;
}
.article-disclaimer strong { color: var(--color-text); }

@media (max-width: 600px) {
    .article-body h3 { font-size: 1.3rem; margin-top: 36px; }
    .article-body th, .article-body td { padding: 10px 12px; }
}

/* Links im Fliesstext: Amber + dezente Unterstreichung (erkennbar auch ohne Farbwahrnehmung) */
.article-body a {
    text-decoration: underline;
    text-decoration-color: rgba(255, 178, 0, 0.45);
    text-underline-offset: 3px;
}
.article-body a:hover { text-decoration-color: currentColor; }
