/* petrvobornik.cz – směr A „Inženýrský zápisník“ (docs/design.md) */

/* ---------- Fonty (self-hosted, variabilní) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: italic; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-wght-italic.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: italic; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-ext-wght-italic.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url(../fonts/space-grotesk-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url(../fonts/space-grotesk-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(../fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(../fonts/jetbrains-mono-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------- Design tokeny ---------- */
:root {
  color-scheme: light;
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #0E1726;
  --muted: #4A5568;
  --line: #DDE2EA;
  --accent: #1D4ED8;
  --accent-btn: #1D4ED8;
  --accent-soft: #E3EBFF;
  --accent-text: #1E3A8A;
  --code-bg: #0E1526;
  --code-ink: #E6EAF2;
  --focus: #1D4ED8;

  --font-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --container: 1200px;
  --gutter: 24px;
  --section-gap: 72px;
  --radius-card: 18px;
  --radius-panel: 24px;
  --radius-btn: 12px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1020;
    --surface: #121A2E;
    --line: #24304A;
    --ink: #E6EAF2;
    --muted: #A3AEC2;
    --accent: #7AA2FF;
    --accent-btn: #3B6BF6;
    --accent-soft: #1E2B52;
    --accent-text: #C7D6FF;
    --focus: #7AA2FF;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
/*
  --bg: #0B1020;
  --surface: #121A2E;
  --line: #24304A;
*/
  --bg: #202020;
  --surface: #2C2C2C;
  --line: #808080;

  --ink: #E6EAF2;
  --muted: #A3AEC2;
  --accent: #7AA2FF;
  --accent-btn: #3B6BF6;
  --accent-soft: #1E2B52;
  --accent-text: #C7D6FF;
  --focus: #7AA2FF;
}

/* ---------- Základ ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--font-body);
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(36px, 5vw, 60px); letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: clamp(28px, 3.4vw, 36px); }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
small { font-size: .85em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.mono, .label { font-family: var(--font-mono); }
.label { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.label-accent { color: var(--accent); }
.muted { color: var(--muted); }

/* ---------- Hlavička ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--bg); font: 600 14px/1 var(--font-mono); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15.5px; }
.site-nav a:hover { color: var(--ink); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.site-nav .nav-contact a { background: var(--ink); color: var(--bg); }
.site-nav .nav-contact a:hover { background: var(--ink); color: var(--bg); opacity: .9; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--muted); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.nav-toggle { display: none; }

@media (max-width: 860px) {
  :root { --gutter: 16px; --section-gap: 56px; }
  .site-header .container { gap: 12px; }
  .nav-toggle { display: inline-grid; margin-left: auto; }
  .site-nav { position: absolute; top: 68px; left: 0; right: 0; margin: 0; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .site-nav a { padding: 12px; font-size: 17px; }
}

/* ---------- Obsah stránky ---------- */
main { display: block; min-height: 60vh; }
.page-head { padding: 56px 0 32px; }
.page-head .lead { max-width: 760px; }
.lead { font-size: clamp(18px, 2vw, 20px); color: var(--muted); line-height: 1.6; }
.section { padding: var(--section-gap) 0 0; }
.section:last-child { padding-bottom: var(--section-gap); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.section-head h2 { margin: 6px 0 0; }
.section-head .more { font-weight: 500; text-decoration: none; }
.section-head .more:hover { text-decoration: underline; }

.breadcrumbs { font: 13px var(--font-mono); color: var(--muted); margin-bottom: 18px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius-btn);
  font: 600 16px/1 var(--font-body); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .12s ease, background-color .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent-btn); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 560px) { .btn-row .btn { flex: 1 1 100%; } }

