/* Spolecne menu vsech podstranek: plovouci "pilulka" jako na uvodni strance,
   v zelene barve loga Thanatolog (#3a8f45). Prebiji starsi styly .top-nav / .sub-nav. */
:root { --nav-g: #3a8f45; --nav-g-rgb: 58, 143, 69; --nav-g-hi: #7fd88a; }

html body .top-nav {
  position: sticky; top: 12px; z-index: 1000;
  display: flex; align-items: center; flex-wrap: nowrap; gap: 0.5rem 1.2rem;
  width: min(1080px, calc(100% - 24px)); margin: 12px auto 10px; padding: 0.45rem 0.55rem 0.45rem 1rem;
  border: 1px solid rgba(var(--nav-g-rgb), 0.45); border-radius: 999px;
  background: rgba(14, 16, 19, 0.74);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 50px -20px rgba(0, 0, 0, 0.8), 0 0 30px -12px rgba(var(--nav-g-rgb), 0.6);
  font-family: 'Inter Tight', 'Segoe UI', system-ui, sans-serif;
  box-sizing: border-box;
}
html body .top-nav-brand {
  display: inline-flex; align-items: center; gap: 0.55rem; flex-shrink: 0;
  font: 600 1.02rem/1 'Inter Tight', 'Segoe UI', system-ui, sans-serif; letter-spacing: -0.02em;
  color: #f2f3f5; text-decoration: none;
}
/* znacka: mala pilulka se svitici teckou */
html body .top-nav-brand::before {
  content: ''; width: 1.9rem; height: 1.15rem; border-radius: 999px; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: radial-gradient(circle at center, var(--nav-g-hi) 0 0.22rem, rgba(var(--nav-g-rgb), 0.55) 0.26rem, transparent 0.55rem), #0e1013;
  box-shadow: 0 0 12px -2px rgba(var(--nav-g-rgb), 0.8);
}
html body .top-nav-links {
  display: flex; flex-wrap: nowrap; gap: 0.15rem; margin-left: auto;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
html body .top-nav-links::-webkit-scrollbar { display: none; }
html body .top-nav-links a {
  flex-shrink: 0; padding: 0.5rem 0.8rem; border: 0; border-radius: 999px;
  font-size: 0.9rem; line-height: 1; color: #a9adb6; text-decoration: none; white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
html body .top-nav-links a:hover { color: #f2f3f5; background: rgba(255, 255, 255, 0.05); }
html body .top-nav-links a.active { color: #04130d; background: var(--nav-g); font-weight: 600; box-shadow: 0 6px 22px -8px rgba(var(--nav-g-rgb), 0.9); }

/* podmenu sekce: druha, tissi pilulka */
html body .sub-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem;
  width: min(1080px, calc(100% - 24px)); margin: 0 auto 0.5rem; padding: 0.35rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 22px;
  background: rgba(255, 255, 255, 0.025);
  font-family: 'Inter Tight', 'Segoe UI', system-ui, sans-serif;
  box-sizing: border-box;
}
html body .sub-nav a {
  padding: 0.42rem 0.75rem; border: 0; border-radius: 999px;
  font-size: 0.86rem; line-height: 1.1; color: #a9adb6; text-decoration: none;
  transition: color 0.2s, background 0.2s;
}
html body .sub-nav a:hover { color: #f2f3f5; background: rgba(255, 255, 255, 0.05); }
html body .sub-nav a.active { color: var(--nav-g-hi); background: rgba(var(--nav-g-rgb), 0.2); box-shadow: inset 0 0 0 1px rgba(var(--nav-g-rgb), 0.55); }
html body .sub-nav .sub-nav-title {
  margin-right: 0.3rem; font: 600 0.72rem/1 ui-monospace, 'Cascadia Mono', Consolas, monospace !important;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--nav-g-hi) !important; background: none; box-shadow: none;
}

/* zalozky uvnitr stranek (napr. Paranoidni schizofrenie, skripta) */
html body .tabs a { border-radius: 999px; border-color: rgba(255, 255, 255, 0.12); }
html body .tabs a:hover { color: #f2f3f5; border-color: rgba(var(--nav-g-rgb), 0.7); }
html body .tabs a.active { background: var(--nav-g); border-color: var(--nav-g); color: #04130d; font-weight: 600; box-shadow: 0 6px 22px -8px rgba(var(--nav-g-rgb), 0.9); }

/* tlacitka vpravo jako na uvodni strance */
html body .top-nav-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
html body .tn-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 2.5rem; padding: 0 1.05rem;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.14); background: transparent;
  font: 500 0.92rem/1 'Inter Tight', 'Segoe UI', system-ui, sans-serif; letter-spacing: -0.01em;
  color: #f2f3f5; text-decoration: none; white-space: nowrap; transition: border-color 0.2s, background 0.2s, box-shadow 0.3s;
}
html body .tn-ghost:hover, html body .tn-ghost.active { border-color: rgba(var(--nav-g-rgb), 0.7); background: rgba(255, 255, 255, 0.04); }
html body .tn-accent { background: var(--nav-g); border-color: transparent; color: #04130d; font-weight: 600; box-shadow: 0 8px 30px -10px rgba(var(--nav-g-rgb), 0.8); }
html body .tn-accent:hover { box-shadow: 0 0 0 4px rgba(var(--nav-g-rgb), 0.2), 0 10px 40px -8px rgba(var(--nav-g-rgb), 0.9); }
html body .tn-toggle { display: none; position: relative; width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14); background: transparent; cursor: pointer; }
html body .tn-toggle span, html body .tn-toggle span::before, html body .tn-toggle span::after {
  position: absolute; left: 50%; width: 1rem; height: 1.5px; margin-left: -0.5rem; background: #f2f3f5; content: ''; transition: transform 0.3s, background 0.2s;
}
html body .tn-toggle span { top: 50%; }
html body .tn-toggle span::before { top: -5px; left: 0; margin: 0; }
html body .tn-toggle span::after { top: 5px; left: 0; margin: 0; }
html body .tn-toggle[aria-expanded="true"] span { background: transparent; }
html body .tn-toggle[aria-expanded="true"] span::before { transform: translateY(5px) rotate(45deg); }
html body .tn-toggle[aria-expanded="true"] span::after { transform: translateY(-5px) rotate(-45deg); }

/* uzsi obrazovky: odkazy v rozbalovacim panelu (jen kdyz bezi nav.js) */
@media (max-width: 980px) {
  html body .top-nav.tn-ready .top-nav-links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; padding: 0.5rem; border-radius: 18px; overflow: visible;
    background: #0e1013; border: 1px solid rgba(var(--nav-g-rgb), 0.35);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.25s, transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
  }
  html body .top-nav.tn-ready .top-nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  html body .top-nav.tn-ready .top-nav-links a { padding: 0.8rem 0.9rem; border-radius: 10px; font-size: 1rem; }
  html body .top-nav.tn-ready .top-nav-actions { margin-left: auto; }
  html body .tn-toggle { display: inline-block; }
  html body .tn-ghost { display: none; }
}

@media (max-width: 640px) {
  html body .top-nav { top: 8px; margin-top: 8px; width: calc(100% - 16px); padding-left: 0.8rem; gap: 0.6rem; }
  html body .top-nav-brand { font-size: 0.95rem; }
  html body .top-nav-links a { padding: 0.48rem 0.62rem; font-size: 0.86rem; }
  /* bez skriptu: naznak, ze menu jde posunout */
  html body .top-nav:not(.tn-ready) .top-nav-links { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  html body .sub-nav { width: calc(100% - 16px); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  html body .sub-nav::-webkit-scrollbar { display: none; }
  html body .sub-nav a { flex-shrink: 0; white-space: nowrap; }
}
