/* Sdílené styly stránek typu „příručka / publikace“ (vznikly z /metodika-lean-six-sigma).
   Používají: lean6sigma/page.tsx, vr-education/page.tsx (a další stránky tohoto typu).
   Načítá <PageStyles name="publication-guide" /> jen na těchto stránkách – mimo globální CSS webu.
   Specifika jednotlivých stránek jsou v jejich vlastním souboru (např. lean-six-sigma.css).
   Stavební bloky v TSX: src/components/publication/guide.tsx (SectionHead, Lead, Analogy, Example, Takeaway, Figure, Toc)
   a src/components/publication/TocSpy.tsx. Cover je samostatně v publication-cover.css.
   Čisté CSS (mimo Tailwind), všechny třídy s prefixem pg-. */

.pg {
  --pg-brand: #00a94f;
  --pg-brand-2: #007a3b;
  --pg-accent: #3ddc84;
  --pg-dark: #0f2a1d;
  --pg-ink: #111111;
  --pg-text: #3d4744;
  --pg-muted: #5f6865;
  --pg-line: #e3e8e5;
  --pg-soft: #f4f8f5;
  --pg-mint: #eefaf2;
  --pg-warn: #b45309;
  --pg-warn-bg: #fff7e8;
  --pg-red: #d93f3f;
  --pg-radius: 16px;
  --pg-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  color: var(--pg-ink);
  background: #fff;
  /* Pojistka proti vodorovnému posunu celé stránky na mobilu. `clip` (na rozdíl od `hidden`)
     nevytváří scroll kontejner, takže sticky prvky uvnitř dál fungují. */
  overflow-x: clip;
}

.pg *,
.pg *::before,
.pg *::after { box-sizing: border-box; }

/* Responzivita: položky gridů se nesmí roztáhnout podle obsahu (SVG s min-width, široké tabulky).
   Bez min-width: 0 by se sloupec gridu natáhl na šířku obsahu a stránka by na mobilu přetekla. */
.pg-layout > *,
.pg-split > *,
.pg-duo > *,
.pg-media > * { min-width: 0; }
.pg-split,
.pg-layout { grid-template-columns: minmax(0, 1fr); }

/* Tělo článku (obsah vlevo + text): přes celou šířku okna, jen boční odsazení. */
.pg-wide { width: 100%; padding: 0 20px; }
@media (min-width: 1024px) { .pg-wide { padding: 0 40px; } }
@media (min-width: 1536px) { .pg-wide { padding: 0 60px; } }

/* ------------------------------------------------------------------ */
/* Layout článku + obsah                                               */
/* ------------------------------------------------------------------ */

.pg-layout {
  display: grid;
  gap: 32px;
  margin: 64px 0 72px;
}
@media (min-width: 1280px) {
  .pg-layout { grid-template-columns: 270px minmax(0, 1fr); gap: 56px; }
}

.pg-aside { display: none; }
@media (min-width: 1280px) {
  .pg-aside {
    display: block;
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding-right: 6px;
  }
  .pg-toc-mobile { display: none; }
}

.pg-toc-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pg-brand);
}
.pg-toc ol { margin: 0; padding: 0; list-style: none; }
/* číslování od 00, aby sedělo s eyebrow kapitol (00 · Úvod, 01 · …) */
.pg-toc > ol { counter-reset: pg-toc -1; }
.pg-toc > ol > li { counter-increment: pg-toc; margin: 0 0 10px; }
.pg-toc > ol > li > a {
  display: flex;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--pg-ink);
  text-decoration: none;
}
.pg-toc > ol > li > a::before {
  content: counter(pg-toc, decimal-leading-zero);
  flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 20px;
  color: var(--pg-brand);
}
.pg-toc > ol > li.is-plain > a::before { content: "·"; }
.pg-toc ol ol {
  margin: 6px 0 0 14px;
  padding-left: 16px;
  border-left: 1px solid var(--pg-line);
}
.pg-toc ol ol li { margin: 4px 0; }
.pg-toc ol ol a {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--pg-muted);
  text-decoration: none;
}
.pg-toc a:hover { color: var(--pg-brand); }

