/* Scitipedie — chrome webu (redesign 8/2026): navy sidebar s 264px obsahem
   + stabilním gutterem scrollbaru, topbar 58 px a mobilní offcanvas.
   Nahrazuje původní navbar/megamenu/footer.
   Hodnoty barev jen přes tokeny (tokens.css/theme.css); breakpoint lg = 992px. */

/* ===== Layout ===== */
html { background-color: var(--sc-bg); }
@media (min-width: 992px) {
  html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    background-image: linear-gradient(
      to bottom,
      var(--sc-card) 0,
      var(--sc-card) calc(var(--sc-topbar-h) - 1px),
      var(--sc-line) calc(var(--sc-topbar-h) - 1px),
      var(--sc-line) var(--sc-topbar-h),
      var(--sc-bg) var(--sc-topbar-h)
    );
    background-attachment: fixed;
  }
}
.sc-layout {
  --sc-sidebar-scrollbar-w: 8px;
  display: flex; min-height: 100vh;
}
.sc-main {
  flex: 1;
  min-width: 0;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}
.sc-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  padding: 18px 22px 24px;
}
@media (max-width: 991.98px) {
  .sc-content { padding: 14px 14px 20px; }
}

/* ===== Sidebar (desktop) ===== */
.sc-sidebar {
  display: none;
  width: calc(var(--sc-sidebar-w) + var(--sc-sidebar-scrollbar-w));
  flex-shrink: 0;
  background: var(--sc-ink);
  color: var(--sc-card);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh; /* Android Chrome: dynamická adresní lišta */
  overflow: hidden;
}
.sc-sidebar .sc-sidebar-navigace {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--sc-nav-fg-dim) transparent;
}
.sc-sidebar .sc-sidebar-navigace::-webkit-scrollbar { width: var(--sc-sidebar-scrollbar-w); }
.sc-sidebar .sc-sidebar-navigace::-webkit-scrollbar-track { background: var(--sc-ink); }
.sc-sidebar .sc-sidebar-navigace::-webkit-scrollbar-thumb {
  background-color: var(--sc-nav-fg-dim);
  border: 2px solid var(--sc-ink);
  border-radius: var(--sc-r-pill);
}
.sc-sidebar .sc-sidebar-navigace::-webkit-scrollbar-thumb:hover { background-color: var(--sc-nav-fg); }
@media (min-width: 992px) {
  .sc-sidebar { display: block; }
}

/* vnitřek sdílí desktop sidebar i mobilní offcanvas */
.sc-sidebar-telo {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.sc-sidebar-navigace {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px 14px;
}
.sc-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 16px;
  color: var(--sc-card); text-decoration: none;
}
.sc-brand img { height: 26px; }
.sc-brand span { font-weight: 800; font-size: 15px; letter-spacing: .05em; }
.sc-brand:hover { color: var(--sc-card); }
.sc-brand-anonym { color: var(--sc-ink); padding: 0; }
.sc-brand-anonym img { filter: invert(1); }

.sc-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--sc-nav-fg);
  font-size: 13.5px; font-weight: 600;
  text-decoration: none;
}
.sc-nav-item i { font-size: 15px; }
.sc-nav-text { min-width: 0; line-height: 1.35; }
.sc-nav-item:hover { background: var(--sc-nav-hover); color: var(--sc-card); }
.sc-nav-item.active { background: var(--sc-nav-active-bg); color: var(--sc-mint); font-weight: 700; }
.sc-nav-chevron { margin-left: auto; font-size: 12px !important; opacity: .55; }
/* počet záznamů u položek Katalogu (design: 11 px, tlumený, vpravo) */
.sc-nav-pocet {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--sc-nav-fg-dim); font-variant-numeric: tabular-nums;
}
.sc-nav-item.active .sc-nav-pocet { color: inherit; opacity: .75; }
/* Rodič stromu je jediný celoplošný toggle — název i chevron mají jednu akci. */
.sc-nav-vetev-toggle {
  width: 100%; border: 0; appearance: none;
  background: transparent; font-family: inherit; text-align: left; cursor: pointer;
}
.sc-nav-vetev-toggle.active { background: var(--sc-nav-active-bg); }
.sc-nav-vetev-toggle .sc-nav-chevron { opacity: .8; transition: transform .2s ease; }
.sc-nav-vetev-toggle.collapsed .sc-nav-chevron { transform: rotate(-90deg); }

.sc-nav-label {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sc-nav-fg-dim);
  margin: 16px 10px 6px;
}

