/* ============================================================
   Wiki shared stylesheet — extends site.css tokens.
   Two layouts live here:
   1. The HUB grid (.hub-*)
   2. The ARTICLE column (.art-*)
   Top bar comes from site.css so the public site keeps one header.
   ============================================================ */

body::before { display: none; }
body { line-height: 1.65; }

.topbar .nav a:focus-visible,
.art a:focus-visible,
.wiki-list a:focus-visible,
.home-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* ===== CONTAINERS ===== */
.wrap-hub { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-art { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.wrap-art-wide { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ===== BREADCRUMB ===== */
.crumb {
  padding: 32px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.crumb a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.crumb a:hover { color: var(--gold); text-decoration-color: var(--gold); }

/* ===== HUB INTRO ===== */
.hub-intro { padding: 32px 0 56px; max-width: 720px; }
.hub-intro h1 {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: 0;
  margin: 0 0 20px;
  font-weight: 400;
  text-wrap: balance;
}
.hub-intro h1 em { font-style: italic; color: var(--gold); }
.hub-intro p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 16px;
}
.hub-intro p:last-child { margin-bottom: 0; }
.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}
.guide-links a {
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  text-transform: uppercase;
}
.guide-links a:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

/* ===== HUB SECTIONS ===== */
.hub-sec {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}
.hub-sec__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 8px;
}
.hub-sec__title {
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0 0 24px;
  font-weight: 400;
}

/* ===== HUB LINK LISTS ===== */
.hub-cards {
  display: grid;
  gap: 10px 34px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.hub-card {
  display: flex;
  flex-direction: column;
  padding: 4px 0 12px;
  text-decoration: none;
  color: inherit;
  transition: color 150ms ease-out;
  position: relative;
  min-height: 0;
}
.hub-card:hover h3 { color: var(--gold); }
.hub-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0 0 6px;
  font-weight: 400;
  color: var(--ink);
  transition: color 150ms ease-out;
}
.hub-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  flex: 1;
}
.hub-card__meta {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--blue);
}
.hub-card[data-status]::after {
  content: none;
  display: none;
}
.hub-card[data-status="live"]::after { color: var(--ok); }
.hub-card[data-status="draft"]::after { color: var(--warn); content: "in arbeit"; }
.hub-card[data-status="plan"]::after { color: var(--blue); content: "geplant"; }

/* ===== SIMPLE WIKI INDEX ===== */
.wiki-index { padding-bottom: 36px; }
.wiki-chapter {
  border-top: 1px solid var(--line);
  padding: 40px 0;
}
.wiki-chapter h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 18px;
}
.wiki-note {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 18px;
  max-width: 70ch;
}
.wiki-list {
  list-style: none;
  margin: 0;
  max-width: 840px;
  padding: 0;
}
.wiki-list li {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(180px, 260px) 1fr;
  padding: 15px 0;
  transition: border-color 150ms ease-out;
}
.wiki-list li:hover { border-top-color: var(--line-strong); }
.wiki-list li:last-child { border-bottom: 1px solid var(--line); }
.wiki-list a {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.25;
  text-decoration: none;
}
.wiki-list span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.wiki-list a:hover { color: var(--gold); }
.wiki-list.compact li { grid-template-columns: minmax(180px, 240px) 1fr; }

/* ===== ARTICLE ===== */
.art-head { padding: 8px 0 24px; }
.art-head h1 {
  font-family: var(--font-display);
  font-size: 46px;
  line-height: 1.12;
  letter-spacing: 0;
  margin: 12px 0 16px;
  font-weight: 400;
  text-wrap: balance;
}
.art-lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
  text-wrap: pretty;
}

.art {
  padding-bottom: 48px;
}
.art h2 {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
  margin: 56px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-weight: 400;
}
.art h3 {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.25;
  margin: 28px 0 8px;
  color: var(--ink);
  font-weight: 400;
}
.art p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 14px 0;
  max-width: 68ch;
}
.art p strong { color: var(--ink); font-weight: 600; }
.art p em { color: var(--gold); font-style: italic; }
.art a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.art a:hover { color: var(--gold); text-decoration-color: var(--gold); }
.art ul, .art ol { padding-left: 1.4rem; max-width: 68ch; }
.art li { margin: 6px 0; font-size: 16px; color: var(--ink-2); line-height: 1.65; }
.art li strong { color: var(--ink); font-weight: 600; }
.art li em { color: var(--gold); font-style: italic; }