/* Kde právě jsme (TocSpy.tsx): kapitola zelená, aktivní podkapitola zvýrazněná proužkem na svislé lince */
.pg-toc > ol > li > a { transition: color 0.15s; }
.pg-toc > ol > li.is-current > a,
.pg-toc > ol > li > a.is-active { color: var(--pg-brand-2); }
.pg-toc ol ol a { position: relative; transition: color 0.15s; }
.pg-toc ol ol a.is-active { color: var(--pg-ink); font-weight: 600; }
.pg-toc ol ol a.is-active::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 2px;
  background: var(--pg-brand);
}
@media (prefers-reduced-motion: reduce) {
  .pg-toc a { transition: none; }
}

.pg-toc-mobile {
  /* odstup od první kapitoly (eyebrow „00 · …“ jinak lepí na rozbalovací obsah) */
  margin-bottom: 40px;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  background: var(--pg-soft);
}
.pg-toc-mobile > summary {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}
.pg-toc-mobile > summary::-webkit-details-marker { display: none; }
.pg-toc-mobile > summary::after { content: "+"; float: right; color: var(--pg-brand); font-weight: 400; }
.pg-toc-mobile[open] > summary::after { content: "–"; }
.pg-toc-mobile .pg-toc { padding: 0 18px 16px; }

/* Sekce */
/* Obsahový sloupec: omezený a vystředěný ve zbylém prostoru; běžný text drží čitelnou délku řádku. */
.pg-main { min-width: 0; width: 100%; max-width: 1180px; justify-self: center; }
.pg-prose > p,
.pg-prose > h3,
.pg-prose > h4,
.pg-prose > h5,
.pg-prose > ul:not([class]),
.pg-prose > ol:not([class]),
.pg-prose > .pg-lead-in { max-width: 780px; }
.pg-section { scroll-margin-top: 24px; }
.pg-section + .pg-section {
  margin-top: 72px;
  padding-top: 64px;
  border-top: 1px solid var(--pg-line);
}
.pg-section [id] { scroll-margin-top: 24px; }

.pg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pg-brand);
}
.pg-eyebrow::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: currentColor; }

.pg-h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) { .pg-h2 { font-size: 38px; } }

.pg-prose { font-size: 16px; line-height: 1.8; color: var(--pg-text); }
.pg-prose > * + * { margin-top: 16px; }
.pg-prose p { margin: 16px 0 0; }
.pg-prose h3 {
  margin: 48px 0 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--pg-ink);
}
.pg-prose h4 {
  margin: 32px 0 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--pg-ink);
}
.pg-prose h5 {
  margin: 24px 0 0;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--pg-ink);
}
.pg-prose strong { color: var(--pg-ink); font-weight: 600; }
.pg-prose a { color: var(--pg-brand-2); text-decoration: underline; text-underline-offset: 3px; }
.pg-prose a:hover { color: var(--pg-brand); }
.pg-prose ul,
.pg-prose ol { margin: 14px 0 0; padding-left: 22px; }
.pg-prose ul { list-style: disc; }
.pg-prose ol { list-style: decimal; }
.pg-prose li { margin: 6px 0; padding-left: 4px; }
.pg-prose li::marker { color: var(--pg-brand); }
.pg-prose abbr { text-decoration: none; border-bottom: 1px dotted var(--pg-muted); cursor: help; }
.pg-prose .pg-intro { font-size: 18px; line-height: 1.75; color: var(--pg-ink); }

/* Seznam s fajfkami */
.pg-checks {
  display: grid;
  gap: 10px;
  margin: 18px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
@media (min-width: 768px) { .pg-checks--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pg-checks li {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}
.pg-checks li::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 999px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300a94f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 14px no-repeat,
    var(--pg-mint);
}

/* Karty */
.pg-cards {
  display: grid;
  gap: 14px;
  margin: 22px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
@media (min-width: 640px) { .pg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .pg-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.pg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 22px !important;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--pg-shadow);
}
.pg-card h4,
.pg-card h5 {
  margin: 14px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--pg-ink);
}
.pg-card p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.65; color: var(--pg-muted); }
.pg-card ul { margin: 10px 0 0; padding-left: 18px; font-size: 14.5px; line-height: 1.6; color: var(--pg-muted); }
.pg-card li { margin: 4px 0; padding: 0; }
.pg-card-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pg-brand);
}
.pg-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pg-card-letter {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: #d6e6dc;
}
.pg-card--soft { background: var(--pg-soft); box-shadow: none; }
.pg-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 14px; }
.pg-tools span {
  padding: 2px 10px;
  border: 1px solid #dcebe2;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--pg-text);
  background: #fff;
}