/* strom Sektor → Oblast → Doména → Subdoména (rozbalený aktivní sektor) */
.sc-nav-strom {
  margin-left: 12px;
  border-left: 1px solid var(--sc-nav-line);
  padding-left: 12px;
  display: flex; flex-direction: column;
}
.sc-nav-strom .sc-nav-oblast {
  display: block;
  padding: 9px 8px 4px;
  color: var(--sc-nav-fg);
  font-size: 12.5px; font-weight: 750; line-height: 1.35;
  text-decoration: none;
}
.sc-nav-strom .sc-nav-oblast:hover { color: var(--sc-mint); }
.sc-nav-domena-skupina { min-width: 0; margin-left: 10px; }
.sc-nav-domena-skupina > .sc-nav-item {
  padding: 6px 8px;
  font-size: 13px; line-height: 1.35;
}
.sc-nav-domena-toggle .sc-nav-chevron { font-size: 10px !important; }
.sc-nav-subdomeny {
  margin: 2px 0 4px 12px;
  padding: 3px 0 3px 11px;
  border-left: 1px solid var(--sc-nav-line);
  display: flex; flex-direction: column; gap: 1px;
}
.sc-nav-subdomena {
  position: relative;
  display: block;
  padding: 5px 7px 5px 13px;
  border-radius: 7px;
  color: var(--sc-nav-fg);
  font-size: 12px; font-weight: 550; line-height: 1.35;
  text-decoration: none;
}
.sc-nav-subdomena::before {
  content: '';
  position: absolute; left: 4px; top: 11px;
  width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; opacity: .55;
}
.sc-nav-subdomena:hover { background: var(--sc-nav-hover); color: var(--sc-card); }
.sc-nav-subdomena.active {
  background: var(--sc-nav-active-bg);
  color: var(--sc-mint); font-weight: 700;
}

.sc-sidebar-paticka {
  flex: 0 0 auto;
  margin: 0 calc(14px + var(--sc-sidebar-scrollbar-w, 0px)) 14px 14px;
  border-top: 1px solid var(--sc-nav-line);
  padding-top: 10px;
  background: var(--sc-ink);
  display: flex; flex-direction: column; gap: 2px;
}
.sc-verze {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 2px;
  font-size: 12px;
  color: var(--sc-nav-fg-dim);
}
.sc-verze a { color: var(--sc-nav-fg); opacity: .7; text-decoration: none; }
.sc-verze a:hover { opacity: 1; color: var(--sc-card); }
.sc-verze-tecka { opacity: .5; }
.sc-uzivatel {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 4px;
}
.sc-uzivatel .sc-uzivatel-jmeno { font-size: 13px; font-weight: 700; color: var(--sc-card); }
.sc-uzivatel .sc-uzivatel-detail { font-size: 12px; color: var(--sc-nav-fg-dim); }
.sc-uzivatel > div { min-width: 0; }
.sc-uzivatel .sc-uzivatel-jmeno, .sc-uzivatel .sc-uzivatel-detail {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-odhlasit {
  margin-left: auto; color: var(--sc-nav-fg);
  width: 32px; height: 32px; flex: 0 0 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--sc-r-btn); text-decoration: none;
}
.sc-odhlasit:hover { color: var(--sc-card); background: var(--sc-nav-hover); }
/* ===== Topbar (desktop) ===== */
.sc-topbar {
  display: none;
  height: var(--sc-topbar-h);
  background: var(--sc-card);
  border-bottom: 1px solid var(--sc-line);
  align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 1030;
}
@media (min-width: 992px) {
  /* 3 sloupce: drobečky · hledání (max 420 px) · akce. */
  .sc-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px) minmax(0, 1fr);
  }
  .sc-topbar-anonym { display: flex; }
  .sc-topbar-mobil { display: none !important; }
}
.sc-topbar-vlevo { min-width: 0; display: flex; align-items: center; gap: 14px; }
.sc-topbar-akce { min-width: 0; display: flex; align-items: center; gap: 14px; justify-self: end; }

.sc-topbar .breadcrumb {
  margin: 0;
  font-size: 13px;
  --bs-breadcrumb-divider: '›';
  --bs-breadcrumb-divider-color: var(--sc-faint);
  --bs-breadcrumb-item-active-color: var(--sc-text);
}
.sc-topbar .breadcrumb a { color: var(--sc-muted); text-decoration: none; }
.sc-topbar .breadcrumb a:hover { color: var(--sc-accent); }
.sc-topbar .breadcrumb-item.active { font-weight: 700; }
.sc-topbar-vlevo > nav { min-width: 0; overflow: hidden; }

