/* ============================================================
   RAG vysvětlený lidsky
   Sdílený stylesheet pro celý web (rag.pprojects.cz)
   Pavel Horák, 2026
   ============================================================ */

/* ============================================================
   1. Design tokens
   ============================================================ */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --content-max: 720px;
  --content-max-wide: 880px;
  --layout-max: 1400px;
  --sidebar-width: 260px;
  --header-height: 64px;

  --t-fast: 120ms ease;
  --t-med: 240ms ease;
}

[data-theme="light"] {
  --bg: #f7f6f2;
  --bg-elevated: #ffffff;
  --surface: #efeee8;
  --surface-2: #e6e4dc;
  --text: #1a1a17;
  --text-muted: #5a5a52;
  --text-faint: #8a8a82;
  --rule: #d8d6cc;
  --rule-strong: #b8b6ab;
  --accent: #c44a22;
  --accent-soft: #f5e6dd;
  --accent-hover: #a93c19;
  --selection: rgba(196, 74, 34, 0.18);
  --code-bg: #ece9df;
}

[data-theme="dark"] {
  --bg: #1c1c1a;
  --bg-elevated: #232320;
  --surface: #282824;
  --surface-2: #2f2f2b;
  --text: #ebebe6;
  --text-muted: #a5a59f;
  --text-faint: #6e6e68;
  --rule: #3a3a36;
  --rule-strong: #54544f;
  --accent: #e85d3a;
  --accent-soft: #2a201d;
  --accent-hover: #f47a5a;
  --selection: rgba(232, 93, 58, 0.25);
  --code-bg: #2a2a26;
}

/* ============================================================
   2. Reset a base
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background var(--t-med), color var(--t-med);
}

::selection { background: var(--selection); }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast), color var(--t-fast);
}
a:hover { border-bottom-color: var(--accent); }

/* ============================================================
   3. Reading progress bar
   ============================================================ */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 100;
  transition: width 80ms linear;
}

/* ============================================================
   4. Site header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  height: var(--header-height);
  transition: background var(--t-med), border-color var(--t-med);
}

.site-header-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-decoration: none;
  color: var(--text);
  border-bottom: none;
}
.brand:hover { border-bottom: none; }
.brand .brand-name {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.brand .brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.site-nav a {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 2px;
  border-bottom: none;
  transition: color var(--t-fast), background var(--t-fast);
}
.site-nav a:hover {
  color: var(--text);
  background: var(--surface);
}
.site-nav a.active { color: var(--accent); }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  transition: all var(--t-fast);
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 2px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle svg { width: 18px; height: 18px; }

/* ============================================================
   5. Layout (article pages with TOC sidebar)
   ============================================================ */

.layout {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

/* ============================================================
   6. Sidebar - Table of Contents
   ============================================================ */

.toc {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  padding: 32px 0;
  font-size: 13px;
}
.toc-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 16px;
}
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 8px 0 8px 14px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  border-left: 2px solid var(--rule);
  border-bottom: none;
  transition: all var(--t-fast);
}
.toc a:hover {
  color: var(--text);
  border-left-color: var(--rule-strong);
}
.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.toc-meta {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  line-height: 1.8;
}
.toc-meta dt {
  display: inline;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.toc-meta dd {
  display: inline;
  margin: 0;
  color: var(--text-muted);
}
.toc-meta dd::after { content: ""; display: block; }

/* ============================================================
   7. Article
   ============================================================ */

.article {
  padding: 56px 0 96px;
  max-width: var(--content-max);
}

.article-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::after {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.article-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: var(--text);
}

.lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 28px;
  max-width: 60ch;
  font-weight: 400;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.article-meta strong {
  color: var(--text-muted);
  font-weight: 500;
}

/* Article body */

.article-body p {
  font-size: 17px;
  line-height: 1.72;
  margin: 0 0 22px;
  color: var(--text);
}

.article-body h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 56px 0 20px;
  color: var(--text);
  scroll-margin-top: calc(var(--header-height) + 24px);
  position: relative;
}
.article-body h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 36px 0 14px;
  color: var(--text);
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.anchor-link {
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  border-bottom: none;
  font-size: 18px;
  opacity: 0;
  transition: opacity var(--t-fast), color var(--t-fast);
  text-decoration: none;
  font-weight: 400;
}
.article-body h2:hover .anchor-link { opacity: 1; }
.anchor-link:hover {
  color: var(--accent);
  border-bottom: none;
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}
.article-body em { font-style: italic; }

.article-body ul,
.article-body ol {
  margin: 0 0 22px;
  padding-left: 24px;
}
.article-body li {
  font-size: 17px;
  line-height: 1.72;
  margin-bottom: 8px;
  color: var(--text);
}