.pg-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--pg-brand);
  background: var(--pg-mint);
  box-shadow: inset 0 0 0 1px rgba(0, 169, 79, 0.2);
}
.pg-icon svg { width: 24px; height: 24px; }
.pg-icon--dark { color: var(--pg-accent); background: var(--pg-dark); box-shadow: none; }
/* Zkratka místo ikony (např. VR / AR) */
.pg-icon strong,
.pg-prose .pg-icon strong { font-size: 14px; font-weight: 800; letter-spacing: 0.02em; color: inherit; }

/* Zvýrazněné boxy */
.pg-callout {
  margin: 24px 0 0 !important;
  padding: 18px 20px;
  border-left: 4px solid var(--pg-brand);
  border-radius: 0 12px 12px 0;
  background: var(--pg-mint);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--pg-ink);
}
.pg-callout p { margin: 0; }
.pg-callout p + p { margin-top: 8px; }
.pg-callout ul { margin-top: 8px; }
.pg-callout--warn { border-left-color: #f59e0b; background: var(--pg-warn-bg); }
.pg-callout-title { display: block; margin-bottom: 4px; font-weight: 700; }

/* Rámečky příručky: Pro představu / Příklad / Zapamatujte si */
.pg-analogy,
.pg-example,
.pg-takeaway {
  position: relative;
  margin: 24px 0 0 !important;
  padding: 20px 22px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.7;
}
.pg-analogy p,
.pg-example p { margin: 0; }
.pg-analogy p + p,
.pg-example p + p { margin-top: 8px; }
.pg-box-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pg-box-label::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: currentColor center / 12px no-repeat;
  -webkit-mask: var(--pg-box-icon) center / 14px no-repeat;
  mask: var(--pg-box-icon) center / 14px no-repeat;
}