/* ---------- Karty ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 28px;
}
.card h3 { margin: 0; font-size: 21px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:has(h3 a:hover) { border-color: var(--accent); }
.card:has(h3 a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.card p { margin: 0; color: var(--muted); }
.card .meta { margin-top: auto; padding-top: 6px; }
.card-media { display: flex; align-items: center; gap: 16px; }
.card-media img { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; flex: none; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font: 13px var(--font-mono); color: var(--muted); }

/* ---------- Štítky ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tag {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font: 500 13px/1.4 var(--font-mono); text-decoration: none; background: var(--surface);
}
a.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag-strong { background: var(--accent-btn); border-color: var(--accent-btn); color: #fff; }
a.tag-strong:hover { color: #fff; opacity: .9; }
.tag-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.tag .count { opacity: .75; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font: 500 12px/1.5 var(--font-mono); background: var(--accent-soft); color: var(--accent-text); }
.badge-outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* ---------- Hero (úvod) ---------- */
.hero { padding: 64px 0 8px; }
.hero .container { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero h1 { margin: 14px 0 20px; }
.hero .lead { max-width: 620px; margin-bottom: 28px; }
.hero-visual { position: relative; justify-self: center; width: min(100%, 400px); padding-bottom: 32px; }
.hero-photo { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 28px; border: 1px solid var(--line); background: var(--surface); }
.hero-code {
  position: relative; margin: -64px -28px 0 -28px; padding: 18px 20px; border-radius: 16px;
  background: var(--code-bg); color: var(--code-ink); font: 13.5px/1.7 var(--font-mono);
  box-shadow: 0 18px 40px -18px rgba(14, 21, 38, .55); overflow-x: auto;
}
.hero-code .k { color: #82AAFF; } .hero-code .t { color: #5EEAD4; } .hero-code .s { color: #FDBA74; } .hero-code .c { color: #8391AC; }
@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero .container { grid-template-columns: 1fr; gap: 32px; }
  .hero-visual { order: -1; width: min(100%, 320px); }
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.stat { padding: 26px 28px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-value { display: block; font: 700 clamp(30px, 4vw, 40px)/1.1 var(--font-head); letter-spacing: -0.03em; }
.stat-label { font: 13px var(--font-mono); color: var(--muted); }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

.area .area-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font: 600 15px var(--font-mono); }
.area ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.list-plain > li:first-child { padding-top: 0; }
.list-plain h3 { font-size: 19px; margin: 0 0 4px; }
.list-plain h3 a { color: var(--ink); text-decoration: none; }
.list-plain h3 a:hover { color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 32px; }
.support { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.support h2 { margin: 6px 0 4px; font-size: 28px; }

/* ---------- Výpisy ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.filter { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 500 14px var(--font-body); text-decoration: none; }
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter .count { font-family: var(--font-mono); font-size: 12px; opacity: .7; margin-left: 4px; }
.filter-group { margin-bottom: 8px; }
.filter-group .label { display: block; margin-bottom: 8px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 40px 0 0; font-family: var(--font-mono); font-size: 14px; }

.pub-year { font: 600 15px var(--font-mono); color: var(--accent); margin: 40px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pub-year:first-child { margin-top: 0; }
.pub-item { padding: 16px 0; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; }
.pub-item .citation p { margin: 0; }
.pub-item .citation { line-height: 1.6; }
.pub-item .actions { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: start; justify-content: end; font: 13px var(--font-mono); white-space: nowrap; }
.pub-item .actions a { text-decoration: none; }
.pub-item .actions a:hover { text-decoration: underline; }
@media (max-width: 700px) { .pub-item { grid-template-columns: 1fr; } .pub-item .actions { justify-content: start; } }

/* ---------- Článek ---------- */
.article-head { padding: 48px 0 24px; max-width: 860px; }
.article-head h1 { font-size: clamp(32px, 4.4vw, 52px); margin: 10px 0 16px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; padding-bottom: var(--section-gap); }
.article-layout.no-aside { grid-template-columns: minmax(0, 860px); }
.article-aside { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 20px; }
.article-aside .panel { padding: 22px; border-radius: var(--radius-card); }
.article-aside h2 { font: 600 13px var(--font-mono); color: var(--muted); letter-spacing: .02em; margin: 0 0 10px; }
@media (max-width: 1020px) { .article-layout { grid-template-columns: minmax(0, 1fr); } .article-aside { position: static; } }

.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.4; }
.toc a:hover { color: var(--accent); }
.toc a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.toc .all { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 13px; }

.part-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.part-nav a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); text-decoration: none; color: var(--ink); }
.part-nav a:hover { border-color: var(--accent); }
.part-nav .next { text-align: right; grid-column: 2; }
.part-nav span { display: block; font: 12px var(--font-mono); color: var(--muted); margin-bottom: 4px; }
.part-title { font-size: 26px; margin-top: 8px; }

.prose { font-size: 17.5px; line-height: 1.72; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.6em 0 .6em; }
.prose h1 { font-size: 30px; }
.prose h2 { font-size: 26px; }
.prose h3 { font-size: 21px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose img { border-radius: 10px; }
.prose .text-center { text-align: center; }
.prose .text-right { text-align: right; }
.prose .img-left { float: left; margin: 4px 24px 12px 0; max-width: 45%; }
.prose .icn-left { float: left; margin: 8px 12px 4px 0; max-width: 45%; }
.prose .img-right { float: right; margin: 4px 0 12px 24px; max-width: 45%; }
.prose .img-center { display: block; margin: 1em auto; }
.prose::after { content: ""; display: table; clear: both; }
@media (max-width: 600px) { .prose .img-left, .prose .img-right { float: none; display: block; margin: 1em auto; max-width: 100%; } }
.prose :not(pre) > code { font: .88em var(--font-mono); background: var(--accent-soft); color: var(--accent-text); padding: .1em .4em; border-radius: 6px; }
.table-wrap { overflow-x: auto; margin: 1.4em 0; }
.prose table { border-collapse: collapse; min-width: 100%; font-size: 15.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface); }
.perex { font-size: clamp(18px, 2vw, 20px); color: var(--muted); }
.perex { margin-bottom: 1.2em; }
.perex p:last-child { margin-bottom: 0; }

