/* Guide pages (/pruvodce/<slug>/) on top of article.css: beginner path, contents, other guides of
   the topic, inline related card, next step, tonight's comets and Kam dál. The rail appears from
   1000 px; below that the contents collapse into <details> and the topic list follows the article. */

/* --- Layout with the rail ------------------------------------------------- */
.article-hero--wide .container { max-width: calc(1180px + 2 * var(--gutter)); }
.article-grid { max-width: calc(1180px + 2 * var(--gutter)); }
.article-grid > .article { max-width: none; }
.rail { display: none; }

@media (min-width: 1000px) {
  .article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; }
  .rail { display: block; padding-block: 48px; }
  .rail-sticky { position: sticky; top: 24px; display: grid; gap: 36px; max-height: calc(100vh - 48px); overflow-y: auto; }
  .toc-mobile { display: none; }
  .guide-siblings-after.has-rail { display: none; }
}

.prose h2[id], .prose h3[id] { scroll-margin-top: 24px; }

.rail-title { font: 700 .75rem/1.3 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; text-wrap: wrap; }

/* --- (1) Beginner path ----------------------------------------------------- */
.guide-path { margin-top: 28px; max-width: 720px; }
.guide-path ol { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.guide-path li { flex: 1 1 0; min-width: 0; }
.guide-path li.guide-path__more { flex: 0 0 auto; }
.guide-path a { display: block; text-decoration: none; color: var(--on-dark-2); font-size: .8125rem; line-height: 1.35; overflow-wrap: anywhere; }
.guide-path a::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--on-dark-line); margin-bottom: 10px; }
.guide-path a.is-done::before, .guide-path a.is-current::before { background: var(--teal-400); }
.guide-path a.is-current { color: #fff; font-weight: 600; }
.guide-path a:hover .guide-path__title { text-decoration: underline; text-underline-offset: 3px; }
.guide-path a:focus-visible { outline: 2px solid var(--teal-300); outline-offset: 4px; border-radius: 2px; }
.guide-path small { display: block; color: var(--on-dark-3); font-weight: 400; font-size: .75rem; margin-bottom: 2px; }
.guide-path a.is-current small { color: var(--teal-300); font-weight: 700; }
@media (max-width: 640px) {
  /* Only the current step keeps its title on a phone; the others stay as segments. */
  .guide-path a:not(.is-current) .guide-path__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .guide-path li:has(.is-current) { flex-grow: 3; }
}

/* --- (2) Contents ------------------------------------------------------------ */
.toc { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; font-size: .875rem; line-height: 1.4; }
.toc .toc__sub a { padding-left: 28px; font-size: .8125rem; }
.toc a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.toc a.is-active, .toc a[aria-current] { border-color: var(--teal-700); color: var(--ink); font-weight: 600; }

.toc-mobile { border: 1px solid var(--line-strong); border-radius: var(--radius-m); margin-bottom: 32px; background: var(--paper); }
.toc-mobile summary { cursor: pointer; padding: 12px 16px; font-weight: 700; font-size: .9375rem; color: var(--ink); list-style-position: inside; }
.toc-mobile summary:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 2px; border-radius: var(--radius-m); }
.toc-mobile nav { padding: 0 16px 14px; }

/* --- (3) Other guides of the topic ---------------------------------------------- */
.siblings { list-style: none; margin: 0; padding: 0; }
.siblings a { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; color: var(--ink); text-decoration: none; font-size: .9rem; line-height: 1.4; border-bottom: 1px solid var(--line); }
.siblings a:hover .siblings__title { color: var(--teal-700); text-decoration: underline; text-underline-offset: 3px; }
.siblings__n { flex: none; width: 16px; color: var(--teal-700); font: 600 1rem var(--font-display); }
.siblings__title { min-width: 0; overflow-wrap: anywhere; }
.siblings a.is-current { font-weight: 700; }
.siblings__now { margin-left: auto; padding-left: 8px; font-size: .7rem; font-weight: 700; color: var(--teal-700); text-transform: uppercase; letter-spacing: .06em; }

.guide-siblings-after { background: var(--paper-2); border-top: 1px solid var(--line); padding-block: 36px 40px; }
.guide-siblings-after .container { max-width: calc(860px + 2 * var(--gutter)); }
.guide-siblings-after .rail-title { font: 600 1.5rem/1.25 var(--font-display); letter-spacing: -.01em; text-transform: none; color: var(--ink); margin-bottom: 14px; }
.guide-siblings-after .siblings a { font-size: 1rem; padding: 12px 0; }

