/* ---------------------------------
   STICKY HEADER
---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
}

.site-header.topbar-hidden .topbar {
  visibility: hidden;
}

/* Move the sticky edge without changing the header's place in document flow. */
.site-header.topbar-hidden {
  top: calc(0px - var(--topbar-height, 0px));
}

/* ---------------------------------
   TOP BAR
---------------------------------- */
.topbar {
  position: relative;
  z-index: 31;
  background: linear-gradient(105deg, #061326, #092844 72%, #0a3d62);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 32px;
  gap: 0.75rem;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.topbar-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0;
  color: inherit;
  transition: color 0.18s ease;
}

.topbar-link:hover,
.topbar-link:focus-visible {
  color: var(--blue-300);
  background: transparent;
  transform: none;
  outline: none;
}

@media (max-width: 640px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }
  .topbar-left {
    display: none;
  }
  .topbar-right {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 1em;
    padding-inline: 0.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-right::-webkit-scrollbar {
    display: none;
  }
  .topbar-link {
    flex: 0 0 auto;
    justify-content: center;
    padding: 0.4rem 0.25rem;
  }
}
/* ---------------------------------
   NAVBAR
---------------------------------- */
.navbar {
  position: relative;
  z-index: 30;
  background:
    radial-gradient(
      circle at 88% 20%,
      rgba(56, 189, 248, 0.1),
      transparent 28%
    ),
    linear-gradient(
      115deg,
      rgba(7, 20, 38, 0.96),
      rgba(11, 29, 54, 0.94) 68%,
      rgba(10, 61, 98, 0.9)
    );
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  backdrop-filter: blur(16px) saturate(125%);
  color: var(--color-white);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: relative;
}

.navbar-logo {
  font-family: "Roboto Condensed", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 1rem;
}

.navbar-logo span {
  color: var(--blue-700);
}

.navbar-logo img {
  height: 48px;
  width: auto;
  display: block;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  align-items: center;
}

@media (min-width: 1101px) {
  .navbar-links {
    margin-left: auto;
  }
}

.navbar-link {
  position: relative;
  cursor: pointer;
  padding: 0.52rem 0.65rem;
  color: inherit;
  font: inherit;
  transition: color 0.18s ease;
}

.navbar-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 1px;
  width: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.58);
}

.navbar-link[aria-current="page"]::after {
  width: 100%;
}

.navbar-link:hover,
.navbar-link:focus-visible {
  color: var(--blue-300);
  background: transparent;
  transform: none;
}

.navbar-link:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Dropdown pro "O škole" */
.nav-item-has-sub {
  position: relative;
}

.navbar-link--has-sub {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.navbar-link--has-sub::before {
  width: 0.38rem;
  height: 0.38rem;
  order: 2;
  content: "";
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.7;
  transform: translateY(-0.12rem) rotate(45deg);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: rgba(4, 14, 28, 0.96);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 38px rgba(2, 12, 24, 0.48);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  padding: 0.4rem 0;
  display: none;
  z-index: 40;
  font-size: 0.85rem;
}

.nav-dropdown--right {
  right: 0;
  left: auto;
}

.nav-dropdown a {
  display: block;
  /* Preserve the footer's word-space separation when mobile links use flex. */
  column-gap: 0.25em;
  padding: 0.45rem 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.nav-dropdown a:hover,
.nav-dropdown a:focus-visible {
  background: transparent;
  color: var(--blue-300);
  outline: none;
}

.nav-item-has-sub:hover .nav-dropdown,
.nav-item-has-sub:focus-within .nav-dropdown {
  display: block;
}

.nav-item-has-sub:hover > .navbar-link[aria-current="page"]::after,
.nav-item-has-sub:focus-within > .navbar-link[aria-current="page"]::after,
.nav-item-has-sub.is-open > .navbar-link[aria-current="page"]::after {
  width: 0;
}

.nav-subitem {
  position: relative;
}

.nav-subitem--has-sub::after {
  position: absolute;
  top: 0;
  left: 100%;
  width: 0.75rem;
  height: 100%;
  content: "";
}

.nav-submenu-trigger {
  position: relative;
  padding-right: 2rem !important;
}

.nav-submenu-trigger::after {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  width: 0.42rem;
  height: 0.42rem;
  content: "";
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  color: var(--blue-300);
  transform: translateY(-50%) rotate(45deg);
}

.nav-subdropdown {
  position: absolute;
  top: -0.4rem;
  left: calc(100% + 0.5rem);
  display: none;
  min-width: 285px;
  max-height: min(68vh, 510px);
  overflow-y: auto;
  padding: 0.4rem 0;
  background: rgba(5, 22, 40, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(2, 12, 24, 0.5);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.nav-subitem:hover .nav-subdropdown,
.nav-subitem:focus-within .nav-subdropdown,
.nav-subitem.is-open .nav-subdropdown {
  display: block;
}

/* Hamburger */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--color-white);
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.nav-toggle svg {
  display: block;
  width: 28px;
  height: 28px;
}

.nav-toggle:focus-visible {
  outline: none;
  box-shadow: var(--shadow-cyan-glow);
  border-radius: 10px;
}

@media (max-width: 1100px) {
  .nav-toggle {
    display: flex;
  }
  .navbar-links {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100vw;
    max-height: calc(100vh - 7rem);
    max-height: calc(100dvh - 7rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-50%);
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(
      150deg,
      var(--chrome-navy-950),
      var(--chrome-navy-800)
    );
    color: #ffffff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.75rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    border-bottom: 1px solid #222;
    display: none;
    scrollbar-gutter: stable;
    font-size: 1.05rem;
  }
  .navbar-links.navbar-links--open {
    display: flex;
  }
  .navbar-links--open .navbar-link[aria-current="page"] {
    color: var(--blue-300);
  }
  .navbar-links--open .navbar-link[aria-current="page"]::after {
    width: 0;
  }
  .navbar-link,
  .nav-item-has-sub {
    width: 100%;
    text-align: left;
  }
  .navbar-link {
    display: flex;
    min-height: 48px;
    align-items: center;
    font-size: 1.05rem;
    line-height: 1.4;
  }
  .navbar-link--has-sub {
    display: flex;
    align-items: center;
    /*justify-content: space-between;*/
  }
  .nav-dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    background: transparent;
    font-size: 1rem;
  }

  .nav-dropdown--right {
    right: auto;
  }
  .nav-dropdown a {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 1rem;
    line-height: 1.4;
    white-space: normal;
  }
  .nav-item-has-sub:hover > .nav-dropdown,
  .nav-item-has-sub:focus-within > .nav-dropdown {
    display: none;
  }
  .nav-item-has-sub.is-open > .nav-dropdown {
    display: block;
  }
  .nav-subdropdown {
    position: static;
    display: none;
    min-width: 0;
    max-height: none;
    margin: 0.25rem 0 0.35rem 0.75rem;
    padding-left: 0.75rem;
    overflow: visible;
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(133, 212, 255, 0.35);
    border-radius: 0;
    box-shadow: none;
  }
  .nav-subdropdown a {
    font-size: 0.95rem;
  }
  .nav-subitem:hover .nav-subdropdown,
  .nav-subitem:focus-within .nav-subdropdown {
    display: none;
  }
  .nav-subitem.is-open .nav-subdropdown {
    display: block;
  }
}
