/* /docs/ — čtecí vrstva (DESIGN.md, Vrstvy 3b). Ručně psané, generátor
   (tools/docs/build.mjs) jen skládá HTML. Shell = account/tm-v4.css (lišta, patička,
   barvy, písmo, tokeny); tady jen rozvržení a typografie textu. Bez částic a revealu. */

.docs-skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--card); color: var(--text);
  border: 1px solid var(--card-border); border-radius: var(--r-sm); padding: 8px 12px; text-decoration: none; }
.docs-skip:focus { top: 12px; }

.docs-layout {
  position: relative; z-index: 1;
  max-width: var(--w-page); margin: 0 auto; padding: 28px 20px 64px;
  display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 48px; align-items: start;
  font-family: var(--ff-ui);
}

/* ── levý sloupec: hledání + navigace ── */
.docs-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; padding-bottom: 12px; scrollbar-width: thin; }
.docs-search { position: relative; margin-bottom: 18px; }
.docs-search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.docs-search input {
  width: 100%; font: inherit; font-size: var(--step-0); color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--card-border); border-radius: var(--r-sm);
  padding: 9px 12px;
}
.docs-search input:focus { outline: none; border-color: var(--accent-2); }
.docs-results {
  list-style: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-sm);
  box-shadow: var(--sh-pop); max-height: 60vh; overflow-y: auto; padding: 4px 0;
}
.docs-results li a { display: block; padding: 8px 12px; text-decoration: none; color: var(--text); }
.docs-results li a b { display: block; font-weight: 600; font-size: var(--step-0); }
.docs-results li a span { display: block; font-size: var(--step--1); color: var(--text-dim); line-height: 1.4; }
.docs-results li[aria-selected="true"] a, .docs-results li a:hover { background: color-mix(in srgb, var(--accent-2) 12%, transparent); }
.docs-results .docs-noresult { padding: 10px 12px; font-size: var(--step--1); color: var(--text-dim); }

.docs-nav-fold > summary { display: none; }
.docs-nav { font-size: var(--step-0); }
.docs-nav a { text-decoration: none; color: var(--text-dim); }
.docs-nav a:hover { color: var(--text); }
.docs-nav-home { display: block; padding: 4px 0 4px 12px; margin-bottom: 14px; border-left: 2px solid transparent; }
.docs-nav-sec { margin-bottom: 16px; }
.docs-nav-label {
  display: block; font-size: var(--step--1); font-weight: 700;
  padding: 0 0 6px 12px;
}
.docs-nav ul { list-style: none; border-left: 1px solid var(--card-border); }
.docs-nav li a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent; line-height: 1.4; }
.docs-nav a[aria-current="page"] { color: var(--text); border-left-color: var(--accent-2); }
.docs-nav-label[aria-current="page"] { color: var(--text); }

/* ── text ── */
.docs-main { min-width: 0; max-width: var(--w-read); }
.docs-crumbs { font-size: var(--step--1); color: var(--text-dim); margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.docs-crumbs a { color: var(--text-dim); text-decoration: none; }
.docs-crumbs a:hover { color: var(--text); text-decoration: underline; }
.docs-main h1 { font: 800 var(--step-4) / 1.1 var(--ff-display); letter-spacing: -.02em; color: var(--text); text-wrap: balance; }
.docs-cs-note { margin-top: 10px; font-size: var(--step-0); color: var(--text-dim); border-left: 2px solid var(--card-border); padding-left: 10px; }
.docs-cs-note:empty { display: none; }
.docs-lead { margin-top: 12px; font-size: var(--step-1); color: var(--text-dim); line-height: 1.6; }

.docs-body { margin-top: 24px; font-size: var(--step-1); line-height: 1.7; }
.docs-body > * + * { margin-top: 14px; }
.docs-body h2 { font: 700 var(--step-2) / 1.3 var(--ff-display); letter-spacing: -.01em; margin-top: 40px; color: var(--text); scroll-margin-top: 84px; position: relative; }
.docs-body h3 { font-size: var(--step-1); font-weight: 700; margin-top: 28px; color: var(--text); scroll-margin-top: 84px; position: relative; }
.docs-anchor { position: absolute; left: -1.1em; width: 1em; color: var(--text-dim); text-decoration: none; opacity: 0; font-family: var(--ff-ui); font-weight: 400; }
.docs-body h2:hover .docs-anchor, .docs-body h3:hover .docs-anchor, .docs-anchor:focus { opacity: 1; }
.docs-body a { color: var(--player-text); text-underline-offset: 3px; }
.docs-body b { color: var(--text); font-weight: 600; }
.docs-body ul, .docs-body ol { padding-left: 22px; }
.docs-body li + li { margin-top: 6px; }
.docs-body code { font-family: var(--ff-mono); font-size: .88em; background: var(--bg-soft); border: 1px solid var(--card-border); border-radius: var(--r-xs); padding: 1px 5px; }
.docs-body kbd, .docs-results kbd {
  font-family: var(--ff-ui); font-size: .84em; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--card-border); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 0 6px;
}

