/* ==========================================================================
   Tak Trochen — shared navigation bar
   --------------------------------------------------------------------------
   Single source of truth for the header on EVERY page.

   - styles.css pulls this in with @import, so all the regular pages get it.
   - Standalone pages that do not use styles.css (e.g. the Tailwind-based
     konverzacni-klub_b1-b2.html) link this file directly.

   It is deliberately self-contained: it declares its own --nav-* custom
   properties instead of relying on the variables in styles.css, and every
   rule is scoped to the header so it cannot leak into a page's own styles.
   ========================================================================== */

:root {
  /* Palette — the design-system tokens, with the pre-design-system values as
     fallbacks so this file still works when linked without design-system.css. */
  --nav-accent: var(--tt-orange, #fe4a3b);
  --nav-accent-dark: var(--tt-orange-hover, #d73e2f);
  --nav-accent-subtle: rgba(232, 90, 55, 0.12);
  --nav-yellow: var(--tt-yellow, #ffce0d);
  --nav-ink: var(--tt-dark, #111318);
  --nav-text: var(--tt-text, #222426);
  --nav-surface: #ffffff;
  --nav-border: var(--tt-border, #f1f5f9);

  --nav-height: 80px;
  --nav-gutter: 22px;
}

/* --------------------------------------------------------------------------
   Header shell
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nav-border);
  transition: box-shadow 0.2s ease-out;
}

.site-header.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Scoped so it also works on pages that have no global .container rule. */
.site-header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--nav-gutter);
  width: 100%;
}

.site-header .navbar {
  position: relative; /* anchor for the mobile dropdown */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--nav-height);
}

/* --------------------------------------------------------------------------
   Brand / logo
   -------------------------------------------------------------------------- */

/* The original Tak Trochen logo: yellow mark + wordmark. */
.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--nav-ink);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-header .brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nav-yellow);
  box-shadow: 0 2px 8px rgba(245, 215, 101, 0.5);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

.site-header .nav-container {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  min-width: 0;
}

.site-header .nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-header .nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--nav-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease-out;
}

.site-header .nav a:hover,
.site-header .nav a[aria-current="page"] {
  color: var(--nav-accent);
}

.site-header .nav a:focus-visible {
  outline: 2px solid var(--nav-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Level badges, e.g. "Konverzační klub B1 B2" */
.site-header .nav-levels {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  /* Keep the two badges together if the label wraps */
  white-space: nowrap;
}

.site-header .nav-level {
  background: var(--nav-yellow);
  color: var(--nav-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
}

/* Admin link (only rendered when signed in) */
.site-header .admin-nav-btn {
  color: var(--nav-accent);
}

/* --------------------------------------------------------------------------
   Call to action
   -------------------------------------------------------------------------- */

/* The `a` is needed to outrank `.site-header .nav a`, which sets the link
   colour — without it the desktop CTA inherits the dark nav text colour. */
.site-header a.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--nav-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease-out, transform 0.2s ease-out,
    box-shadow 0.2s ease-out;
}

.site-header a.nav-cta:hover {
  background: var(--nav-accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -6px var(--nav-accent-subtle);
}

/* Needs the `a` to outrank `.site-header a.nav-cta`, which sets display. */
.site-header a.mobile-cta {
  display: none;
}

/* --------------------------------------------------------------------------
   Hamburger
   -------------------------------------------------------------------------- */

.site-header .nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease-out;
}

.site-header .nav-toggle:hover {
  background: var(--nav-accent-subtle);
}

.site-header .hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--nav-ink);
  transition: transform 0.25s ease-out, opacity 0.2s ease-out;
}

.site-header .nav-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header .nav-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.site-header .nav-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Mobile / tablet: hamburger dropdown

   The horizontal row needs roughly 1130px for the six links plus the CTA,
   so the dropdown takes over below 1150px.
   -------------------------------------------------------------------------- */

@media (max-width: 1149px) {
  .site-header .nav-toggle {
    display: flex;
  }

  /* Needs the `a` to outrank `.site-header .nav a`, which sets display. */
  .site-header .nav a.desktop-cta {
    display: none;
  }

  .site-header a.mobile-cta {
    display: inline-flex;
  }

  /* The dropdown overflows the header box; a backdrop filter on the header
     mis-composites that overhang, so drop the blur while the menu exists. */
  .site-header {
    background: var(--nav-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 8px;
    background: var(--nav-surface);
    border-top: 1px solid var(--nav-border);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out,
      visibility 0.25s ease-out;
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    z-index: 100;
  }

  .site-header .nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-header .nav a {
    padding: 15px;
    font-size: 16px;
    border-bottom: 1px solid var(--nav-border);
    /* Vertical menu: let a long label wrap instead of overflowing */
    white-space: normal;
  }

  /* .desktop-cta is last in the DOM but hidden here, so :last-child
     would leave the divider on the last visible link. */
  .site-header .nav a:has(+ .desktop-cta) {
    border-bottom: none;
  }
}

/* Narrow phones: trim the header so logo + CTA + toggle always fit. */
@media (max-width: 560px) {
  :root {
    --nav-height: 68px;
    --nav-gutter: 16px;
  }

  .site-header .brand {
    font-size: 20px;
  }

  .site-header .nav-cta {
    padding: 9px 14px;
    font-size: 11px;
  }

  .site-header .nav-toggle {
    width: 38px;
    height: 38px;
  }
}

/* Very narrow phones: shrink the wordmark rather than let it wrap. */
@media (max-width: 400px) {
  .site-header .brand {
    font-size: 18px;
    gap: 6px;
  }

  .site-header .nav-cta {
    padding: 8px 12px;
    font-size: 10px;
  }
}