/* Default blockquote (díly 1 a 2 - pull-quote stylem) */
.article-body blockquote {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 24px;
  margin: 32px 0;
}

/* Citační blockquote (díl 3 - tlumený, kurzíva, citace klauzulí) */
.article-body.style-quotation blockquote {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--text-muted);
  background: var(--surface);
  border-left: 3px solid var(--rule-strong);
  padding: 16px 24px;
  margin: 24px 0;
  font-style: italic;
}

/* Inline code a code blocks */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text);
}
.article-body pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.article-body pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

/* ============================================================
   8. Article components
   ============================================================ */

/* Closing note (autorský závěr před glosářem nebo read-next) */
.closing-note {
  margin-top: 56px;
  padding: 24px 28px;
  background: var(--surface);
  border-left: 3px solid var(--rule-strong);
  border-radius: 0 4px 4px 0;
}
.closing-note p {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}
.closing-note p strong {
  color: var(--text);
  font-style: normal;
}

/* Audience callouts (díl 3) */
.audience-callout {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 20px 24px;
  margin: 0 0 16px;
  border-radius: 0 4px 4px 0;
}
.audience-callout strong {
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.audience-callout p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}

/* Discussion CTA (díl 3) */
.discussion-cta {
  margin: 56px 0 0;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.discussion-cta h3 {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  color: var(--text);
}
.discussion-cta p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.discussion-cta p:last-child { margin-bottom: 0; }
.discussion-cta a { font-weight: 500; }

/* Reference links [1], [2], etc. */
.ref {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  vertical-align: super;
  text-decoration: none;
  font-weight: 500;
  padding: 1px 5px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  margin: 0 2px;
  line-height: 1;
  border-bottom: 1px solid var(--accent);
  transition: all var(--t-fast);
  display: inline-block;
}
.ref:hover {
  background: var(--accent);
  color: var(--bg);
  border-bottom-color: var(--accent);
}

:target { scroll-margin-top: calc(var(--header-height) + 24px); }
.revision-note:target,
.glossary-entry:target {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding-left: 17px;
}

/* Read-next card */
.read-next {
  margin: 64px 0 0;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  text-decoration: none;
  color: var(--text);
  border-bottom: none;
  transition: all var(--t-fast);
}
.read-next:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  border-bottom: none;
}
.read-next-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.read-next-title {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}
.read-next-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}
.read-next-arrow {
  font-size: 28px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform var(--t-fast);
}
.read-next:hover .read-next-arrow { transform: translateX(4px); }

/* ============================================================
   9. Section blocks (Glosář, Ověření)
   ============================================================ */

.section-block {
  margin: 80px 0 0;
  padding-top: 48px;
  border-top: 1px solid var(--rule);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

.section-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--text);
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.section-intro {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 32px;
  max-width: 60ch;
}

/* Glossary */
.glossary { display: grid; gap: 0; }
.glossary-entry {
  padding: 18px 16px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: calc(var(--header-height) + 24px);
  transition: background var(--t-fast);
}
.glossary-entry:first-child { border-top: 1px solid var(--rule); }
.glossary-entry dt {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.glossary-entry dt em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 400;
  margin-left: 8px;
  letter-spacing: 0.05em;
}
.glossary-entry dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
}
.glossary-entry dd strong { color: var(--text); }
.glossary-entry dd code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 3px;
}
.glossary-entry dd ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.glossary-entry dd li {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 4px;
}

/* Revision notes */
.revisions {
  display: grid;
  gap: 0;
  counter-reset: rev;
}
.revision-note {
  counter-increment: rev;
  padding: 24px 20px 24px 60px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  scroll-margin-top: calc(var(--header-height) + 24px);
  transition: background var(--t-fast);
}
.revision-note:first-child { border-top: 1px solid var(--rule); }
.revision-note::before {
  content: counter(rev, decimal-leading-zero);
  position: absolute;
  left: 16px;
  top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  padding: 2px 6px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.revision-note .rev-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 8px;
}
.revision-note .rev-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.revision-note .rev-body strong { color: var(--text); }
.revision-note .rev-back {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
  border-bottom: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.revision-note .rev-back:hover {
  border-bottom: none;
  color: var(--accent-hover);
}
.revision-note .rev-source {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
  word-break: break-all;
}
.revision-note .rev-source a {
  color: var(--text-muted);
  border-bottom-color: var(--rule-strong);
}

/* ============================================================
   10. Landing page (rozcestník)
   ============================================================ */

.hero {
  max-width: var(--content-max-wide);
  margin: 0 auto;
  padding: 80px 28px 48px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-eyebrow::after {
  content: "";
  width: 48px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
  color: var(--text);
  max-width: 18ch;
}

.hero-lede {
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 20px;
  max-width: 60ch;
}
.hero-lede strong {
  color: var(--text);
  font-weight: 500;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 32px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-meta strong {
  color: var(--text-muted);
  font-weight: 500;
}

/* Episode cards */
.episodes {
  max-width: var(--content-max-wide);
  margin: 0 auto;
  padding: 0 28px 64px;
  display: grid;
  gap: 20px;
}

.episode-card {
  display: block;
  padding: 32px 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--rule);
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
}
.episode-card:hover {
  border-color: var(--accent);
  background: var(--surface);
  border-bottom-color: var(--accent);
  transform: translateY(-1px);
}
.episode-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--t-med);
}
.episode-card:hover::before { transform: scaleY(1); }