.pg-analogy {
  --pg-box-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3Z'/%3E%3C/svg%3E");
  background: #fff8e6;
  color: #3f3a2c;
}
.pg-analogy .pg-box-label { color: #a16207; }

.pg-example {
  --pg-box-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7h-9M14 17H5M17 20a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM7 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z'/%3E%3C/svg%3E");
  border: 1px dashed #b9d9c6;
  background: #fff;
  color: var(--pg-text);
}
.pg-example .pg-box-label { color: var(--pg-brand); }

.pg-takeaway {
  --pg-box-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12v18l-6-4-6 4V3Z'/%3E%3C/svg%3E");
  margin-top: 40px !important;
  padding: 24px 26px;
  background: var(--pg-dark);
  color: #fff;
}
.pg-takeaway .pg-box-label { color: var(--pg-accent); }
.pg-takeaway ul {
  display: grid;
  gap: 8px 28px;
  margin: 4px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
@media (min-width: 900px) { .pg-takeaway ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pg-takeaway li {
  position: relative;
  margin: 0 !important;
  padding: 0 0 0 26px !important;
  font-size: 15.5px;
  line-height: 1.6;
  color: #e8f3ed;
}
/* zvýraznění na tmavém pozadí: .pg-prose strong by jinak nastavilo tmavou barvu textu */
.pg-takeaway li strong,
.pg-takeaway li a { color: #fff; font-weight: 700; }
.pg-takeaway li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f2a1d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 11px no-repeat,
    var(--pg-accent);
}

/* Úvodní odstavec kapitoly – bez rámečku, jen o kousek větší a tmavší než běžný text; stejná šířka řádku jako odstavce */
.pg-lead-in {
  max-width: 780px;
  margin: 20px 0 0 !important;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  color: #1f2a26;
}
.pg-lead-in p { margin: 0; }
.pg-lead-in p + p { margin-top: 10px; }
.pg-lead-in strong { font-weight: 600; }

/* Slovo úvodem – „dopis“ autora */
.pg-foreword {
  position: relative;
  margin: 28px 0 0 !important;
  /* mobil: ikona citace má vlastní místo nad textem (horní odsazení), nepřekrývá ho */
  padding: 70px 24px 28px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(61, 220, 132, 0.18), transparent 45%),
    linear-gradient(160deg, #eefaf2 0%, #f7fbf8 60%, #ffffff 100%);
  border: 1px solid #dcefe5;
  overflow: hidden;
}
.pg-foreword-quote {
  position: absolute;
  left: 20px;
  top: 22px;
  width: 36px;
  height: 36px;
  color: rgba(0, 169, 79, 0.35);
  pointer-events: none;
}
/* od 768 px: ikona v levém okraji vedle prvního řádku, text nad ní neleží */
@media (min-width: 768px) {
  .pg-foreword { padding: 44px 56px 36px 72px; }
  .pg-foreword-quote { left: 24px; top: 44px; }
}
.pg-foreword p {
  position: relative;
  max-width: 760px;
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--pg-text);
}
.pg-foreword .pg-foreword-lead {
  margin-top: 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.65;
  color: var(--pg-ink);
}

/* Časová osa (od 1100 px vodorovně); barvy teček: is-a (tmavá), is-b (brand), is-c (akcent) */
.pg-timeline {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 28px 0 0 !important;
  padding: 0 0 0 26px !important;
  list-style: none !important;
}
.pg-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--pg-dark), var(--pg-brand), var(--pg-accent));
}
.pg-timeline li { position: relative; margin: 0 !important; padding: 0 !important; }
.pg-timeline li::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: var(--pg-dark);
  box-shadow: 0 0 0 1px var(--pg-line);
}
.pg-timeline li.is-b::before { background: var(--pg-brand); }
.pg-timeline li.is-c::before { background: var(--pg-accent); }
.pg-tl-year {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--pg-brand-2);
}
.pg-timeline strong { display: block; margin-top: 2px; font-size: 15px; color: var(--pg-ink); }
.pg-timeline span:not(.pg-tl-year) { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.55; color: var(--pg-muted); }
@media (min-width: 1100px) {
  .pg-timeline { grid-template-columns: repeat(var(--pg-tl-cols, 5), minmax(0, 1fr)); gap: 20px; padding: 26px 0 0 !important; }
  .pg-timeline::before { left: 0; right: 0; top: 7px; bottom: auto; width: auto; height: 2px; background: linear-gradient(90deg, var(--pg-dark), var(--pg-brand), var(--pg-accent)); }
  .pg-timeline li::before { left: 0; top: -26px; }
}

/* Drobné doplňky */
.pg-card-ex,
.pg-step-ex {
  margin-top: 10px !important;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--pg-soft);
  font-size: 13.5px !important;
  line-height: 1.55;
  color: var(--pg-text) !important;
}
.pg-card-ex::before,
.pg-step-ex::before {
  content: "Příklad: ";
  font-weight: 700;
  color: var(--pg-brand-2);
}
.pg-card-ex:lang(en)::before,
.pg-step-ex:lang(en)::before { content: "Example: "; }
.pg-note { font-size: 14px; color: var(--pg-muted); }

/* Slovníček */
.pg-glossary {
  display: grid;
  gap: 12px;
  margin: 20px 0 0 !important;
}
@media (min-width: 900px) { .pg-glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pg-glossary > div {
  padding: 16px 18px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: #fff;
}
.pg-glossary dt { font-size: 15px; font-weight: 700; color: var(--pg-ink); }
.pg-glossary dd { margin: 4px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--pg-muted); }

/* Ilustrace – zapojené do textu.
   Mobil/tablet: pod nadpisem, max. 560 px, vystředěné (úzký telefon = posun do strany, aby text v SVG zůstal čitelný).
   Od 1100 px: obtékané vpravo (~ 63 % sloupce), text vysvětlení běží vedle. Figure stojí v DOM před
   odstavci, které vysvětluje. Bloky na celou šířku (karty, tabulky, …) obtékání ukončí (clear níže). */