.sc-hledani {
  width: 100%; max-width: 420px;
  justify-self: center; position: relative;
  /* Main začíná za 272px sidebarem. Na širokém desktopu jeho polovinu odečteme,
     takže střed pilulky odpovídá středu viewportu stejně jako otevřená paleta.
     Mezi 992–1264 px posun plynule ubývá a nechává prostor drobečkům. */
  transform: translateX(clamp(
    calc((var(--sc-sidebar-w) + var(--sc-sidebar-scrollbar-w)) / -2),
    calc(496px - 50vw),
    0px
  ));
}
.sc-hledani-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--sc-card);
  border: 1px solid var(--sc-line-2);
  border-radius: var(--sc-r-pill);
  padding: 7px 14px;
  box-shadow: var(--sc-sh-1);
  color: var(--sc-muted);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.sc-hledani-pill:hover { box-shadow: var(--sc-sh-2); }
.sc-hledani-pill:focus { outline: 0; }
.sc-hledani-pill:focus-visible {
  border-color: var(--sc-accent);
  box-shadow: var(--sc-focus);
}
.sc-hledani-placeholder { font-size: 13px; color: var(--sc-muted); }
.sc-hledani-zkratky { display: inline-flex; gap: 5px; flex-shrink: 0; }
.sc-kbd {
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--sc-line-2); border-radius: 5px;
  padding: 1px 6px;
  background: var(--sc-card); color: var(--sc-muted);
  white-space: nowrap;
}

/* ===== ⌘K vyhledávací paleta ===== */
.sc-paleta .modal-dialog { max-width: 640px; margin-top: 9vh; }
.sc-paleta .modal-content {
  border-radius: 14px;
  border: 1px solid var(--sc-line);
  box-shadow: var(--sc-sh-2);
  overflow: hidden;
}
.sc-paleta-vstup {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--sc-line);
  color: var(--sc-muted);
}
.sc-paleta-vstup input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 14.5px; color: var(--sc-text);
  padding: 0;
}
.sc-paleta-chipy {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px 0;
}
.sc-paleta-vysledky {
  max-height: 46vh;
  overflow-y: auto;
  padding: 8px;
}
.sc-paleta-polozka {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--sc-text);
  text-decoration: none;
  font-size: 13.5px;
}
.sc-paleta-polozka:hover, .sc-paleta-polozka.aktivni { background: var(--sc-head-bg); color: var(--sc-text); }
.sc-paleta-polozka.aktivni { background: var(--sc-accent-tint); }
.sc-paleta-ikona {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--sc-line);
  background: var(--sc-card);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--sc-faint);
  flex-shrink: 0;
  overflow: hidden;
}
.sc-paleta-ikona img { width: 100%; height: 100%; object-fit: contain; }
.sc-paleta-label { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-paleta-enter { font-size: 12px; color: var(--sc-muted); opacity: 0; }
.sc-paleta-polozka.aktivni .sc-paleta-enter { opacity: 1; }
.sc-paleta-hint {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 20px;
  text-align: center;
  font-size: 13px; color: var(--sc-muted);
}
.sc-paleta-hint i { font-size: 20px; color: var(--sc-faint); }
.sc-paleta-paticka {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--sc-line);
  font-size: 12px; color: var(--sc-muted);
  background: var(--sc-head-bg);
}

/* CZ | EN přepínač (partials/_prepinac_jazyka_obsahu.html) jako pill */
#prepinac-jazyka .btn-group {
  border: 1px solid var(--sc-line-2);
  border-radius: var(--sc-r-pill);
  padding: 2px;
  background: var(--sc-card);
}
#prepinac-jazyka .btn {
  border: 0;
  border-radius: 999px !important;
  padding: 3px 11px;
  font-size: 12px; font-weight: 600;
  color: var(--sc-muted);
  background: transparent;
  box-shadow: none;
  min-height: 32px;
}
#prepinac-jazyka .btn.active { background: var(--sc-ink); color: var(--sc-card); font-weight: 700; }

.sc-avatar { width: 32px; height: 32px; border-radius: 999px; object-fit: cover; }
.sc-avatar-mobil { width: 28px; height: 28px; }
.sc-ucet-dropdown {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 999px; background: transparent;
}
.sc-ucet-menu {
  --bs-dropdown-min-width: min(300px, calc(100vw - 24px));
  max-height: calc(100vh - 76px); overflow-y: auto;
  padding: 6px;
}
.sc-ucet-menu .dropdown-header { padding: 8px 10px; overflow: hidden; }
.sc-ucet-menu .dropdown-header strong,
.sc-ucet-menu .dropdown-header .small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-ucet-menu .dropdown-divider { margin: 6px 0; }
.sc-ucet-menu .dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--sc-text);
}
.sc-ucet-menu .dropdown-item > i {
  width: 18px; flex: 0 0 18px; text-align: center;
  color: var(--sc-muted); font-size: 15px;
}
.sc-ucet-menu .dropdown-item.active {
  background: var(--sc-accent-tint); color: var(--sc-accent-ink);
}
.sc-ucet-menu .dropdown-item.active > i { color: var(--sc-accent); }
.sc-ucet-menu .dropdown-item.text-danger,
.sc-ucet-menu .dropdown-item.text-danger > i { color: var(--sc-bad) !important; }