/* --- (4) Inline related card ---------------------------------------------------- */
.prose > .inline-card-wrap { margin-block: 2em; }
.inline-card { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); text-decoration: none; color: var(--ink); background: var(--paper); transition: border-color .2s; }
.inline-card:hover { border-color: var(--teal-700); }
.inline-card:hover strong { color: var(--teal-700); }
.inline-card__icon { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; color: var(--teal-700); }
.inline-card__icon svg { width: 22px; height: 22px; }
.inline-card > span:last-child { min-width: 0; }
.inline-card small { display: block; color: var(--ink-3); font-size: .75rem; line-height: 1.4; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.inline-card strong { display: block; font: 600 1.05rem/1.35 var(--font-display); overflow-wrap: anywhere; }

/* --- (6) Next step ------------------------------------------------------------- */
.next-wrap { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin-top: 48px; }
.np { display: block; padding: 22px 24px; border-radius: 14px; text-decoration: none; min-width: 0; }
.np small { display: block; font-size: .75rem; line-height: 1.4; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.np strong { display: block; font: 600 1.35rem/1.3 var(--font-display); overflow-wrap: anywhere; }
.np p { font-size: .875rem; margin-top: 8px; }
.np--prev { border: 1px solid var(--line-strong); color: var(--ink); transition: border-color .2s; }
.np--prev:hover { border-color: var(--teal-700); }
.np--prev small, .np--prev p { color: var(--ink-3); }
.np--next { background: linear-gradient(rgba(11, 32, 54, .55), rgba(11, 32, 54, .55)), var(--navy-800) url("/assets/constellations.png") center / cover; color: #fff; }
.np--next small { color: var(--teal-300); }
.np--next p { color: var(--on-dark-2); }
.np__go { display: inline-flex; gap: 8px; align-items: center; margin-top: 16px; background: var(--teal-400); color: var(--navy-900); font-weight: 700; font-size: .875rem; padding: 9px 16px; border-radius: 999px; transition: background-color .2s; }
.np--next:hover .np__go { background: var(--teal-300); }
.np:focus-visible { outline: 3px solid var(--teal-700); outline-offset: 3px; }
@media (max-width: 640px) {
  .next-wrap { grid-template-columns: 1fr; }
  .np--next { order: -1; }
}

/* --- (7) Tonight ----------------------------------------------------------------- */
.tonight { margin-top: 56px; display: grid; grid-template-columns: 1fr 1.2fr; border-radius: 16px; overflow: hidden; background: var(--navy-900); color: var(--on-dark); }
.tonight__copy { padding: 28px; background: url("/assets/constellations.png") center / cover; }
.tonight__copy small { color: var(--teal-300); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tonight__copy h2 { font-size: 1.6rem; color: #fff; margin-top: 10px; }
.tonight__copy p { color: var(--on-dark-2); font-size: .9rem; margin-top: 10px; }
.tonight__list { padding: 20px 28px; min-width: 0; }
.tonight__list ul { list-style: none; margin: 0; padding: 0; }
.tonight__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--on-dark-line); font-size: .9rem; }
.tonight__mag { color: var(--teal-300); font-weight: 700; white-space: nowrap; }
.tonight__fit { align-self: center; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(55, 198, 203, .18); color: var(--teal-300); white-space: nowrap; }
.tonight__fit--no { background: rgba(255, 255, 255, .08); color: var(--on-dark-3); }
.tonight__list a { display: inline-block; margin-top: 14px; color: var(--teal-300); font-weight: 600; font-size: .875rem; }
@media (max-width: 800px) {
  .tonight { grid-template-columns: 1fr; }
  .tonight__list li { grid-template-columns: minmax(0, 1fr) auto; }
  .tonight__fit { grid-column: 1 / -1; justify-self: start; }
}

/* --- (8) Kam dál -------------------------------------------------------------- */
.explore { background: var(--paper-2); border-top: 1px solid var(--line); padding-block: 48px 56px; }
.explore .container { max-width: calc(1180px + 2 * var(--gutter)); }
.guide-siblings-after + .explore { border-top-color: var(--line-strong); }
.explore h2 { font-size: 1.75rem; }
.explore__lead { color: var(--ink-2); margin-top: 8px; }
.explore-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; list-style: none; padding: 0; }
.ex-card { display: flex; flex-direction: column; height: 100%; background: var(--paper); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-card); transition: transform .25s var(--ease-out); }
.ex-card:hover { transform: translateY(-2px); }
.ex-card:hover strong { color: var(--teal-700); }
.ex-card:focus-visible { outline: 3px solid var(--teal-700); outline-offset: 3px; }
.ex-card__img { position: relative; aspect-ratio: 1.8; background: var(--navy-900) url("/assets/constellations.png") center / cover; display: flex; align-items: end; padding: 14px; }
.ex-card__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ex-card__img span { position: relative; font: 700 .7rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; background: var(--teal-400); color: var(--navy-900); padding: 5px 9px; border-radius: 999px; }
.ex-card__body { display: block; padding: 18px 20px 22px; }
.ex-card strong { display: block; font: 600 1.15rem/1.35 var(--font-display); overflow-wrap: anywhere; }
.ex-card__text { display: block; font-size: .85rem; color: var(--ink-2); margin-top: 8px; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; list-style: none; padding: 0; }
.topic-chips a { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: .875rem; color: var(--ink); text-decoration: none; background: var(--paper); transition: border-color .2s; }
.topic-chips a:hover { border-color: var(--teal-700); }
.topic-chips em { font-style: normal; color: var(--ink-3); font-weight: 400; }
@media (max-width: 800px) {
  .explore-grid { grid-template-columns: 1fr; }
  .ex-card__img { aspect-ratio: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .ex-card, .ex-card:hover { transition: none; transform: none; }
}

/* --- Glossary terms in the text and the pop-up (public/terms.js) ----------- */
.prose a.term { color: inherit; text-decoration: underline dotted var(--teal-700); text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: help; }
.prose a.term:hover { color: var(--teal-700); }
.prose a.term:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 2px; border-radius: 2px; }
.term-pop { position: absolute; z-index: 20; width: min(300px, calc(100vw - 32px)); box-sizing: border-box; background: var(--navy-900); color: var(--on-dark); font: 400 .8125rem/1.5 var(--font-body); padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow-float); animation: term-pop-in .14s var(--ease-out); }
.term-pop strong { display: block; font-size: .875rem; margin-bottom: 2px; }
.term-pop a { color: var(--teal-300); display: block; margin-top: 8px; font-weight: 600; }
.term-pop a:focus-visible { outline: 2px solid var(--teal-300); outline-offset: 2px; }
@keyframes term-pop-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .term-pop { animation: none; } }