.pg-figure {
  max-width: 560px;
  margin: 20px auto 0 !important;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: var(--pg-soft);
}
.pg-figure figcaption {
  max-width: 60ch;
  margin: 10px auto 2px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--pg-muted);
  text-align: center;
}
.pg-svg { display: block; width: 100%; height: auto; margin: 0 auto; overflow: visible; }
.pg-svg text { font-family: inherit; }
.pg-figure-media { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pg-figure-media > .pg-svg { max-height: 46vh; }
.pg-figure-media > img { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 8px; }
.pg-figure--m .pg-svg,
.pg-figure--l .pg-svg { min-width: 440px; }
.pg-figure--s { max-width: 360px; }

/* Klikací schéma (např. vizuál v coveru): plochy .pg-hot uvnitř odkazů se při hoveru/focusu zesvětlí */
.pg-svg-link { filter: drop-shadow(0 18px 28px rgba(15, 42, 29, 0.16)); }
.pg-svg-link a { cursor: pointer; outline: none; }
.pg-svg-link .pg-hot { transition: filter 0.2s; }
.pg-svg-link a:hover .pg-hot,
.pg-svg-link a:focus-visible .pg-hot { filter: brightness(1.12); }
.pg-svg-link .pg-more { opacity: 0.7; transition: opacity 0.2s; }
.pg-svg-link a:hover .pg-more,
.pg-svg-link a:focus-visible .pg-more { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .pg-svg-link .pg-hot,
  .pg-svg-link .pg-more { transition: none; }
}

@media (min-width: 1100px) {
  /* Poměr text : obrázek ≈ 35 : 65 */
  .pg-prose > .pg-figure {
    float: right;
    clear: right;
    width: 63%;
    max-width: 780px;
    margin: 6px 0 16px 32px !important;
  }
  .pg-prose > .pg-figure .pg-svg { max-height: 62vh; }
  .pg-prose > .pg-figure--s { width: min(40%, 420px); }
  .pg-figure--m .pg-svg,
  .pg-figure--l .pg-svg { min-width: 0; }
}

/* Obtékání: sekce floaty obsahuje; rámečky s pozadím se zúží vedle obrázku (flow-root), široké bloky obtékání ukončí. */
.pg-prose { display: flow-root; }
.pg-analogy,
.pg-example,
.pg-callout { display: flow-root; }
.pg-steps > li { display: flow-root; }
.pg-prose > h3,
.pg-prose > h4,
.pg-cards,
.pg-checks,
.pg-glossary,
.pg-foreword,
.pg-timeline,
.pg-duo,
.pg-table-wrap,
.pg-details,
.pg-links,
.pg-split,
.pg-media,
.pg-chips,
.pg-takeaway { clear: both; }

/* Rozložení obrázek + text (sticky obrázek vlevo, kroky vpravo) */
.pg-split { display: grid; gap: 24px; align-items: start; margin-top: 24px; }
@media (min-width: 1100px) { .pg-split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; } }
.pg-split-side {
  overflow: hidden;
  border-radius: 18px;
  background: var(--pg-soft);
}
@media (min-width: 1100px) { .pg-split-side { position: sticky; top: 24px; } }
.pg-split .pg-figure { float: none; width: 100%; max-width: none; margin: 0 !important; padding: 24px 24px 8px; background: transparent; }
.pg-split .pg-figure .pg-svg { max-height: none; min-width: 0; max-width: 520px; }
.pg-split-note {
  margin: 0 !important;
  padding: 16px 24px 22px;
  border-top: 1px solid #e1ebe5;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--pg-text);
}

/* Text + médium (video, obrázek) vedle sebe od 1100 px */
.pg-media { display: grid; gap: 18px; align-items: start; margin-top: 20px !important; }
@media (min-width: 1100px) { .pg-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; } }
.pg-media > div > p:first-child { margin-top: 0; }