.episode-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.episode-number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.episode-reading-time {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.episode-title {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--text);
}

.episode-audience {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 16px;
}
.episode-audience::before {
  content: "↳ ";
  color: var(--text-faint);
}

.episode-desc {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 20px;
  max-width: 65ch;
}

.episode-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.episode-cta::after {
  content: "→";
  font-size: 16px;
  transition: transform var(--t-fast);
}
.episode-card:hover .episode-cta::after { transform: translateX(4px); }

/* About section */
.about {
  max-width: var(--content-max-wide);
  margin: 24px auto 0;
  padding: 32px 28px 80px;
  border-top: 1px solid var(--rule);
}

.about-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 32px 0 16px;
}

.about-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 16px;
  max-width: 65ch;
}
.about-text strong {
  color: var(--text);
  font-weight: 500;
}
.about-text a { font-weight: 500; }

/* ============================================================
   11. Site footer
   ============================================================ */

.site-footer {
  margin-top: 96px;
  padding: 48px 0;
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.site-footer-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.footer-brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 4px;
}
.footer-links {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-links a {
  color: var(--text-muted);
  border-bottom: none;
}
.footer-links a:hover { color: var(--accent); }

/* Na rozcestníku už border-top od .about, takže footer nepotřebuje top margin */
.landing .site-footer { margin-top: 0; }

/* ============================================================
   12. Responsive
   ============================================================ */

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .toc {
    position: static;
    max-height: none;
    padding: 24px 0;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 16px;
  }
  .toc.collapsed ul,
  .toc.collapsed .toc-meta { display: none; }
  .toc-heading {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px;
  }
  .toc-heading::after {
    content: "▾";
    font-family: var(--font-sans);
    font-size: 12px;
    transition: transform var(--t-fast);
  }
  .toc.collapsed .toc-heading::after { transform: rotate(-90deg); }
  .article { padding: 32px 0 64px; }
  .article-title { font-size: 32px; }
}

@media (max-width: 720px) {
  .layout,
  .site-header-inner,
  .site-footer-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    padding: 12px 20px;
    gap: 0;
  }
  .site-nav.open a {
    padding: 14px 12px;
    border-bottom: 1px solid var(--rule);
  }
  .site-nav.open a:last-of-type { border-bottom: none; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .theme-toggle { margin-left: 0; }
  .article-title { font-size: 28px; }
  .article-body p,
  .article-body li { font-size: 16px; }
  .article-body h2 { font-size: 22px; }
  .article-body h3 { font-size: 18px; }
  .lede { font-size: 17px; }
  .article-body blockquote { font-size: 18px; }
  .article-body.style-quotation blockquote { font-size: 16px; }
  .read-next {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }
  .anchor-link { display: none; }
  /* Landing */
  .hero { padding: 48px 20px 32px; }
  .hero-title { font-size: 36px; }
  .hero-lede { font-size: 17px; }
  .episodes,
  .about {
    padding-left: 20px;
    padding-right: 20px;
  }
  .episode-card { padding: 24px; }
  .episode-title { font-size: 22px; }
  .episode-card-header { gap: 8px; }
}

/* ============================================================
   13. Print
   ============================================================ */

@media print {
  .site-header,
  .toc,
  .read-next,
  .site-footer,
  .progress,
  .anchor-link,
  .menu-toggle,
  .theme-toggle,
  .discussion-cta { display: none; }
  .layout { grid-template-columns: 1fr; gap: 0; }
  .article { padding: 0; max-width: none; }
  body { background: white; color: black; }
  .article-body p,
  .article-body li { font-size: 11pt; }
  .ref { border: none; padding: 0; }
  .episode-card {
    border: 1px solid #ccc;
    background: white;
    page-break-inside: avoid;
  }
}
