/* ============================================================
   article.css – Styles für docs/article.html
   Spiegel des Layouts aus diagramm.css (Header max-width 960px).
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --c1: #0f67cf;
  --c2: #ff973d;
  --c3: #ff6454;
  --black: #111111;
  --g1: #e3e3e3;
  --g2: #e6e6e6;
  --g3: #bbbbbb;
  --g4: #777777;
  --white: #ffffff;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", "Courier New", monospace;
  --content-max: 720px;   /* Lesespalte innerhalb des 960er Headers */
  --header-max: 960px;    /* gleiche Breite wie diagramm.html */
  --r: 6px;

  /* Artikel-spezifische Akzente */
  --color-text: #1a1a1a;
  --color-muted: #5a5a5a;
  --color-accent: #0a66c2;
  --color-accent-soft: #eef3fa;
  --color-rule: #e3e3e3;
  --color-code-bg: #f6f8fa;
  --color-code-border: #e1e4e8;
  --color-quote-bar: #0a66c2;
  --color-quote-bg: #f7f9fc;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--g1);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Header (analog diagramm.html) ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--header-max);
  margin: 32px auto 28px;
  gap: 24px;
}

/* ---------- Zurück-Link ---------- */
.article-back-wrap {
  max-width: var(--header-max);
  margin: 0 auto 16px;
  padding: 0 24px;
}

.article-back {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.article-back:hover {
  color: var(--color-text);
  text-decoration: underline;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--black);
  letter-spacing: normal;
  line-height: 1.2;
  margin: 0;
}
.page-sub {
  color: var(--g4);
  font-size: 13px;
  margin: 4px 0 0;
  max-width: 600px;
  line-height: 1.4;
}
.page-logo {
  width: 72px;
  height: 72px;
  flex: none;
}

/* ---------- Article-Wrapper (Lesespalte) ---------- */
.article {
  max-width: var(--header-max);
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--g2);
  border-radius: 10px;
  padding: clamp(28px, 4vw, 48px) clamp(24px, 5vw, 64px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.article > * {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

.article > figure,
.article > img {
  max-width: 100%;
}

/* ---------- Typografie ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font);
  color: #111;
  line-height: 1.25;
  margin: 2.2em 0 0.6em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.2em;
}

h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.7rem);
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: 0.3em;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.35rem);
}

h4 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1.1em;
}

h1 + p,
h2 + p,
h3 + p {
  margin-top: 0.2em;
}

strong,
b {
  font-weight: 600;
  color: #111;
}

em,
i {
  font-style: italic;
  color: #333;
}

small {
  font-size: 0.85em;
  color: var(--color-muted);
}

/* ---------- Listen ---------- */
ul,
ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
}

li {
  margin: 0.35em 0;
}

li::marker {
  color: var(--color-muted);
}

/* ---------- Links ---------- */
a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  word-break: break-word;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* ---------- Zitate ---------- */
blockquote {
  margin: 1.6em 0;
  padding: 0.9em 1.2em;
  background: var(--color-quote-bg);
  border-left: 4px solid var(--color-quote-bar);
  border-radius: 4px;
  color: #2a2a2a;
  font-style: italic;
}

blockquote p {
  margin: 0.4em 0;
}

blockquote p:first-child {
  margin-top: 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

q {
  quotes: "\201C" "\201D" "\2018" "\2019";
}

/* ---------- Code ---------- */
code,
pre,
kbd,
samp {
  font-family: var(--mono);
  font-size: 0.92em;
}

code {
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: #b3263e;
}

pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 6px;
  padding: 1em 1.1em;
  overflow-x: auto;
  line-height: 1.5;
  margin: 1.4em 0;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 0.95em;
}

/* ---------- Bilder (nur im Artikel-Body, nicht im Header/Logo) ---------- */
.article img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  margin: 1.8em auto;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 18px rgba(0, 0, 0, 0.05);
  background: var(--white);
}

.article a img {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Bildunterschriften via <figure><figcaption>…</figcaption></figure>.
   In MD optional so:
     ![Alt](bild.png)
     *Bildunterschrift kursiv*
*/
figure {
  margin: 1.8em 0;
}

figure img {
  margin: 0 auto;
}

figcaption {
  margin-top: 0.6em;
  text-align: center;
  font-size: 0.88em;
  color: var(--color-muted);
  line-height: 1.4;
  font-style: italic;
}

figcaption em,
figcaption i {
  color: var(--color-muted);
}

/* ---------- Tabellen (nativ, selten genutzt) ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.95em;
}

th,
td {
  text-align: left;
  padding: 0.55em 0.7em;
  border-bottom: 1px solid var(--color-rule);
}

th {
  font-weight: 600;
  background: #fafafa;
}

tbody tr:nth-child(even) td {
  background: #fafbfc;
}

/* ---------- Sonstiges ---------- */
hr {
  border: 0;
  height: 1px;
  background: var(--color-rule);
  margin: 2.5em 0;
}

kbd {
  background: #f3f3f3;
  border: 1px solid #d0d0d0;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05em 0.4em;
  font-size: 0.85em;
}

mark {
  background: #fff3a8;
  padding: 0 0.15em;
  border-radius: 2px;
}

/* ---------- Responsives Feintuning ---------- */
@media (max-width: 720px) {
  body {
    padding: 20px 12px 48px;
  }

  .article {
    padding: 24px 20px;
  }

  .page-logo {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16.5px;
  }

  h1 {
    letter-spacing: -0.015em;
  }

  pre {
    font-size: 0.85em;
  }
}

/* ---------- Header: nur zentriertes Logo (Titel/Subline entfernt) ---------- */
.page-header--centered {
  justify-content: center;
}

/* ---------- Reading-Progress-Bar (oben) ---------- */
html {
  scroll-behavior: smooth;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--color-accent);
  z-index: 1100;
  transition: width 0.08s linear;
}

/* ---------- Scroll-to-top ---------- */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, background 0.15s;
}

/* Bold-Chevron nach oben (CSS, crisp) */
.scroll-top::before {
  content: "";
  width: 12px;
  height: 12px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: translateY(2px) rotate(-45deg);
}

.scroll-top[hidden] {
  display: none;
}

.scroll-top:hover {
  transform: translateY(-2px);
  background: #333;
}

@media (max-width: 600px) {
  .scroll-top { bottom: 16px; right: 16px; width: 42px; height: 42px; }
}

/* ---------- Footer ---------- */
.page-footer {
  background: #4d4d4d;
  color: #ffffff;
  font-size: 17px;
  height: 85px;
  display: flex;
  align-items: center;
  font-weight: 500;
  margin-top: 48px;;
}

.page-footer__inner {
  width: 100%;
  max-width: var(--header-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-footer__copy {
  margin: 0;
}

.page-footer__links {
  display: flex;
  gap: 24px;
}

.page-footer__links a {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.15s;
}

.page-footer__links a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .page-footer {
    height: auto;
    padding: 20px 0;
  }

  .page-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- Print ---------- */
@media print {
  body {
    background: var(--white);
    padding: 0;
  }

  .article {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  a {
    color: #000;
  }

  .reading-progress,
  .scroll-top {
    display: none !important;
  }
}
