/* Desktopová navigace 3.9.4. Všechna pravidla jsou úmyslně od 1080 px;
   vzhled ani rozměry mobilního záhlaví a draweru se tím nemění. */
@media screen and (min-width: 1080px) {
  :root { --head: 76px; }
  .top {
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(15, 21, 35, .035);
  }
  .top__in {
    --vnb-menu-inset: var(--s7);
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(142px, 164px);
    align-items: center;
    gap: 14px;
    min-height: var(--head);
  }
  .top .acts { display: none; }
  .top .brand { min-width: 0; max-width: 220px; gap: 10px; }
  .top .brand__m { width: 38px; height: 38px; border-radius: 12px; }
  .top .brand__t { font-size: 1.0625rem; line-height: 1.15; }
  .top .brand__t small { line-height: 1.4; margin-top: 4px; }
  .top .nav {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    justify-content: space-between;
    gap: 2px;
    min-width: 0;
    margin: 0;
  }
  .top .nav__l { flex-wrap: wrap; gap: 2px; }
  .top .nav__i { position: static; min-width: 0; }
  .top .nav > .nav__a { align-self: center; }
  /* Otevřená položka zahrnuje i mezeru pod hlavičkou. Kurzor proto
     do panelu bezpečně přejde i pomalu, bez prodlužování časovače. */
  .top .nav__i:has(> .nav__a[aria-expanded="true"])::before {
    content: "";
    position: absolute;
    top: 100%;
    inset-inline: 0;
    height: 9px;
    z-index: 239;
  }
  .top .nav > .nav__a,
  .top .nav__i > .nav__a,
  .top .nav__l > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-2);
    font-size: .875rem;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease;
  }
  .top .nav__t { white-space: normal; text-wrap: balance; }
  .top .nav__a--x svg { width: 12px; height: 12px; flex: none; }
  .top .nav > .nav__a::after,
  .top .nav__i > .nav__a::after,
  .top .nav__l > li > a::after { content: none; }
  .top .nav > .nav__a[aria-current],
  .top .nav__i > .nav__a[aria-current],
  .top .nav__l > li.current-menu-item > a,
  .top .nav__l > li.current-menu-ancestor > a {
    color: var(--brand-dk);
    background: #F2F3FF;
    border-color: #E0E2F8;
  }
  .top .nav__i > .nav__a[aria-expanded="true"] {
    color: var(--brand-dk);
    background: var(--brand-wk);
    border-color: #CFD2F2;
  }
  .top .find { width: 100%; min-width: 0; max-width: none; margin: 0; }
  .top .find input {
    min-height: 44px;
    padding-inline: 37px 12px;
    border-color: var(--line);
    border-radius: 12px;
    background: var(--card-2);
    font-size: .875rem;
    transition: background-color .16s ease, border-color .16s ease;
  }
  .top .find input:focus { background: var(--card); border-color: var(--brand); }
  .top .find svg { left: 12px; width: 16px; height: 16px; }

  /* Oba okraje panelu sledují vnitřní okraje .shell: od loga po hledání.
     Šířka tak reaguje i na dvouřádkovou hlavičku a větší monitor. */
  .top .nav .mega {
    position: absolute;
    inset: calc(100% + 8px) var(--vnb-menu-inset) auto;
    width: auto;
    max-height: var(--vnb-mega-available, calc(100dvh - 112px));
    border: 1px solid #DFE4EF;
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 16px 48px rgba(15, 21, 35, .12), 0 2px 8px rgba(15, 21, 35, .04);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #C8CFDF transparent;
  }
  .top .nav .mega::before { content: none; }
  .top .mega__intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px 20px;
    border-bottom: 1px solid var(--line);
  }
  .top .mega__eyebrow,
  .top .mega__lab {
    margin: 0;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .015em;
    text-transform: none;
  }
  .top .mega__title {
    margin-top: 3px;
    color: var(--ink);
    font-size: 1.375rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.02em;
  }
  .top .mega__in { display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 66%); }
  .top .mega__side { padding: 22px 16px 24px; border-right: 1px solid var(--line); background: #F8FAFD; }
  .top .mega__lab { margin: 0 12px 12px; }
  .top .mega__subs { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

  /* Vyšší konkrétnost než starý reset `.nav .mega a` je záměrná. */
  .top .nav .mega .mega__sub {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--ink-2);
    box-shadow: none;
    font-size: .9375rem;
    font-weight: 650;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
  }
  .top .mega__sub-n { flex: 1; min-width: 0; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .top .mega__sub-c {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding-inline: 6px;
    border-radius: 8px;
    background: #EEF1F7;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
  }
  .top .mega__sub-go { display: inline-flex; flex: none; color: #8995AA; }
  .top .mega__sub-go svg { width: 14px; height: 14px; }
  .top .nav .mega .mega__sub.is-active {
    border-color: #D9DCF5;
    background: var(--card);
    color: var(--brand-dk);
    box-shadow: 0 1px 3px rgba(15, 21, 35, .025);
  }
  .top .mega__sub.is-active .mega__sub-c { background: var(--brand-wk); color: var(--brand-dk); }
  .top .mega__sub.is-active .mega__sub-go { color: var(--brand); }
  .top .mega__main { min-width: 0; padding: 22px 22px 24px; }
  .top .mega__group-head { padding: 0 8px 14px; }
  .top .mega__topic { margin-top: 3px; font-size: 1.125rem; font-weight: 750; line-height: 1.35; color: var(--ink); }
  .top .mega__posts { gap: 6px; }
  .top .nav .mega .mega__post-l {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 86px;
    padding: 10px 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease;
  }
  .top .mega__post-i { width: 88px; aspect-ratio: 4/3; border: 1px solid rgba(15, 21, 35, .04); border-radius: 10px; }
  .top .mega__post-t { font-size: .9375rem; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
  .top .mega__post-m { margin-top: 6px; gap: 5px; font-size: .75rem; line-height: 1.4; flex-wrap: wrap; }
  .top .mega__empty { padding: 12px 8px 24px; font-size: .9375rem; line-height: 1.6; }
  .top .mega__foot { gap: 16px; padding: 14px 24px; background: #FBFCFE; }
  .top .nav .mega .mega__all,
  .top .nav .mega .mega__tool,
  .top .nav .mega .mega__root-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--brand-dk);
    font-size: .875rem;
    font-weight: 650;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease;
  }
  .top .nav .mega .mega__all { background: #F0F1FE; }
  .top .nav .mega .mega__tool { border-color: var(--line); color: var(--ink-2); background: var(--card); }
  .top .nav .mega .mega__root-link { flex: none; }
  .top .nav a:focus-visible,
  .top .find input:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
}

@media screen and (min-width: 1080px) and (max-width: 1199px) {
  .top__in { --vnb-menu-inset: var(--s6); }
}

/* Menší desktop dostane dvě vzdušné řady; mobilní zlom zůstává 1080 px. */
@media screen and (min-width: 1080px) and (max-width: 1279px) {
  :root { --head: 112px; }
  .top__in { grid-template-columns: minmax(0, 1fr) 240px; row-gap: 0; padding-top: 8px; }
  .top .brand { grid-column: 1; grid-row: 1; }
  .top .find { grid-column: 2; grid-row: 1; }
  .top .nav { grid-column: 1 / -1; grid-row: 2; align-self: stretch; justify-content: space-between; gap: 8px; }
  .top .nav__i { flex: 1; justify-content: center; }
  .top .nav > .nav__a, .top .nav__i > .nav__a { padding-inline: 12px; }
}
@media screen and (min-width: 1080px) and (hover: hover) and (pointer: fine) {
  .top .nav > .nav__a:hover,
  .top .nav__i > .nav__a:hover,
  .top .nav__l > li > a:hover { color: var(--brand-dk); background: #F5F6FC; border-color: #E3E6F3; }
  .top .nav .mega .mega__sub:hover { background: var(--card); border-color: #D9DCF5; color: var(--brand-dk); box-shadow: none; }
  .top .nav .mega .mega__post-l:hover { background: #F7F8FE; border-color: #E8EAF6; }
  .top .nav .mega .mega__all:hover,
  .top .nav .mega .mega__tool:hover,
  .top .nav .mega .mega__root-link:hover { background: #E9EBFD; border-color: #D9DCF5; }
}
@media screen and (min-width: 1080px) and (prefers-reduced-motion: reduce) {
  .top .nav a, .top .find input, .top .nav__a--x svg { transition: none; }
}
