/* ==========================================================================
   LiveHosting – vzhled nápovědy (MkDocs Material, světlé schéma)
   Obsah světlý, hlavička a patička tmavé (kvůli bílému logu a vazbě na web).
   Barvy nahoře sjednoť s :root ve style.css webu – zbytek se odvozuje.
   ========================================================================== */

:root {
  --lh-purple:        #8760fb;   /* brand – plochy, tlačítka */
  --lh-purple-light:  #a88bfc;
  --lh-purple-dark:   #6b45e0;   /* odkazy a text – lepší kontrast na bílé */
  --lh-navy:          #14112a;   /* hlavička, patička */
  --lh-bg:            #ffffff;
  --lh-surface:       #f8f6ff;   /* karty, upozornění */
  --lh-surface-2:     #efeafe;   /* hover, kód, záhlaví tabulek */
  --lh-border:        #e4ddfb;
  --lh-text:          #1d1a33;
  --lh-text-muted:    #5d5877;
  --lh-on-dark:       #e9e6f5;
  --lh-on-dark-muted: #a09bb8;
  --lh-radius:        14px;
  --lh-radius-sm:     8px;
}

/* --- Mapování na proměnné Materialu ------------------------------------ */

[data-md-color-scheme="default"] {
  --md-default-bg-color:            var(--lh-bg);
  --md-default-fg-color:            var(--lh-text);
  --md-default-fg-color--light:     var(--lh-text-muted);
  --md-default-fg-color--lighter:   rgba(29, 26, 51, 0.32);
  --md-default-fg-color--lightest:  rgba(29, 26, 51, 0.07);

  --md-primary-fg-color:            var(--lh-navy);
  --md-primary-fg-color--light:     var(--lh-purple-light);
  --md-primary-fg-color--dark:      var(--lh-purple-dark);
  --md-primary-bg-color:            #ffffff;
  --md-primary-bg-color--light:     var(--lh-on-dark-muted);
  --md-accent-fg-color:             var(--lh-purple);
  --md-accent-fg-color--transparent: rgba(135, 96, 251, 0.1);

  --md-typeset-color:               var(--lh-text);
  --md-typeset-a-color:             var(--lh-purple-dark);
  --md-code-bg-color:               var(--lh-surface-2);
  --md-code-fg-color:               #4a2fb8;
  --md-footer-bg-color:             var(--lh-navy);
  --md-footer-bg-color--dark:       #0c0a1b;
  --md-footer-fg-color:             var(--lh-on-dark);
  --md-footer-fg-color--light:      var(--lh-on-dark-muted);
}

/* --- Typografie ---------------------------------------------------------- */