/* Video (YouTube iframe) v poměru 16 : 9 */
.pg-video {
  display: block;
  width: 100%;
  max-width: 780px;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-top: 20px;
  border: 0;
  border-radius: 14px;
  background: var(--pg-dark);
  box-shadow: var(--pg-shadow);
}
.pg-media .pg-video { margin-top: 0; }

/* Odkazy jako štítky (např. přehled kurzů) */
.pg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.pg-chips li { margin: 0 !important; padding: 0 !important; }
.pg-chips a,
.pg-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #d5e7dc;
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  line-height: 1.35;
  color: var(--pg-ink) !important;
  text-decoration: none !important;
  transition: border-color 0.15s, background-color 0.15s;
}
.pg-chips a:hover { border-color: var(--pg-brand); background: var(--pg-mint); }
.pg-chips a[target="_blank"]::after { content: "↗"; font-size: 12px; color: var(--pg-brand); }
.pg-chips span { color: var(--pg-muted) !important; border-style: dashed; }

/* Kroky (číslované) */
.pg-steps {
  display: grid;
  gap: 14px;
  margin: 22px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
  counter-reset: pg-step;
}
@media (min-width: 768px) { .pg-steps--row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pg-steps--row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pg-steps--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* Svislé seznamy kroků s krátkými texty nenatahovat přes celý sloupec. */
.pg-prose > .pg-steps:not(.pg-steps--row) { max-width: 860px; }
.pg-steps > li {
  counter-increment: pg-step;
  position: relative;
  margin: 0 !important;
  padding: 18px 18px 18px 64px !important;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  background: #fff;
  font-size: 15px;
  line-height: 1.65;
}
.pg-steps > li::before {
  content: counter(pg-step);
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--pg-brand);
  box-shadow: 0 0 0 5px rgba(0, 169, 79, 0.12);
}
.pg-steps--letters > li::before { content: attr(data-letter); }
.pg-steps--row > li { padding: 62px 18px 18px !important; }
.pg-steps--row > li::before { left: 18px; }
.pg-steps strong { display: block; color: var(--pg-ink); }
.pg-steps p { margin: 4px 0 0; color: var(--pg-muted); font-size: 14.5px; }

/* Krátké postupy: bez boxů, čísla spojená svislou linkou (osa) */
.pg-steps--compact { gap: 0; }
.pg-steps--compact > li {
  min-height: 34px;
  padding: 5px 0 20px 50px !important;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--pg-text);
}
.pg-steps--compact > li:last-child { padding-bottom: 0 !important; }
.pg-steps--compact > li::before {
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  font-size: 13px;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px rgba(0, 169, 79, 0.18);
}
.pg-steps--compact > li::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(rgba(0, 169, 79, 0.45), rgba(0, 169, 79, 0.15));
}
.pg-steps--compact > li:last-child::after { display: none; }
.pg-steps--compact strong { display: inline; }