/* ---------- Kód (Prism, téma na míru) ---------- */
.prose pre, pre[class*="language-"] {
  position: relative; margin: 1.5em 0; padding: 18px 20px; overflow-x: auto;
  background: var(--code-bg); color: var(--code-ink); border-radius: 14px;
  font: 14.5px/1.65 var(--font-mono); tab-size: 4; hyphens: none;
}
pre code { font: inherit; background: none; padding: 0; color: inherit; white-space: pre; }
div.code-toolbar { position: relative; margin: 1.5em 0; }
div.code-toolbar > pre { margin: 0; padding-top: 46px; }
div.code-toolbar > .toolbar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px 8px 20px; border-bottom: 1px solid #1F2A44; font: 12px var(--font-mono); color: #8391AC;
}
div.code-toolbar > .toolbar > .toolbar-item:first-child { text-transform: lowercase; }
div.code-toolbar > .toolbar button {
  font: 12px var(--font-mono); color: #C7D2E5; background: #1A2440; border: 1px solid #2A3757; border-radius: 8px; padding: 4px 10px; cursor: pointer;
}
div.code-toolbar > .toolbar button:hover { background: #24304F; }
pre.line-numbers { position: relative; padding-left: 3.6em; counter-reset: linenumber; }
pre.line-numbers > code { position: relative; white-space: inherit; }
.line-numbers .line-numbers-rows {
  position: absolute; pointer-events: none; top: 0; font-size: 100%; left: -3.6em; width: 3em;
  letter-spacing: -1px; border-right: 1px solid #1F2A44; user-select: none;
}
.line-numbers-rows > span { display: block; counter-increment: linenumber; }
.line-numbers-rows > span::before { content: counter(linenumber); color: #56627C; display: block; padding-right: .8em; text-align: right; }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #8391AC; font-style: italic; }
.token.punctuation { color: #A9B4C8; }
.token.keyword, .token.boolean, .token.important, .token.atrule, .token.tag .token.punctuation { color: #82AAFF; }
.token.class-name, .token.function, .token.builtin, .token.tag, .token.selector { color: #5EEAD4; }
.token.string, .token.char, .token.attr-value, .token.regex, .token.url { color: #FDBA74; }
.token.number, .token.constant, .token.symbol { color: #F9A8D4; }
.token.attr-name, .token.property, .token.variable { color: #FDE68A; }
.token.operator, .token.entity { color: #C7D2E5; }
.token.namespace { opacity: .8; }

/* ---------- Video facade ---------- */
figure.video { margin: 1.6em auto; max-width: 860px; }
.yt-facade {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px;
  background: var(--code-bg); color: #fff; text-decoration: none; border: 1px solid var(--line);
}
.yt-facade img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; transition: transform .25s ease, opacity .25s ease; opacity: .92; }
.yt-facade:hover img { transform: scale(1.02); opacity: 1; }
.yt-play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; transform: translate(-50%, -50%);
  background: rgba(14, 21, 38, .82); border-radius: 14px; transition: background-color .15s ease;
}
.yt-play::after { content: ""; position: absolute; left: 31px; top: 16px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.yt-facade:hover .yt-play, .yt-facade:focus-visible .yt-play { background: #E11D2E; }
.yt-label {
  position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; border-radius: 8px;
  background: rgba(14, 21, 38, .82); font: 12.5px/1.4 var(--font-mono);
}
.yt-label small { opacity: .75; font-size: 1em; }
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; background: #000; }
figure.video figcaption { font: 13px var(--font-mono); color: var(--muted); margin-top: 8px; text-align: center; }

.embed-facade { margin: 1.6em 0; padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius-card); background: var(--surface); text-align: center; }
.embed-facade p { margin: 0 0 10px; }
.embed-facade p:last-child { margin: 0; }
.embed-load { min-height: 44px; padding: 0 20px; border-radius: var(--radius-btn); border: 0; background: var(--accent-btn); color: #fff; font: 600 15px var(--font-body); cursor: pointer; }
.embed-frame { display: block; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-card); background: #fff; }

/* ---------- Galerie + lightbox ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 1.5em 0; text-align: left; }
.gallery-item { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; transition: transform .2s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.lightbox { border: 0; padding: 0; margin: auto; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(5, 8, 16, .9); }
.lightbox-inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 56px 64px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 8px; }
.lightbox-caption { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #E6EAF2; font: 13px var(--font-mono); }
.lightbox button { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 22px; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .24); }
.lightbox .lb-close { top: 12px; right: 12px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox-inner { padding: 64px 8px; } .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 8px; transform: none; } }

/* ---------- Patička ---------- */
.site-footer { margin-top: var(--section-gap); border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 15px; color: var(--muted); }
.site-footer .container { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; }
.site-footer h2 { font: 600 13px var(--font-mono); color: var(--muted); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-note { font-family: var(--font-mono); font-size: 13px; }
@media (max-width: 760px) { .site-footer .container { grid-template-columns: 1fr; } }

/* ---------- Chyby ---------- */
.error-page { padding: 80px 0; max-width: 720px; }
.error-code { font: 600 14px var(--font-mono); color: var(--accent); }

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

@media print {
  .site-header, .site-footer, .article-aside, .part-nav, .yt-play, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .article-layout { display: block; }
}

.meta-list { margin: 0 0 16px; display: grid; gap: 4px; }
.meta-list dt { margin-top: 8px; }
.meta-list dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