.md-typeset {
  font-size: 0.8rem;
  line-height: 1.7;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  color: var(--lh-navy);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.md-typeset h1 { font-size: 2em; margin-bottom: 0.6em; }
.md-typeset h2 { font-size: 1.4em; margin-top: 2em; }
.md-typeset h3 { font-size: 1.1em; }

.md-content__inner > p:first-of-type {
  color: var(--lh-text-muted);
  font-size: 1.05em;
}

/* --- Hlavička a záložky ------------------------------------------------- */

.md-header,
.md-tabs {
  background: rgba(20, 17, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.md-header {
  border-bottom: 1px solid rgba(135, 96, 251, 0.25);
  box-shadow: none;
}

.md-header--shadow { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35); }

.md-header__button.md-logo img { height: 1.5rem; }

.md-header__topic:first-child { font-weight: 700; }

.md-tabs { border-bottom: 1px solid rgba(135, 96, 251, 0.25); }

.md-tabs__link {
  font-weight: 500;
  opacity: 0.75;
}

.md-tabs__link--active,
.md-tabs__link:hover {
  color: #fff;
  opacity: 1;
}

.md-tabs__item--active .md-tabs__link {
  box-shadow: inset 0 -2px 0 var(--lh-purple);
}

/* Odkazy zpět na web v hlavičce (overrides/main.html) */
.lh-header-links {
  display: flex;
  gap: 0.4rem;
  margin-left: 0.6rem;
}

.lh-header-links a {
  color: var(--lh-on-dark-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

.lh-header-links a:hover { color: #fff; }

.lh-header-links a.lh-cta {
  background: var(--lh-purple);
  color: #fff;
}

.lh-header-links a.lh-cta:hover { background: var(--lh-purple-dark); }

@media screen and (max-width: 76.25em) {
  .lh-header-links { display: none; }
}

/* --- Vyhledávání --------------------------------------------------------- */

.md-search__form {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(135, 96, 251, 0.3);
  border-radius: 999px;
}

.md-search__form:hover { background: rgba(255, 255, 255, 0.12); }

[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  border-radius: var(--lh-radius-sm) var(--lh-radius-sm) 0 0;
}

.md-search__output { background: var(--lh-bg); }

/* --- Navigace ------------------------------------------------------------ */

.md-nav__title { color: var(--lh-navy); }

.md-nav__link--active,
.md-nav__item .md-nav__link--active {
  color: var(--lh-purple-dark);
  font-weight: 600;
}

@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-nav__link--active {
    position: relative;
  }
  .md-sidebar--primary .md-nav__link--active::before {
    content: "";
    position: absolute;
    left: -0.6rem;
    top: 0.15em;
    bottom: 0.15em;
    width: 2px;
    border-radius: 2px;
    background: var(--lh-purple);
  }
}

/* --- Tlačítka ------------------------------------------------------------ */

.md-typeset .md-button {
  border: 1px solid var(--lh-purple);
  border-radius: 999px;
  color: var(--lh-purple-dark);
  font-weight: 600;
  padding: 0.55em 1.5em;
}

.md-typeset .md-button--primary,
.md-typeset .md-button:hover {
  background: var(--lh-purple);
  border-color: var(--lh-purple);
  color: #fff;
}

.md-typeset .md-button--primary:hover {
  background: var(--lh-purple-dark);
  border-color: var(--lh-purple-dark);
}

/* --- Rozcestník (grid cards) -------------------------------------------- */

.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius);
  padding: 1.1rem 1.2rem;
  transition: border-color 150ms, background-color 150ms;
}

.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid > .card:hover {
  background: var(--lh-surface-2);
  border-color: var(--lh-purple);
  box-shadow: 0 6px 20px rgba(135, 96, 251, 0.12);
}

.md-typeset .grid.cards .twemoji,
.md-typeset .grid.cards .lg {
  color: var(--lh-purple);
}

.md-typeset .grid.cards hr {
  border-color: var(--lh-border);
  margin: 0.6em 0;
}

/* --- Upozornění (admonitions) ------------------------------------------- */

.md-typeset .admonition,
.md-typeset details {
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  border-left-width: 3px;
  border-radius: var(--lh-radius-sm);
  box-shadow: none;
  font-size: 0.78rem;
}

.md-typeset .admonition-title,
.md-typeset summary {
  background: transparent !important;
  font-weight: 600;
}

.md-typeset .admonition.note,
.md-typeset details.note,
.md-typeset .admonition.info,
.md-typeset details.info,
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: var(--lh-border);
  border-left-color: var(--lh-purple);
}

.md-typeset .note > .admonition-title::before,
.md-typeset .info > .admonition-title::before,
.md-typeset .tip > .admonition-title::before,
.md-typeset .note > summary::before,
.md-typeset .info > summary::before,
.md-typeset .tip > summary::before {
  background-color: var(--lh-purple);
}

/* --- Kód ----------------------------------------------------------------- */

.md-typeset pre > code,
.md-typeset code {
  border-radius: var(--lh-radius-sm);
}

.md-typeset pre {
  border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius-sm);
}

.md-typeset :not(pre) > code {
  padding: 0.1em 0.4em;
  color: #4a2fb8;
}

.md-typeset kbd {
  background: var(--lh-surface-2);
  box-shadow: 0 0 0 1px var(--lh-border), 0 2px 0 var(--lh-border);
  color: var(--lh-text);
}

/* --- Tabulky ------------------------------------------------------------- */

.md-typeset table:not([class]) {
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius-sm);
  font-size: 0.75rem;
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background: var(--lh-surface-2);
  color: var(--lh-navy);
  font-weight: 600;
}

.md-typeset table:not([class]) td {
  border-top: 1px solid var(--lh-border);
}

/* --- Taby v obsahu ------------------------------------------------------- */

.md-typeset .tabbed-labels > label {
  font-weight: 500;
}

.md-typeset .tabbed-labels::before {
  background: var(--lh-purple);
}

/* --- Patička (overrides/partials/footer.html) --------------------------- */

.lh-footer {
  background: var(--lh-navy);
  border-top: 1px solid rgba(135, 96, 251, 0.25);
  color: var(--lh-on-dark-muted);
  font-size: 0.7rem;
}

.lh-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding: 2.4rem 0.8rem 1.6rem;
}

.lh-footer__brand img { height: 1.6rem; margin-bottom: 0.6rem; }
.lh-footer__brand p { margin: 0.2rem 0; }

.lh-footer h5 {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
}

.lh-footer ul { list-style: none; margin: 0; padding: 0; }
.lh-footer li { margin: 0.3rem 0; }

.lh-footer a { color: var(--lh-on-dark-muted); }
.lh-footer a:hover { color: var(--lh-purple-light); }

.lh-footer__bottom {
  border-top: 1px solid rgba(135, 96, 251, 0.2);
  padding: 1rem 0.8rem;
}

@media screen and (max-width: 60em) {
  .lh-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media screen and (max-width: 30em) {
  .lh-footer__grid { grid-template-columns: 1fr; }
}

/* --- Přístupnost --------------------------------------------------------- */

.md-typeset a:focus-visible,
.md-typeset .md-button:focus-visible,
.lh-header-links a:focus-visible {
  outline: 2px solid var(--lh-purple);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .md-typeset .grid.cards > ul > li { transition: none; }
}