/* Rozbalovací tabulky */
.pg-details {
  margin: 14px 0 0 !important;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  background: #fff;
}
.pg-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--pg-ink);
  list-style: none;
}
.pg-details > summary::-webkit-details-marker { display: none; }
.pg-details > summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--pg-brand);
  border-bottom: 2px solid var(--pg-brand);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.15s;
}
.pg-details[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.pg-details > summary small { font-weight: 500; color: var(--pg-muted); }
.pg-details-body { padding: 0 20px 20px; }
.pg-details-body > p:first-child { margin-top: 0; }

/* Tabulky */
.pg-table-wrap {
  margin: 20px 0 0 !important;
  overflow-x: auto;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
}
.pg-details .pg-table-wrap { margin-top: 4px !important; }
.pg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
  color: var(--pg-text);
}
.pg-table caption {
  padding: 12px 16px;
  font-size: 13px;
  text-align: left;
  color: var(--pg-muted);
  caption-side: bottom;
  border-top: 1px solid var(--pg-line);
}
.pg-table th,
.pg-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--pg-line);
  text-align: left;
  vertical-align: top;
}
.pg-table thead th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pg-ink);
  background: var(--pg-soft);
  white-space: nowrap;
}
.pg-table tbody th { font-weight: 600; color: var(--pg-ink); }
.pg-table tbody tr:last-child > * { border-bottom: 0; }
.pg-table td + td,
.pg-table th + td,
.pg-table th + th,
.pg-table td + th { border-left: 1px solid var(--pg-line); }
.pg-table .num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-table .score {
  font-weight: 700;
  color: var(--pg-ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.pg-table .is-highlight > * { background: var(--pg-mint); }
.pg-table--compare th:first-child { width: 22%; }
.pg-table--compare td:last-child { background: #f7fbf8; }
.pg-table--wide { min-width: 760px; }
.pg-table a { color: var(--pg-brand-2); }

/* Dvousloupec */
.pg-duo { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 900px) { .pg-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Literatura a citace */
.pg-refs { margin: 18px 0 0 !important; padding-left: 22px !important; font-size: 14.5px; line-height: 1.7; }
.pg-refs li { margin: 6px 0 !important; }
.pg-refs em { font-style: italic; }
.pg-cite {
  margin: 22px 0 0 !important;
  padding: 18px 20px;
  border: 1px dashed #c9d8cf;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--pg-text);
  background: #fbfdfc;
  overflow-wrap: anywhere;
}
.pg-cite strong { display: block; margin-bottom: 4px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pg-brand); }
.pg-cite em { font-style: italic; }
/* Sdílení pod citací (dříve v levém panelu) */
.pg-share { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.pg-share span { margin-right: 4px; font-size: 14px; color: var(--pg-muted, #525252); }
.pg-share a { display: inline-flex; border: 0 !important; text-decoration: none !important; transition: opacity .15s; }
.pg-share a:hover { opacity: .7; }

/* Odkazy na další stránky */
.pg-links {
  display: grid;
  gap: 12px;
  margin: 24px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
@media (min-width: 768px) { .pg-links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .pg-links--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pg-links--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pg-links li { margin: 0 !important; padding: 0 !important; }
.pg-links a {
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  color: var(--pg-ink) !important;
  text-decoration: none !important;
  background: #fff;
  transition: border-color 0.15s, transform 0.15s;
}
.pg-links a:hover { border-color: var(--pg-brand); transform: translateY(-2px); }
.pg-links strong { font-size: 15.5px; }
.pg-links span { font-size: 13.5px; line-height: 1.55; color: var(--pg-muted); }

@media (prefers-reduced-motion: reduce) {
  .pg-links a,
  .pg-chips a { transition: none; }
}

/* CTA na konci: ve sloupci obsahu, stejně široké jako obsah (bez vnitřního odsazení .dw), s mezerou nad sebou */
.pg-cta { margin-top: 80px; }
.pg-cta .dw { max-width: none; margin: 0; padding: 0; }

/* ------------------------------------------------------------------ */
/* Mobil: karty jako vodorovný karusel                                 */
/* Místo dlouhého sloupce karet pod sebou se karty posouvají prstem do strany.
   Karusel sahá až k okrajům displeje (záporný okraj = boční odsazení .pg-wide), karty se zarovnávají
   (scroll-snap) a kraj další karty vykukuje jako nápověda, že je co posouvat. Bez JavaScriptu. */
/* ------------------------------------------------------------------ */

@media (max-width: 639.98px) {
  .pg-prose :is(.pg-cards, .pg-links, .pg-glossary) {
    display: flex !important;
    gap: 12px;
    margin: 22px -20px 0 !important;
    padding: 4px 20px 14px !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .pg-prose :is(.pg-cards, .pg-links) > li,
  .pg-prose .pg-glossary > div {
    flex: 0 0 min(82%, 320px);
    scroll-snap-align: start;
  }
}

@media (max-width: 767.98px) {
  .pg-prose .pg-steps--row {
    display: flex !important;
    gap: 12px;
    margin: 22px -20px 0 !important;
    padding: 4px 20px 14px !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .pg-prose .pg-steps--row > li { flex: 0 0 min(72%, 280px); scroll-snap-align: start; }
}

.pg-prose :is(.pg-cards, .pg-links, .pg-glossary, .pg-steps--row)::-webkit-scrollbar { display: none; }
