/* ===== WISSEN-PAGE (specific to knowledge articles) ===== */
html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  margin: 0; padding: 0;
}

/* Top navigation (mirrors mainpage) */
.wp-nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg-primary) 70%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.wp-nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 16px 40px;
  display: flex; align-items: center; justify-content: space-between;
}
.wp-nav-logo {
  font-weight: var(--fw-bold);
  font-size: 18px;
  color: var(--text-primary);
  text-decoration: none;
}
.wp-nav-actions a {
  margin-left: 28px;
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
}
.wp-nav-actions a:hover { color: var(--text-primary); }
.wp-nav-cta {
  margin-left: 24px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--electric), var(--electric-2));
  color: #fff !important;
  border-radius: 10px;
  font-size: 14px;
  font-weight: var(--fw-semibold);
}

/* ===== ARTICLE HERO ===== */
.article-hero {
  padding: 80px 24px 40px;
  max-width: 820px;
  margin: 0 auto;
}
.article-breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.article-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.article-breadcrumb a:hover { color: var(--electric-2); }
.article-breadcrumb .sep { margin: 0 8px; opacity: 0.6; }

.article-cat {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  color: var(--electric-2);
  padding: 6px 12px;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 999px;
  margin-bottom: 22px;
}

.article-hero h1 {
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.032em;
  font-weight: var(--fw-black);
  color: var(--text-primary);
  margin: 0 0 22px;
}

/* TL;DR — Citable summary block (Perplexity-magnet) */
.tldr {
  margin: 0 0 28px;
  padding: 22px 26px;
  border-left: 4px solid var(--electric-2);
  background: color-mix(in srgb, var(--bg-elevated) 80%, transparent);
  border-radius: 0 12px 12px 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-primary);
}
.tldr strong { color: var(--electric-2); }

.article-meta-bar {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.article-meta-bar .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-muted); opacity: 0.6;
}

/* ===== TOC (Table of Contents) ===== */
.article-toc {
  max-width: 720px;
  margin: 36px auto;
  padding: 24px 28px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.article-toc h2 {
  margin: 0 0 14px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.article-toc ol {
  margin: 0; padding: 0 0 0 20px;
  font-size: 15px;
  line-height: 1.8;
}
.article-toc a {
  color: var(--text-primary);
  text-decoration: none;
}
.article-toc a:hover { color: var(--electric-2); }

/* ===== ARTICLE BODY ===== */
.article-content {
  padding: 0 24px 80px;
}
.article-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-secondary);
}
.article-body > p { margin-bottom: 22px; }
.article-body > p strong { color: var(--text-primary); font-weight: var(--fw-semibold); }

.article-body h2 {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.022em;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 56px 0 18px;
  scroll-margin-top: 80px;
}
.article-body h3 {
  font-size: 20px;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin: 36px 0 14px;
}
.article-body h4 {
  font-size: 17px;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin: 28px 0 12px;
}

.article-body ul, .article-body ol {
  margin: 0 0 22px 22px; padding: 0;
}
.article-body ul li, .article-body ol li {
  margin-bottom: 10px; padding-left: 8px;
}
.article-body ul li::marker { color: var(--electric-2); }

.article-body blockquote {
  margin: 28px 0;
  padding: 18px 22px;
  border-left: 3px solid var(--electric-2);
  background: color-mix(in srgb, var(--bg-elevated) 80%, transparent);
  border-radius: 0 8px 8px 0;
  color: var(--text-primary);
}
.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--electric-2);
}
.article-body pre {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}
.article-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
  background: var(--bg-elevated);
  border-radius: 10px;
  overflow: hidden;
}
.article-body table th {
  text-align: left;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--electric-2) 12%, var(--bg-elevated));
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.article-body table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.article-body table tr:last-child td { border-bottom: none; }

