/* course.css – stránky predmetov, týždňov a skriptá (dopĺňa style.css) */

.crumbs { color: var(--ink-soft); font-size: .95rem; margin: 1.75rem 0 .5rem; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 68ch; }
h1 { margin-top: .5rem; }

/* zoznam týždňov na stránke predmetu */
.weeks { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.weeks li { border-top: 1px solid var(--line); }
.weeks li:last-child { border-bottom: 1px solid var(--line); }
.week-link { display: grid; grid-template-columns: 3rem 1fr; align-items: baseline; gap: 1rem;
  padding: .85rem .5rem .85rem .9rem; text-decoration: none; color: inherit; border-left: 3px solid transparent; }
.week-link .num { font: 500 .95rem var(--font-text); color: var(--ink-soft); }
.week-link .t { font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; }
.week-link:hover, .week-link:focus-visible { border-left-color: var(--accent); background: var(--accent-bg); }
.week-link:hover .t { color: var(--accent); }

/* obsah týždňa */
.week h2, .chapter h2 { margin-top: 2.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.week h3, .chapter h3 { margin-top: 1.75rem; }
.week p, .chapter p, .week li, .chapter li, section p, section li { max-width: 72ch; }
.week ul, .chapter ul, section ul { padding-left: 1.3rem; }

/* pojmy a termíny: **pojem**: vysvetlenie */
.week li > strong:first-child, .chapter li > strong:first-child { color: var(--accent); font-weight: 600; }

/* kód */
code, pre { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; font-size: .92em; }
code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: .1em .35em; color: var(--ink); }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem;
  overflow-x: auto; max-width: 72ch; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; }

/* tabuľky (nástroje na stiahnutie) */
table { width: 100%; max-width: 72ch; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 1rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); font-size: .9rem; }

/* úloha, termín, poznámka */
.task, .note, .due { border-left: 3px solid var(--accent); background: var(--accent-bg); padding: .85rem 1.1rem; margin: 1.25rem 0; max-width: 72ch; border-radius: 0 6px 6px 0; }
.task > :last-child, .note > :last-child, .due > :last-child { margin-bottom: 0; }
.note { border-left-color: var(--line); background: var(--surface); }
.due strong { font-family: var(--font-head); }

/* predchádzajúci / nasledujúci */
.week-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* skriptá */
.book-head { padding-top: 2rem; }
.book-toc { margin: 2rem 0 1rem; }
.book-toc ol { list-style: none; padding: 0; }
.book-toc li { border-top: 1px solid var(--line); }
.book-toc li:last-child { border-bottom: 1px solid var(--line); }
.book-toc a { display: block; padding: .6rem .5rem; text-decoration: none; color: inherit; }
.book-toc a:hover { color: var(--accent); }
.book-toc .num, .chapter h1 .num { color: var(--ink-soft); font: 500 .95rem var(--font-text); display: inline-block; min-width: 2rem; }
.chapter { padding-top: 3rem; margin-top: 2rem; border-top: 2px solid var(--line); }
.chapter h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }
.glossary dt { font-weight: 600; margin-top: 1rem; }
.glossary dd { margin: .15rem 0 0 0; color: var(--ink-soft); max-width: 72ch; }
.glossary .ref { font: 500 .8rem var(--font-text); text-decoration: none; margin-left: .4rem; }

/* tlač do PDF */
@media print {
  .site-nav, .site-footer, .skip, .week-nav, .switches { display: none !important; }
  html { font-size: 11pt; }
  body { background: #fff !important; color: #000 !important; }
  .chapter { break-before: page; border: 0; }
  .book-toc a::after { content: none; }
  a { color: inherit; text-decoration: none; }
  pre, .task, .note, .due { break-inside: avoid; }
}

/* ---------- kód: vzhľad ako v editore ---------- */
figure.code { margin: 1.25rem 0 1.5rem; max-width: 72ch; }
figure.code figcaption {
  font: 500 .8rem/1 "IBM Plex Mono", ui-monospace, monospace; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 6px 6px 0 0; padding: .5rem .9rem; display: inline-block;
}
figure.code pre { margin: 0; border-radius: 0 6px 6px 6px; }
pre { position: relative; }
pre .copy {
  position: absolute; top: .5rem; right: .5rem; font: 500 .75rem var(--font-text);
  color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line);
  border-radius: 4px; padding: .2rem .55rem; cursor: pointer; opacity: 0; transition: opacity .15s;
}
pre:hover .copy, pre:focus-within .copy { opacity: 1; }
pre .copy:hover { color: var(--accent); border-color: var(--accent); }

/* Prism: farby zvolené pre svetlý aj tmavý režim, v duchu stránky */
:root, [data-bs-theme="light"] {
  --c-comment: #7a8594; --c-tag: #1f5fa8; --c-attr: #7a4a00; --c-string: #2f7d4f;
  --c-keyword: #8a2a6b; --c-func: #1f5fa8; --c-number: #b3542b; --c-punct: #566273; --c-var: #1a2433;
}
[data-bs-theme="dark"] {
  --c-comment: #8d98a8; --c-tag: #8ab8ee; --c-attr: #e2b96f; --c-string: #9fd6a8;
  --c-keyword: #e39ad0; --c-func: #8ab8ee; --c-number: #f0a27a; --c-punct: #aeb8c6; --c-var: #e9ecf1;
}
code[class*="language-"], pre[class*="language-"] { color: var(--ink); text-shadow: none; }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--c-comment); font-style: italic; }
.token.tag, .token.selector, .token.namespace { color: var(--c-tag); }
.token.attr-name, .token.property, .token.constant, .token.symbol { color: var(--c-attr); }
.token.attr-value, .token.string, .token.char, .token.inserted { color: var(--c-string); }
.token.keyword, .token.atrule, .token.important, .token.rule { color: var(--c-keyword); }
.token.function, .token.class-name, .token.builtin { color: var(--c-func); }
.token.number, .token.boolean, .token.deleted { color: var(--c-number); }
.token.punctuation, .token.operator, .token.entity, .token.url { color: var(--c-punct); }
.token.variable, .token.regex { color: var(--c-var); }
.token.bold { font-weight: 600; } .token.italic { font-style: italic; }
@media print { pre .copy { display: none; } code[class*="language-"] { color: #000; } }
