/* =========================================================================
   Article body typography — applied to the .prose wrapper around
   the_content() output. References tokens.css; no hardcoded colors.

   Includes TinyMCE-managed style classes (.note-box, .highlighted-text,
   .code-block) so editor styles match the rendered output.
   ========================================================================= */

.prose {
  max-width: none;
  font-family: var(--font-sans);
  color: var(--fg);
  line-height: 1.7;
}

/* Vertical rhythm for adjacent block-level children */
.prose > * + * {
  margin-top: 24px;
}

/* Paragraphs */
.prose p {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
  color: var(--fg);
  margin: 0 0 24px;
  max-width: 68ch;
}

/* Lede — larger first paragraph */
.prose p.lede,
.prose .lede {
  font-size: 22px;
  line-height: 1.55;
  color: var(--fg);
  margin-bottom: 32px;
}

/* Headings — mono, with scroll margin so anchor links don't hide under sticky nav */
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fg);
  scroll-margin-top: var(--nav-height);
}
.prose h2 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 56px 0 18px;
}
.prose h2::before {
  content: '## ';
  color: var(--accent);
  font-weight: 500;
}
.prose h3 {
  font-size: 21px;
  line-height: 1.3;
  margin: 36px 0 12px;
}
.prose h4 {
  font-size: 17px;
  line-height: 1.4;
  margin: 28px 0 10px;
}

/* Lists */
.prose ul,
.prose ol {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
  color: var(--fg);
  padding-left: 0;
  margin: 0 0 28px;
  list-style: none;
  max-width: 68ch;
}
.prose li {
  padding-left: 28px;
  position: relative;
  margin-bottom: 10px;
}
.prose ul li::before {
  content: '–';
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
}
.prose ol { counter-reset: li; }
.prose ol li::before {
  counter-increment: li;
  content: counter(li, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  top: 4px;
}

/* Inline links inside prose — accent + dashed underline */
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
  border-bottom: none;
}
.prose a:hover {
  text-decoration-style: solid;
}

/* Blockquote */
.prose blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg);
  font-style: normal;
}
.prose blockquote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  color: var(--fg-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Code */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 2px 6px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg);
}
.prose pre {
  font-family: var(--font-mono);
  margin: 28px 0;
  font-size: 13.5px;
  background:
    linear-gradient(to right, transparent calc(100% - 32px), var(--surface-1) 100%),
    var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  overflow-x: auto;
  color: var(--fg);
  line-height: 1.55;
  scrollbar-width: thin;
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  margin: 28px 0;
}

/* Horizontal rule — subtle dashed divider */
.prose hr {
  border: 0;
  border-top: 1px dashed var(--border);
  margin: 56px 0;
}

/* Pull quote / callout */
.pull {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 22px 26px;
  margin: 32px 0;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
}
.pull strong {
  color: var(--accent);
  font-weight: 500;
}

/* TinyMCE "Poznámka" — soft accent-tinted note box */
.note-box {
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-border);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin: 28px 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
}

/* TinyMCE "Zvýrazněný text" — inline accent highlight */
.highlighted-text {
  background: var(--accent-tint-strong);
  color: var(--fg);
  padding: 0 4px;
  border-radius: 3px;
}

/* TinyMCE "Blok kódu" — equivalent to .prose pre */
.code-block {
  font-family: var(--font-mono);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  margin: 28px 0;
  overflow-x: auto;
  color: var(--fg);
  line-height: 1.55;
  font-size: 13.5px;
  white-space: pre;
}

/* Tables */
.prose table {
  width: 100%;
  margin: 28px 0;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  display: block;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.prose table thead {
  background: var(--surface-1);
}
.prose table th,
.prose table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.prose table th {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  white-space: nowrap;
}
.prose table tbody tr:last-child td { border-bottom: 0; }
.prose table tbody tr:hover { background: var(--hover-overlay); }
.prose table td strong { color: var(--fg); font-weight: 600; }

/* Syntax highlighting (Prism.js token classes).
   Loaded only on singular post pages. Theme stays muted to fit the paper
   palette: comments gray, keywords/operators terracotta, strings olive,
   numbers/atoms warm rust. */
.prose pre[class*="language-"],
.prose code[class*="language-"] {
  font-family: var(--font-mono);
  color: var(--fg);
  background: none;
  text-shadow: none;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.55;
  tab-size: 4;
  hyphens: none;
}
.prose pre[class*="language-"] {
  background:
    linear-gradient(to right, transparent calc(100% - 32px), var(--surface-1) 100%),
    var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  overflow-x: auto;
  margin: 28px 0;
  font-size: 13.5px;
  scrollbar-width: thin;
}
.prose :not(pre) > code[class*="language-"] {
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  font-size: 0.92em;
}

/* Prism token colors — muted, paper-friendly */
.token.comment,
.token.prolog,
.token.cdata,
.token.doctype { color: var(--fg-subtle); font-style: italic; }

.token.punctuation { color: var(--fg-muted); }

.token.namespace { opacity: 0.7; }

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted { color: var(--accent-pressed); }

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted { color: var(--success); }

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string { color: var(--accent); }

.token.atrule,
.token.attr-value,
.token.keyword { color: var(--accent); font-weight: 500; }

.token.function,
.token.class-name { color: var(--info); }

.token.regex,
.token.important,
.token.variable { color: var(--accent-pressed); }

.token.important,
.token.bold { font-weight: 700; }
.token.italic { font-style: italic; }
.token.entity { cursor: help; }

/* Mobile size-down */
@media (max-width: 620px) {
  .prose p,
  .prose ul,
  .prose ol {
    font-size: 16px;
  }
  .prose h2 { font-size: 24px; }
  .prose h3 { font-size: 19px; }
  .prose .lede,
  .prose p.lede { font-size: 18px; }
  .prose table { font-size: 14px; }
  .prose table th,
  .prose table td { padding: 10px 12px; }
}