.article-body a {
  color: var(--electric-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.article-body a:hover { text-decoration-thickness: 2px; }

/* ===== AUTHOR BIO ===== */
.author-bio {
  max-width: 720px;
  margin: 60px auto 40px;
  padding: 28px;
  background: var(--bg-elevated);
  border-radius: 16px;
  border-left: 4px solid var(--electric-2);
}
.author-bio-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.author-bio-name {
  font-size: 22px;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin: 0 0 12px;
}
.author-bio-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}
.author-bio-text strong { color: var(--text-primary); }
.author-bio-disclaimer {
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  margin: 16px 0 0;
}

/* ===== RELATED ARTICLES ===== */
.related-articles {
  max-width: 720px;
  margin: 60px auto 40px;
  padding: 0 24px;
}
.related-articles h2 {
  font-size: 22px;
  margin: 0 0 20px;
  color: var(--text-primary);
}
.related-list {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0; margin: 0;
}
.related-list li a {
  display: block;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.related-list li a:hover {
  border-color: var(--electric-2);
  transform: translateY(-2px);
}

/* ===== SOURCES ===== */
.sources-block {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 24px;
  font-size: 14px;
  color: var(--text-secondary);
}
.sources-block h2 {
  font-size: 18px;
  color: var(--text-primary);
  margin: 0 0 16px;
}
.sources-block ol { padding-left: 20px; }
.sources-block li { margin-bottom: 10px; line-height: 1.6; }

/* ===== CTA at bottom ===== */
.article-cta {
  max-width: 720px;
  margin: 60px auto;
  padding: 36px 32px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--electric) 18%, var(--bg-elevated)), var(--bg-elevated));
  border: 1px solid var(--electric-2);
  border-radius: 16px;
  text-align: center;
}
.article-cta h2 {
  font-size: 26px;
  margin: 0 0 12px;
  color: var(--text-primary);
}
.article-cta p {
  margin: 0 0 20px;
  color: var(--text-secondary);
}
.article-cta .btn {
  display: inline-block;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--electric), var(--electric-2));
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: var(--fw-semibold);
}

/* ===== FOOTER ===== */
.wp-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 60px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.wp-footer a {
  color: var(--text-secondary);
  margin: 0 12px;
  text-decoration: none;
}
.wp-footer a:hover { color: var(--text-primary); }

/* ===== KNOWLEDGE / WISSEN HUB (index card grid) ===== */
.hub-hero { max-width: 820px; margin: 0 auto; padding: 80px 24px 16px; }
.hub-hero h1 {
  font-size: clamp(32px, 4.4vw, 52px); line-height: 1.1; letter-spacing: -0.03em;
  font-weight: var(--fw-black); color: var(--text-primary); margin: 0 0 18px;
}
.hub-hero .lead { font-size: 18px; line-height: 1.6; color: var(--text-secondary); max-width: 680px; margin: 0; }
.hub-grid {
  max-width: 820px; margin: 26px auto 40px; padding: 0 24px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.hub-card {
  display: block; padding: 24px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 14px; text-decoration: none;
  transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.hub-card:hover { border-color: var(--electric-2); transform: translateY(-3px); }
.hub-card .hc-cat {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--electric-2);
}
.hub-card h2 { font-size: 19px; font-weight: var(--fw-bold); color: var(--text-primary); margin: 10px 0 8px; letter-spacing: -0.01em; }
.hub-card p { font-size: 14.5px; line-height: 1.55; color: var(--text-muted); margin: 0; }

@media (max-width: 760px) {
  .wp-nav-inner { padding: 14px 20px; }
  .wp-nav-actions a:not(.wp-nav-cta) { display: none; }
  .article-hero { padding: 60px 20px 30px; }
  .article-toc { margin: 28px auto; padding: 20px; }
  .hub-grid { grid-template-columns: 1fr; }
  .hub-hero { padding: 60px 20px 12px; }
}

/* ============================================================
   MOBILE TABLE REFLOW  (added 2026-07-17)
   Article tables are up to ~664px wide. Below ~760px they cannot shrink, which
   makes the browser zoom the ENTIRE page out (measured: 390px viewport -> 543-689px
   layout viewport => all body text tiny). Reflow each row into a stacked
   label/value card instead. Labels come from data-label (= the column's <th>).
   ============================================================ */
@media (max-width: 760px) {
  .article-body table {
    display: block;
    width: 100%;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    font-size: 14px;
  }
  .article-body table thead { display: none; }
  .article-body table tbody { display: block; }
  .article-body table tr {
    display: block;
    margin: 0 0 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }
  .article-body table td {
    display: block;
    width: auto;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
  }
  .article-body table tr td:last-child { border-bottom: none; }
  .article-body table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    font-size: 10.5px;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }
}