/* ===== TL;DR BOX ===== */
.tldr {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 18px;
  margin: 30px 0 34px;
}
.tldr__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.tldr p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: none;
}

/* ===== TABLES ===== */
.art table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 14px;
}
.art th, .art td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.art th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--line-strong);
}
.art td { color: var(--ink-2); }
.art td code { font-size: 12.5px; }

/* ===== CODE ===== */
.art code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--panel);
  padding: 1px 6px;
  color: var(--blue);
  border: 1px solid var(--line);
}
.art pre {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(26, 32, 39, 0.72);
  border: 1px solid var(--line);
  padding: 16px 18px;
  overflow-x: auto;
  line-height: 1.55;
  margin: 20px 0;
  color: var(--ink-2);
}
.art pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ===== NEXT-READ BOX ===== */
.art-next {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  margin: 48px 0 24px;
}
.art-next h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--ink);
}
.art-next ul { padding-left: 1.2rem; margin: 0; }
.art-next li { margin: 6px 0; font-size: 15px; color: var(--ink-2); }
.art-next a { color: var(--blue); text-decoration: none; }
.art-next a:hover { color: var(--gold); }

/* ===== STATE-FLOW (ISO 19650 specific) ===== */
.state-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 24px 0;
}
.state-box {
  padding: 14px 0 16px;
}
.state-box__name {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--gold);
  margin-bottom: 6px;
  font-weight: 400;
}
.state-box__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
@media (max-width: 720px) { .state-flow { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .state-flow { grid-template-columns: 1fr; } }

/* ===== TOC (table of contents, for long pages) ===== */
.toc {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin: 24px 0 36px;
}
.toc h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
}
.toc ul { margin: 0; padding-left: 1.2rem; }
.toc li { margin: 4px 0; font-size: 14px; color: var(--ink-2); }
.toc a { color: var(--blue); text-decoration: none; }
.toc a:hover { color: var(--gold); }

/* ===== MAP NOTE (kind-mapping specific) ===== */
.map-note {
  background: rgba(91, 155, 213, 0.06);
  border-left: 3px solid var(--blue);
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

/* ===== SPEC CARDS ===== */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 24px 0;
}
.spec-card {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  min-height: 0;
}
.spec-card:nth-child(1),
.spec-card:nth-child(2) { border-top: 0; }
.spec-card h3 {
  color: var(--ink);
  font-size: 17px;
  margin: 0 0 8px;
}
.spec-card p {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.kind {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--gold);
  background: var(--gold-soft);
  padding: 2px 8px;
  margin-left: 8px;
  border: 1px solid var(--gold-line);
}
@media (max-width: 680px) { .spec-grid { grid-template-columns: 1fr; } }

/* ===== ART FOOTER ===== */
.art-foot {
  border-top: 1px solid var(--line);
  padding: 32px 0 64px;
  font-size: 13px;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.art-foot a { color: var(--muted); }
.art-foot a:hover { color: var(--gold); }

@media (max-width: 820px) {
  .hub-intro h1,
  .art-head h1 { font-size: 38px; }
  .art table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
  .art pre {
    font-size: 12px;
    max-width: 100%;
  }
  .wiki-list li,
  .wiki-list.compact li {
    gap: 4px;
    grid-template-columns: 1fr;
  }
  .spec-card:nth-child(2) { border-top: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .wrap-hub,
  .wrap-art,
  .wrap-art-wide { padding: 0 18px; }
  .crumb { padding-top: 24px; }
  .hub-intro h1,
  .art-head h1 { font-size: 34px; }
  .art-lede,
  .hub-intro p { font-size: 16px; }
  .art h2 {
    font-size: 24px;
    margin-top: 44px;
  }
  .art th,
  .art td {
    padding: 9px 10px;
  }
  .state-flow { grid-template-columns: 1fr; }
}
