/* SOFON PDF – hotfix plovoucí navigace, modálu, režimu a patičky */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Třídy doplňuje sofon-hotfix.js podle skutečného režimu Stirling PDF. */
:root.sofon-dark-mode {
  --sofon-accent: #54d2ae;
  --sofon-accent-strong: #7ce1c4;
  --sofon-accent-soft: rgba(84, 210, 174, 0.14);
  --sofon-bg-a: #071712;
  --sofon-bg-b: #0b1725;
  --sofon-bg-c: #1b1126;
  --sofon-surface: rgba(13, 29, 28, 0.72);
  --sofon-surface-strong: rgba(14, 31, 30, 0.92);
  --sofon-border: rgba(161, 222, 207, 0.15);
  --sofon-text: #eefbf7;
  --sofon-muted: #afc8c1;
  --sofon-shadow: 0 24px 75px rgba(0, 0, 0, 0.38);
  --sofon-shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

:root.sofon-light-mode {
  color-scheme: light;
}

/* Původní Stirling skript nastavoval inline transformaci a zvětšenou šířku navbaru. */
.sofon-navbar-shell {
  z-index: 1030 !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  box-sizing: border-box;
}

.sofon-floating-navbar {
  position: relative !important;
  right: auto !important;
  left: auto !important;
  width: min(100%, 1540px) !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  margin-bottom: 0 !important;
  box-sizing: border-box;
  transform: none !important;
  transform-origin: center !important;
}

.sofon-navbar-inner {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.sofon-navbar-brand {
  min-width: 0;
  flex: 1 1 auto;
}

.sofon-navbar-actions {
  min-width: max-content;
  flex: 0 0 auto;
}

/* Modál je po načtení přesunut přímo pod body, mimo stacking context navigace. */
.sofon-help-modal {
  z-index: 1055 !important;
}

.modal-backdrop {
  z-index: 1050 !important;
}

.sofon-help-modal .modal-dialog {
  width: min(calc(100% - 1.25rem), 800px);
  max-width: 800px;
  min-height: calc(100% - 2rem);
  margin: 1rem auto;
}

.sofon-help-modal .modal-content {
  max-height: calc(100dvh - 2rem);
}

.sofon-help-modal .modal-body {
  overscroll-behavior: contain;
}

:root.sofon-dark-mode .sofon-help-modal .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

/* Patička – oba odkazy se otevírají v nové záložce. */
.sofon-footer a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.22em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.sofon-footer a:hover,
.sofon-footer a:focus-visible {
  color: var(--sofon-accent-strong);
  text-decoration: underline;
}

.sofon-footer-message a {
  display: inline-block;
}

.sofon-footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

@media (max-width: 680px) {
  .sofon-navbar-shell {
    padding-right: 0.55rem !important;
    padding-left: 0.55rem !important;
  }

  .sofon-floating-navbar {
    width: 100% !important;
  }

  .sofon-help-modal .modal-dialog {
    width: calc(100% - 0.8rem);
    min-height: calc(100% - 0.8rem);
    margin: 0.4rem auto;
  }

  .sofon-help-modal .modal-content {
    max-height: calc(100dvh - 0.8rem);
    border-radius: 1.15rem;
  }

  .sofon-footer-meta {
    gap: 0.35rem 0.5rem;
  }
}
