/* ==========================================================================
   Použitelné a přístupné webové formuláře — styl webu (verze 2026)
   Jeden soubor pro obrazovku i tisk. Barvy a rozměry jsou v proměnných
   hned na začátku, aby se dal vzhled snadno ladit.
   ========================================================================== */

@layer zaklad, klasika;

:root {
  color-scheme: light dark;

  --paper: #f3f7f8;
  --card: #ffffff;
  --ink: #122229;
  --ink-2: #44575f;
  --rule: #c9d6da;
  --rule-2: #e1e9eb;

  --blue: #0a5a8c;
  --blue-d: #07456b;
  --blue-bg: #e5f0f7;
  --on-blue: #ffffff;

  --green: #1b6b55;
  --green-bg: #e4f3ee;

  --red: #b3261e;
  --red-bg: #fdecea;

  --note: #fff6cc;
  --note-edge: #d9b92f;
  --note-ink: #3d3200;

  --field: #ffffff;
  --field-edge: #6c7f88;
  --code-bg: #edf3f5;
  --focus: #0a5a8c;

  --k-tag: #0a5a8c;
  --k-attr: #8a4b08;
  --k-str: #0f6b4f;
  --k-com: #56626b;
  --k-ent: #8e2a7a;

  --sans: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI Variable Text", "Segoe UI",
          system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --nav-w: 15.5rem;
  --sloupec: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f171b;
    --card: #16222a;
    --ink: #e4edf0;
    --ink-2: #a5b6bd;
    --rule: #2c3c44;
    --rule-2: #22313a;

    --blue: #8cc8f0;
    --blue-d: #b6dcf7;
    --blue-bg: #14293a;
    --on-blue: #0b1a24;

    --green: #74d4b3;
    --green-bg: #133229;

    --red: #ff9a92;
    --red-bg: #3a1a18;

    --note: #3a3210;
    --note-edge: #a38a1b;
    --note-ink: #f6e9a8;

    --field: #0c1317;
    --field-edge: #7f939c;
    --code-bg: #111d23;
    --focus: #9cd0f5;

    --k-tag: #8cc8f0;
    --k-attr: #f0b27a;
    --k-str: #7fd8b4;
    --k-com: #9aa9b1;
    --k-ent: #e0a0d4;
  }
}

/* ------------------------------------------------------------------ základ */
@layer zaklad {
  *, *::before, *::after { box-sizing: border-box; }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 1rem;
  }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  img { max-width: 100%; height: auto; }

  a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
  a:hover { color: var(--blue-d); text-decoration-thickness: 0.14em; }

  :focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 2px;
  }
  main:focus { outline: none; }

  /* odkaz mimo tento web: šipka za textem */
  a.ext::after {
    content: "\00a0\2197";
    content: "\00a0\2197" / "";
    font-size: 0.85em;
    text-decoration: none;
    display: inline-block;
  }

  code, kbd, samp {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--code-bg);
    padding: 0.08em 0.35em;
    border-radius: 3px;
    overflow-wrap: anywhere;
  }
  pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
}

.preskocit {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--blue);
  color: var(--on-blue);
  padding: 0.6rem 1rem;
  border-radius: 0 0 4px 4px;
  z-index: 50;
  font-weight: 700;
}
.preskocit:focus { top: 0; color: var(--on-blue); }