.docs-note { border-left: 3px solid var(--accent-2); padding: 2px 0 2px 16px; }
.docs-note-dashboard { border-left-color: var(--dm); }
.docs-note-label { display: block; font-size: var(--step--1); font-weight: 700; color: var(--text-dim); margin-bottom: 2px; }
.docs-note p + p { margin-top: 8px; }

.docs-table { overflow-x: auto; }
.docs-table table { border-collapse: collapse; width: 100%; font-size: var(--step-0); }
.docs-table th, .docs-table td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--card-border); }
.docs-table td:first-child, .docs-table th { white-space: nowrap; }
.docs-table th { font-size: var(--step--1); color: var(--text-dim); font-weight: 700; }

/* Works with — řádky s linkou, ne dlaždice */
.docs-ww ul { list-style: none; padding: 0; border-top: 1px solid var(--card-border); }
.docs-ww li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--card-border); margin: 0; }
.docs-ww-with { font-weight: 600; color: var(--text); }

/* Feature map */
.docs-fm + .docs-fm { margin-top: 8px; }
.docs-fm-open { font-size: var(--step-0); }

/* rozcestník (home + sekce) */
.docs-browse ul { list-style: none; padding: 0; border-top: 1px solid var(--card-border); }
.docs-browse li { padding: 12px 0; border-bottom: 1px solid var(--card-border); margin: 0; }
.docs-browse li a { font-weight: 600; text-decoration: none; color: var(--text); }
.docs-browse li a:hover { color: var(--player-text); text-decoration: underline; }
.docs-browse li span { display: block; font-size: var(--step-0); color: var(--text-dim); line-height: 1.5; margin-top: 2px; }
.docs-browse h2 a { color: inherit; text-decoration: none; }
.docs-browse h2 a:hover { text-decoration: underline; }

.docs-meta { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--card-border); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: var(--step--1); color: var(--text-dim); }
.docs-meta a { color: var(--text-dim); }
.docs-meta a:hover { color: var(--text); }

/* ── pravý sloupec: On this page ── */
.docs-toc { position: sticky; top: 84px; font-size: var(--step--1); }
.docs-toc-label { font-size: var(--step--1); font-weight: 700; color: var(--text-dim); margin-bottom: 8px; }
.docs-toc ul { list-style: none; border-left: 1px solid var(--card-border); }
.docs-toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-dim); text-decoration: none; line-height: 1.4; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.on { color: var(--text); border-left-color: var(--accent-2); }

@media (max-width: 1179px) {
  .docs-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .docs-toc { display: none; }
}
@media (max-width: 899px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 18px 16px 48px; }
  .docs-side { position: static; max-height: none; overflow: visible; margin-bottom: 22px; padding-bottom: 0; }
  .docs-nav-fold { border: 1px solid var(--card-border); border-radius: var(--r-sm); background: var(--bg-soft); }
  .docs-nav-fold > summary { display: block; cursor: pointer; padding: 10px 14px; font-size: var(--step-0); font-weight: 600; list-style: none; }
  .docs-nav-fold > summary::-webkit-details-marker { display: none; }
  .docs-nav-fold > summary::after { content: "+"; float: right; color: var(--text-dim); }
  .docs-nav-fold[open] > summary::after { content: "\2212"; }
  .docs-nav-fold .docs-nav { padding: 4px 14px 12px; }
  .docs-ww li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .docs-anchor { display: none; }
}
/* telefon: tabulka jako skládané řádky, popisek sloupce z data-label (generuje build) */
@media (max-width: 599px) {
  .docs-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .docs-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--card-border); }
  .docs-table td { display: block; border: 0; padding: 2px 0; white-space: normal; }
  .docs-table td:first-child { font-weight: 600; }
  .docs-table td:not(:first-child)::before { content: attr(data-label) ": "; color: var(--text-dim); font-size: .86em; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Dvojjazyčné stránky: obě verze v markupu, ukáže se ta podle <html lang>
   (inline skript v hlavě ji nastaví z jb-lang ještě před vykreslením, tm-site.js
   ji přepíná živě). Bez JS je html lang="en" → EN. */
:root[lang="cs"] [data-docs-lang="en"],
:root:not([lang="cs"]) [data-docs-lang="cs"] { display: none; }