/* ===== Topbar (mobil, navy) ===== */
.sc-topbar-mobil {
  background: var(--sc-ink);
  color: var(--sc-card);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  position: sticky; top: 0; z-index: 1030;
  order: -1;
}
.sc-topbar-mobil .sc-brand { padding: 0; color: var(--sc-card); text-decoration: none; }
.sc-topbar-mobil .sc-brand img { height: 22px; }
.sc-topbar-mobil .sc-brand span { font-size: 13.5px; }
.sc-hamburger {
  background: none; border: 0; color: var(--sc-card);
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1; padding: 0;
}
.sc-hamburger-hledani { font-size: 17px; }
.sc-topbar-mobil-akce { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.sc-topbar-mobil-akce i { font-size: 17px; }

/* ===== Mobilní offcanvas (stejný obsah jako sidebar) ===== */
.sc-offcanvas {
  --bs-offcanvas-width: 320px;
  --bs-offcanvas-bg: var(--sc-ink);
  --bs-offcanvas-color: var(--sc-card);
  --bs-offcanvas-padding-x: 0;
  --bs-offcanvas-padding-y: 0;
}
.sc-offcanvas .offcanvas-body {
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
}
.sc-offcanvas .sc-sidebar-telo { flex: 1; height: 100%; min-height: 0; padding: 0; }
.sc-offcanvas .sc-sidebar-navigace { padding: 14px 12px; }
.sc-offcanvas .sc-sidebar-paticka { margin: 0 12px 12px; }
.sc-offcanvas .sc-nav-item { font-size: 14px; padding: 9px 10px; border-radius: 9px; }
.sc-offcanvas .btn-close { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  .sc-nav-vetev-toggle .sc-nav-chevron { transition: none; }
}

/* ===== Informační pruh EN obsahu ===== */
.sc-callout-lista { margin: 0; border-width: 0 0 1px; border-radius: 0; padding: 7px 22px; }
@media (max-width: 991.98px) {
  .sc-callout-lista { padding: 5px 14px; }
  .sc-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    position: static;
    /* Z-index platí i pro statickou položku flexu; drobečky patří pod sticky hlavičku. */
    z-index: auto;
    height: auto;
    min-height: 40px;
    gap: 8px;
    padding: 6px 14px;
  }
  .sc-topbar-anonym, .sc-topbar.sc-topbar-prazdny { display: none; }
  .sc-topbar .sc-hledani, .sc-topbar .sc-ucet-desktop { display: none; }
  .sc-topbar .breadcrumb {
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .sc-topbar .breadcrumb-item { min-width: 0; }
  .sc-topbar .breadcrumb-item:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 575.98px) {
  .sc-topbar .breadcrumb-item:not(:nth-last-child(-n+2)) { display: none; }
}

/* ===== Globální zpětná vazba ===== */
.sc-toasty {
  position: fixed; right: 18px; bottom: 18px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  width: min(360px, calc(100vw - 28px));
}
.sc-toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--sc-line);
  border-radius: var(--sc-r-btn); background: var(--sc-card);
  color: var(--sc-text); box-shadow: var(--sc-sh-2);
}
.sc-toast-ok { border-color: var(--sc-ok-line); }
.sc-toast-warn { border-color: var(--sc-warn-line); }
.sc-toast-bad { border-color: var(--sc-bad-line); }
.sc-toast-zavrit {
  margin-left: auto; border: 0; background: transparent; color: var(--sc-muted);
}
.sc-potvrdit-ikona {
  width: 48px; height: 48px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sc-bad-tint); color: var(--sc-bad); font-size: 22px;
}

/* Mobilní breadcrumb se smršťuje jen v poslední položce; akce mají vlastní řádek. */
@media (max-width: 991.98px) {
  .sc-topbar-vlevo { flex: 1; min-width: 0; }
  .sc-topbar-vlevo > nav { flex: 1; }
  .sc-topbar .breadcrumb-item { flex: 0 0 auto; }
  .sc-topbar .breadcrumb-item:last-child { flex: 0 1 auto; min-width: 0; }
  .sc-topbar-akce { display: contents; }
  .sc-topbar-akce > #prepinac-jazyka { grid-column: 2; grid-row: 1; }
  .sc-topbar-akce > .btn { min-height: 44px; max-width: 100%; white-space: normal; }
  .sc-hamburger { min-width: 44px; min-height: 44px; }
  .sc-paleta-paticka { display: none; }
}
.sc-paleta-zavrit { flex: 0 0 44px; width: 44px; height: 44px; }