/* ------------------------------------------------------------------ hlavička */
.hlava {
  background: var(--blue);
  color: var(--on-blue);
}
.hlava-in {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.5rem;
}
.znacka {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--on-blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.znacka:hover { color: var(--on-blue); text-decoration: underline; }
.znacka-ik { flex: none; }
.hlava :focus-visible { outline-color: var(--on-blue); }
/* logo autora vpravo (odkaz na plavacek.net); bez odkazu v HTML ho doplní skript,
   a když ani ten neběží, zobrazí se alespoň jako obrázek na pozadí */
.znacka-ik { width: 40px; height: 40px; }
.logo-autor { order: 2; flex: none; display: block; margin-left: auto; line-height: 0; border-radius: 4px; }
.logo-autor img { display: block; height: 3rem; width: auto; }
.hlava-in:not(:has(.logo-autor))::after {
  content: "";
  order: 2;
  flex: none;
  margin-left: auto;
  width: 13.6rem;
  height: 3rem;
  background: url("../img/plavacek-logo.svg") no-repeat right center / contain;
}
.hlava .menu-tl { order: 3; }
/* v tmavém režimu zůstává hlavička tmavě modrá, aby bylo vidět světlé logo */
@media (prefers-color-scheme: dark) {
  .hlava { --on-blue: #ffffff; background: #0b3d5f; border-bottom: 1px solid #1d5a85; }
}

.menu-tl {
  display: none;
  font: inherit;
  font-weight: 700;
  color: var(--on-blue);
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 4px;
  padding: 0.35rem 0.8rem;
  min-height: 2.5rem;
  cursor: pointer;
  flex: none;
}
.menu-tl[aria-expanded="true"] { background: var(--on-blue); color: var(--blue); }

/* ------------------------------------------------------------------ rozložení */
.rozlozeni {
  flex: 1;
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  gap: 1rem 3.5rem;
  align-items: start;
}

/* ------------------------------------------------------------------ navigace */
.nav {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-bottom: 1rem;
  font-size: 0.98rem;
}
.nav-skupina {
  margin: 1.4rem 0 0.35rem;
  font-weight: 700;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.nav-skupina:first-child { margin-top: 0.2rem; }
.nav ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.nav li { border-bottom: 1px solid var(--rule-2); }
.nav a {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.5rem 0.4rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
}
.nav a:hover { background: var(--blue-bg); color: var(--ink); }
.nbox {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.18rem;
  border: 2px solid var(--field-edge);
  border-radius: 3px;
  background: var(--field);
}
.nav a[aria-current="page"] { font-weight: 700; color: var(--blue); }
.nav a[aria-current="page"] .nbox {
  border-color: var(--blue);
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4 6.6 11.4 12.5 4.8' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
@media (prefers-color-scheme: dark) {
  .nav a[aria-current="page"] .nbox {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4 6.6 11.4 12.5 4.8' fill='none' stroke='%230b1a24' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

/* ------------------------------------------------------------------ obsah stránky */
main { min-width: 0; max-width: var(--sloupec); }

.krok {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--ink-2);
  font-weight: 700;
}
.krok-boxy { display: inline-flex; gap: 4px; }
.krok-boxy .b {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid var(--field-edge);
  border-radius: 3px;
  background: transparent;
}
.krok-boxy .hotovo { background: var(--blue); border-color: var(--blue); }
.krok-boxy .ted {
  border-color: var(--blue);
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4 6.6 11.4 12.5 4.8' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
  box-shadow: 0 0 0 3px var(--blue-bg);
}
@media (prefers-color-scheme: dark) {
  .krok-boxy .ted {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4 6.6 11.4 12.5 4.8' fill='none' stroke='%230b1a24' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

.clanek > :first-child { margin-top: 0; }

h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; }
h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
  letter-spacing: -0.022em;
  font-weight: 800;
  color: var(--ink);
}
h2 {
  margin: 2.6rem 0 1rem;
  padding-bottom: 0.35rem;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 750;
  letter-spacing: -0.012em;
  border-bottom: 2px dotted var(--field-edge);   /* linka na vyplnění */
}
h3 {
  margin: 1.8rem 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue);
}
p { margin: 0 0 1.05rem; }
.lede {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 38rem;
  margin-bottom: 1.75rem;
}

ul, ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--blue); }

blockquote {
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 4px solid var(--rule);
  font-size: 1.06em;
}
blockquote p { margin: 0; }

strong { font-weight: 700; }

/* ------------------------------------------------------------------ rámečky */
.pozn, .reseni, .oznameni {
  margin: 1.6rem 0;
  padding: 1rem 1.25rem 1rem 1.25rem;
}
.pozn > :last-child, .reseni > :last-child, .oznameni > :last-child { margin-bottom: 0; }

/* poznámka z roku 2026: lístek s ohnutým rohem */
.pozn {
  position: relative;
  background: var(--note);
  color: var(--note-ink);
  border-left: 5px solid var(--note-edge);
  clip-path: polygon(0 0, calc(100% - 1.4rem) 0, 100% 1.4rem, 100% 100%, 0 100%);
}
.pozn::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 1.4rem; height: 1.4rem;
  background: linear-gradient(225deg, transparent 50%, var(--note-edge) 50%);
}
.pozn a { color: inherit; font-weight: 700; }
.pozn code { background: rgba(0, 0, 0, 0.08); }
@media (prefers-color-scheme: dark) { .pozn code { background: rgba(255, 255, 255, 0.1); } }

.reseni {
  background: var(--green-bg);
  border-left: 5px solid var(--green);
}
.reseni h3 { margin: 0 0 0.5rem; color: var(--green); font-size: 1.1rem; }
.reseni ul { margin-bottom: 0; }

.oznameni {
  background: var(--blue-bg);
  border-left: 5px solid var(--blue);
}
.oznameni h2 {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: 1.25rem;
}

.cil { font-size: 0.95em; color: var(--ink-2); }

/* ------------------------------------------------------------------ zdrojový kód */
pre.kod {
  position: relative;
  margin: 1.25rem 0 1.6rem;
  padding: 1.9rem 1.1rem 1rem;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
  tab-size: 2;
  color: var(--ink);
}
pre.kod::before {
  content: attr(data-jazyk);
  position: absolute;
  top: 0.45rem;
  left: 1.1rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
}
.k-c { color: var(--k-com); font-style: italic; }
.k-t { color: var(--k-tag); font-weight: 700; }
.k-a { color: var(--k-attr); }
.k-s { color: var(--k-str); }
.k-p { color: var(--ink-2); }
.k-e { color: var(--k-ent); }
.k-n { color: var(--k-ent); }

/* ------------------------------------------------------------------ obrázky (snímky obrazovky) */
figure { margin: 1.5rem 0; }
figure img {
  display: block;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 4px;
  border-radius: 4px;
}
figcaption { margin-top: 0.5rem; font-size: 0.92rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ tabulky s daty */
.tabulka-wrap { overflow-x: auto; margin: 1.25rem 0 1.6rem; border: 1px solid var(--rule); border-radius: 6px; }
.tabulka-wrap table { margin: 0; }
table.data { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: 0.95rem; }
table.data caption {
  text-align: left;
  font-weight: 700;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
}
table.data th, table.data td { padding: 0.6rem 0.9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule-2); }
table.data thead th { background: var(--blue-bg); color: var(--ink); border-bottom: 2px solid var(--rule); }
table.data tbody th { font-weight: 700; }
table.data tr:last-child > * { border-bottom: 0; }

/* ------------------------------------------------------------------ obsah webu (úvodní strana) */
.obsah-kapitol { list-style: none; padding: 0; margin: 0 0 2rem; counter-reset: x; border-top: 1px solid var(--rule); }
.obsah-kapitol li { margin: 0; padding: 0.75rem 0; border-bottom: 1px solid var(--rule-2); display: grid; gap: 0.1rem; }
.obsah-kapitol a { font-weight: 700; font-size: 1.08rem; }
.o-popis { color: var(--ink-2); font-size: 0.95rem; }

/* ------------------------------------------------------------------ listování */
.listovani {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px dotted var(--field-edge);
}
.listuj {
  display: grid;
  gap: 0.1rem;
  max-width: 48%;
  padding: 0.65rem 1.1rem;
  border: 2px solid var(--blue);
  border-radius: 4px;
  text-decoration: none;
  color: var(--blue);
  background: var(--card);
  line-height: 1.3;
}
.listuj:hover { background: var(--blue); color: var(--on-blue); }
.listuj-dal { text-align: right; margin-left: auto; }
.listuj-sm { font-size: 0.88rem; font-weight: 700; }
.listuj-sm::before { content: "\2039\00a0"; }
.listuj-dal .listuj-sm::before { content: none; }
.listuj-dal .listuj-sm::after { content: "\00a0\203A"; }
.listuj-t { font-size: 1.02rem; }

/* ------------------------------------------------------------------ patička */
.paticka {
  --f-bg: var(--blue);
  --f-ink: #ffffff;
  background: var(--f-bg);
  color: var(--f-ink);
  padding: 2.5rem 1rem 2.75rem;
  text-align: center;
}
/* v tmavém režimu stejná tmavě modrá jako hlavička */
@media (prefers-color-scheme: dark) {
  .paticka { --f-bg: #0b3d5f; border-top: 1px solid #1d5a85; }
}
.paticka :focus-visible { outline-color: var(--f-ink); }
.paticka-in { max-width: 44rem; margin: 0 auto; }
.p-blok { margin-bottom: 1.75rem; }
.paticka h2 {
  margin: 0 0 0.8rem;
  padding: 0;
  border: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0;
}
.p-tlacitka { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.p-tlacitka li { margin: 0; }
.tl {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
  padding: 0.65rem 1.1rem;
  min-height: 2.75rem;
  border: 2px solid var(--blue);
  border-radius: 4px;
  background: transparent;
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
}
.tl:hover { background: var(--blue); color: var(--on-blue); }
.paticka .tl { border-color: var(--f-ink); color: var(--f-ink); }
.paticka .tl:hover { background: var(--f-ink); color: var(--f-bg); }
.paticka a:not(.tl) { color: var(--f-ink); }
.tl-ext::after { content: "\00a0\2197"; content: "\00a0\2197" / ""; font-size: 0.85em; }
.p-stav { min-height: 1.6em; margin: 0.75rem 0 0; font-size: 0.95rem; color: inherit; }
.p-kredit { margin: 0; font-size: 0.95rem; color: inherit; }

/* kulaté tlačítko nahoru */
.nahoru {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: var(--on-blue);
  border: 2px solid #ffffff;   /* aby bylo vidět i nad modrou patičkou */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 40;
}
.nahoru:hover { background: var(--blue-d); color: var(--on-blue); }
.js .nahoru {
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.2s, transform 0.2s, visibility 0s 0.2s;
}
.js .nahoru.vidit { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  .js .nahoru { transition: none; transform: none; }
}

/* ------------------------------------------------------------------ ukázky (živé formuláře) */
.demo {
  position: relative;
  margin: 2.2rem 0 1.8rem;
  padding: 1.6rem 1.25rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 0 6px 6px 6px;
}
.demo::before {
  content: "Ukázka";
  content: "Ukázka" / "";
  position: absolute;
  left: -1px;
  top: -1.6rem;
  padding: 0.18rem 0.8rem;
  background: var(--blue);
  color: var(--on-blue);
  border-radius: 4px 4px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
}
.demo-nadpis { margin: 0 0 0.6rem; font-weight: 700; font-size: 1.1rem; }
.demo form { margin: 0; }
.demo form + form, .demo form + dl { margin-top: 1.5rem; }

/* Základní vzhled ovládacích prvků v klasických ukázkách.
   Je ve vrstvě „klasika“, aby ho šlo snadno přebít (viz moderní ukázka). */
@layer klasika {
  .demo label { font-weight: 600; }
  .demo :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="submit"], [type="button"], [type="color"], [type="file"]), select, textarea) {
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--field-edge);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    min-height: 2.5rem;
    max-width: 100%;
    width: 20rem;
  }
  .demo textarea { width: 24rem; min-height: 7rem; }
  .demo .mini { width: 6rem; }
  .demo .stredni { width: 11rem; }
  .demo input[type="checkbox"], .demo input[type="radio"] { width: 1.15rem; height: 1.15rem; margin: 0 0.45rem 0 0; vertical-align: -0.2em; accent-color: var(--blue); }
  .demo input[type="checkbox"] + label, .demo input[type="radio"] + label { font-weight: 400; }
  .demo fieldset {
    margin: 0 0 1rem;
    padding: 0.8rem 1rem 1rem;
    border: 1px solid var(--field-edge);
    border-radius: 4px;
    min-width: 0;
  }
  .demo legend { padding: 0 0.4rem; font-weight: 700; color: var(--blue); }
  .demo :is(button, input[type="submit"]) {
    font: inherit;
    font-weight: 700;
    padding: 0.55rem 1.2rem;
    min-height: 2.6rem;
    border: 2px solid var(--blue);
    border-radius: 4px;
    background: var(--blue);
    color: var(--on-blue);
    cursor: pointer;
  }
  .demo :is(button, input[type="submit"]).druhotne { background: transparent; color: var(--blue); }
  .demo :is(button, input[type="submit"]):hover { background: var(--blue-d); border-color: var(--blue-d); color: var(--on-blue); }
  .demo :is(button, input[type="submit"]).druhotne:hover { background: var(--blue-bg); color: var(--blue); }
  .demo .odeslani { margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
}