/* --- Glossary page (/pruvodce/pojmy/) -------------------------------------- */
.glossary-empty { font-size: 1.125rem; color: var(--ink-2); }
.glossary-index ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 12px; padding: 0; }
.glossary-index a { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding-inline: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); color: var(--teal-700); font-weight: 700; text-decoration: none; }
.glossary-index a:hover { background: var(--paper-2); }
.glossary-term { padding-block: 28px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.glossary-term:first-of-type { margin-top: 24px; }
.glossary-term h2 { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.25; }
.glossary-term__summary { margin-top: 8px; color: var(--ink-2); overflow-wrap: anywhere; }
.glossary-term .prose { margin-top: 12px; }
.glossary-back { margin-top: 32px; }
/* A term's diagram (src/term-figures/<slug>.svg, inlined): light line art on a night-sky panel, beside the
   text from 760 px up, under the summary below that. The SVG uses only the f-* classes, so every diagram
   shares these colours. */
.glossary-term--figure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); grid-template-areas: "title figure" "summary figure" "body figure"; grid-template-rows: auto auto 1fr; column-gap: 36px; }
.glossary-term--figure > h2 { grid-area: title; }
.glossary-term--figure > .glossary-term__summary { grid-area: summary; }
.glossary-term--figure > .prose { grid-area: body; }
.term-figure { grid-area: figure; align-self: start; margin: 4px 0 0; padding: 10px; background: var(--navy-800); border-radius: var(--radius-m); }
.term-figure svg { display: block; width: 100%; height: auto; }
.term-figure .f-line { fill: none; stroke: var(--on-dark-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.term-figure .f-dim { fill: none; stroke: var(--on-dark-3); stroke-width: 1; stroke-dasharray: 3 4; stroke-linecap: round; }
.term-figure .f-accent { fill: none; stroke: var(--teal-300); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.term-figure .f-fill { fill: var(--on-dark); stroke: none; }
.term-figure .f-fill-accent { fill: var(--teal-300); stroke: none; }
.term-figure .f-sun { fill: #f6c85f; stroke: none; }
.term-figure .f-dust { fill: #e8b27a; stroke: none; }
.term-figure .f-ion { fill: #8fb8ff; stroke: none; }
.term-figure .f-earth { fill: #5fa8e0; stroke: none; }
.term-figure .f-glow { fill: var(--on-dark); stroke: none; opacity: .14; }
.term-figure text { font-family: var(--font-body); font-size: 11px; fill: var(--on-dark-2); }
.term-figure text.f-label-accent { fill: var(--teal-300); font-weight: 600; }
.term-figure text.f-label-strong { fill: var(--on-dark); font-weight: 600; }
@media (max-width: 759px) {
  .glossary-term--figure { display: block; }
  .term-figure { margin-top: 16px; max-width: 420px; }
}

/* --- Phone reading bars (public/guide-article.js reveals them; below 1000 px only) ---------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; background: var(--teal-400); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }
.next-bar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--navy-800); color: #fff; text-decoration: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); animation: next-bar-in .25s var(--ease-out); }
.next-bar[hidden], .reading-progress[hidden] { display: none; }
.next-bar__text { min-width: 0; }
.next-bar small { display: block; color: var(--teal-300); font-size: .7rem; line-height: 1.4; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.next-bar b { display: block; font: 600 .875rem/1.3 var(--font-display); overflow-wrap: anywhere; }
.next-bar__arr { margin-left: auto; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--teal-400); color: var(--navy-900); display: grid; place-items: center; }
.next-bar:focus-visible { outline: 3px solid var(--teal-300); outline-offset: 3px; }
@keyframes next-bar-in { from { opacity: 0; transform: translateY(12px); } }
@media (min-width: 1000px) { .reading-progress, .next-bar { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .next-bar { animation: none; } }