.demo-klasika-tab table { border-collapse: collapse; }
.demo table.formular th { font-weight: 400; text-align: left; vertical-align: top; padding: 0.35rem 1rem 0.35rem 0; }
.demo table.formular td { padding: 0.35rem 0; }
.demo table.formular th.horni { padding-top: 0.7rem; }

.demo dl.vychozi { margin: 0 0 0.5rem; }
.demo dl.vychozi dd { margin-left: 2.5rem; }
.demo dl.vedle { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 0.6rem 1rem; margin: 0; align-items: start; }
.demo dl.vedle dt { padding-top: 0.45rem; margin: 0; }
.demo dl.vedle dd { margin: 0; }
@media (max-width: 34rem) { .demo dl.vedle { grid-template-columns: 1fr; gap: 0.15rem; } .demo dl.vedle dd { margin-bottom: 0.6rem; } }

.demo p.pole-p { margin: 0 0 0.9rem; }
.demo .bez-okraje { margin: 0 0 0.5rem; }

/* ukázka ze stránky o stylování: otec a matka */
.demo-rodice .rodice { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }
.demo-rodice fieldset {
  margin: 0;
  padding: 0.8rem 1rem 1rem;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: right bottom;
  border: 3px double #7bbbe6;
  color: #2b3a42;
}
.demo-rodice legend {
  padding: 0.1rem 1rem;
  border: 1px solid #7bbbe6;
  background: #fff;
  color: #a60000;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.4rem;
}
.demo-rodice label { color: #2b3a42; }
.demo-rodice input[type="text"] { width: 12.5rem; max-width: 100%; }
.demo-rodice #otec { background-image: url("../img/man.gif"); }
.demo-rodice #matka { background-image: url("../img/woman.gif"); }
.demo-rodice .pole-p { margin-bottom: 0.4rem; }

/* rozsáhlý příklad: fieldsety v mřížce */
.fs-mriz { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; align-items: start; }
.fs-mriz > fieldset { margin: 0; }
.fs-mriz > .cela { grid-column: 1 / -1; }
.fs-mriz label { display: block; margin-top: 0.5rem; }
.fs-mriz label:first-of-type { margin-top: 0; }
.fs-mriz .volba { display: flex; align-items: center; margin: 0.2rem 0; min-height: 2.2rem; }
.fs-mriz .volba label { display: inline; margin: 0; }
.fs-mriz textarea { width: 100%; max-width: 100%; }

.kroky-formulare { list-style: none; padding: 0; margin: 1rem 0 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.kroky-formulare li { margin: 0; }
.kroky-formulare a, .kroky-formulare [aria-current] {
  display: block;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--blue);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.kroky-formulare [aria-current] { background: var(--blue); color: var(--on-blue); }

.stav-ukazky { margin: 1rem 0 0; padding: 0.7rem 1rem; background: var(--green-bg); border-left: 5px solid var(--green); }
.stav-ukazky[hidden] { display: none; }

/* závěrečná věta glosy */
.zaver { margin-top: 2rem; font-size: 1.2rem; font-style: italic; font-weight: 600; }

/* ------------------------------------------------------------------ mobil a tablet */
@media (max-width: 58rem) {
  .rozlozeni { grid-template-columns: minmax(0, 1fr); padding-top: 1rem; }
  .nav { position: static; max-height: none; overflow: visible; border-bottom: 1px solid var(--rule); padding-bottom: 1rem; margin-bottom: 0.5rem; }
  .js .nav { display: none; }
  .js .nav.otevrena { display: block; }
  .js .menu-tl { display: inline-block; }
  main { max-width: none; }
}
@media (max-width: 36rem) {
  .hlava-in { padding-block: 1rem; }
  .znacka { font-size: 1.1rem; gap: 0.65rem; }
  .znacka-ik { width: 30px; height: 30px; }
  .logo-autor img { height: 2.25rem; }
  .hlava-in:not(:has(.logo-autor))::after { width: 10.2rem; height: 2.25rem; }
  .listovani { flex-direction: column; }
  .listuj { max-width: none; }
  .listuj-dal { text-align: left; margin-left: 0; }
  .demo { padding-inline: 0.9rem; }
  .demo :is(input:not([type="checkbox"], [type="radio"]), select, textarea) { width: 100%; }
}

/* ------------------------------------------------------------------ vysoký kontrast Windows */
@media (forced-colors: active) {
  .pozn, .reseni, .oznameni { border: 2px solid CanvasText; clip-path: none; }
  .pozn::after { display: none; }
  .nbox, .krok-boxy .b { border-color: CanvasText; forced-color-adjust: none; }
  .krok-boxy .hotovo, .krok-boxy .ted { background: Highlight; border-color: Highlight; }
  .nav a[aria-current="page"] .nbox { background-color: Highlight; border-color: Highlight; }
}

/* ------------------------------------------------------------------ tisk */
@media print {
  @page { margin: 1.8cm 2cm; }
  :root { --paper: #fff; --card: #fff; --ink: #000; --ink-2: #333; --blue: #000; --rule: #999; --rule-2: #ccc; --code-bg: #f2f2f2; --note: #fff; --note-ink: #000; --note-edge: #000; --blue-bg: #fff; --green-bg: #fff; --green: #000; }
  body { font-size: 11pt; background: #fff; color: #000; display: block; }
  /* na papíře jen text: bez hlavičky, menu, kroků, tlačítek a patičky */
  .preskocit, .hlava, .nav, .krok, .paticka, .nahoru, .listovani { display: none !important; }
  .rozlozeni { display: block; padding: 0; }
  main { max-width: none; }
  /* obsah kapitol na úvodní straně na papíře nic nedává */
  .clanek h2:has(+ p + .obsah-kapitol), .clanek p:has(+ .obsah-kapitol), .obsah-kapitol { display: none; }
  .clanek h1 { margin-top: 0; }
  p, li { orphans: 3; widows: 3; }
  h2 { break-after: avoid; }
  h3 { break-after: avoid; color: #000; }
  pre.kod { white-space: pre-wrap; overflow: visible; border: 1px solid #999; break-inside: avoid; font-size: 9pt; }
  .k-t, .k-a, .k-s, .k-c, .k-p, .k-e, .k-n { color: #000; font-weight: inherit; }
  .demo, .pozn, .reseni, .oznameni, figure, table { break-inside: avoid; }
  .demo { border: 1px solid #999; }
  .demo::before { background: #fff; color: #000; border: 1px solid #999; border-bottom: 0; }
  .pozn { border: 1px solid #000; border-left-width: 5px; clip-path: none; }
  .pozn::after { display: none; }
  .reseni, .oznameni { border: 1px solid #000; border-left-width: 5px; }
  /* odkazy jsou na papíře obyčejný text */
  a, a:hover { color: #000; text-decoration: none; }
  a.ext::after { content: none; }
  /* jen na stránce se zdroji se u odkazů vypíše adresa, na papíře by ji jinak nikdo nenašel */
  body:has(.nav a[href="odkazy.html"][aria-current="page"]) .clanek a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; overflow-wrap: anywhere; }
  /* odkud text pochází */
  .clanek::after {
    content: "Zdroj: Použitelné a přístupné webové formuláře, plavacek.net/formulare";
    display: block; margin-top: 2rem; padding-top: 0.5rem; border-top: 1px solid #999; font-size: 9pt; color: #333;
  }
}
}
