/* Landscape tablets use the full link row. Scroll state remains owned by
   volt-home-shell.js; the existing details control opens the compact header. */
@media (min-width: 1024px) and (orientation: landscape) and (hover: none),
       (min-width: 1024px) and (max-width: 1150px) and (orientation: landscape) and (pointer: fine) {
  nav.kk-nav[data-kk-fixed-header],
  nav.kk-nav[data-kk-fixed-header].kk-nav--compact:focus-within,
  nav.kk-nav[data-kk-fixed-header].kk-nav--compact:hover {
    gap: 16px;
  }

  nav.kk-nav[data-kk-fixed-header] .kk-logo img,
  nav.kk-nav[data-kk-fixed-header].kk-nav--compact .kk-logo img,
  nav.kk-nav[data-kk-fixed-header].kk-nav--compact:focus-within .kk-logo img,
  nav.kk-nav[data-kk-fixed-header].kk-nav--compact:hover .kk-logo img {
    width: 128px;
  }

  nav.kk-nav[data-kk-fixed-header] .kk-nav__links {
    display: flex;
  }

  nav.kk-nav[data-kk-fixed-header]:not(.kk-nav--compact) .kk-nav__links,
  nav.kk-nav[data-kk-fixed-header]:has(.kk-mobile-nav[open]) .kk-nav__links {
    max-width: 580px;
    gap: 12px;
    opacity: 1;
    visibility: visible;
    filter: none;
    transform: none;
    pointer-events: auto;
  }

  nav.kk-nav[data-kk-fixed-header] .kk-nav__links > a:not(.kk-button) {
    font-size: 12px;
  }

  /* A retained touch/keyboard focus must not undo closing the menu. */
  nav.kk-nav[data-kk-fixed-header].kk-nav--compact:not(:has(.kk-mobile-nav[open])) .kk-nav__links {
    max-width: 0;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    filter: none;
    transform: translateY(-5px) scale(.96);
    pointer-events: none;
  }

  nav.kk-nav[data-kk-fixed-header] .kk-mobile-nav {
    display: none;
  }

  nav.kk-nav[data-kk-fixed-header].kk-nav--compact .kk-mobile-nav {
    display: block;
  }

  /* The action group translates without scaling; keep the real touch box
     at least 44px in both compact and open states. */
  nav.kk-nav[data-kk-fixed-header] .kk-mobile-nav summary {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  /* The open details state reveals the inline row, never a second menu. */
  nav.kk-nav[data-kk-fixed-header] .kk-mobile-nav__panel {
    display: none;
  }
}

/* Smaller landscape tablets retain their existing width-based geometry. */
@media (min-width: 1024px) and (max-width: 1150px) and (orientation: landscape) and (hover: none),
       (min-width: 1024px) and (max-width: 1150px) and (orientation: landscape) and (pointer: fine) {
  nav.kk-nav[data-kk-fixed-header]:not(.kk-nav--compact),
  nav.kk-nav[data-kk-fixed-header]:has(.kk-mobile-nav[open]) {
    top: 16px;
    width: calc(100% - 48px);
    height: 58px;
    padding: 0 22px 0 26px;
  }

  nav.kk-nav[data-kk-fixed-header].kk-nav--compact:not(:has(.kk-mobile-nav[open])) {
    top: 10px;
    width: min(440px, calc(100% - 64px));
    height: 56px;
    padding: 0 14px 0 20px;
  }
}

/* Larger touch tablets keep the existing transform-only capsule animation.
   Explicit open/closed variables override desktop focus-within expansion. */
@media (min-width: 1151px) and (orientation: landscape) and (hover: none) {
  nav.kk-nav[data-kk-fixed-header].kk-nav--compact:not(:has(.kk-mobile-nav[open])) {
    --kk-rise: -12px;
    --kk-cap-scale: .875;
    --kk-middle-scale: var(--kk-compact-middle, 1);
    --kk-edge-shift: var(--kk-compact-edge, 0px);
    --kk-logo-shift: var(--kk-compact-logo, 0px);
    --kk-action-shift: var(--kk-compact-action, 0px);
    --kk-content-y: -4px;
    --kk-content-scale: .88;
  }

  nav.kk-nav[data-kk-fixed-header]:has(.kk-mobile-nav[open]) {
    --kk-rise: 0px;
    --kk-cap-scale: 1;
    --kk-middle-scale: 1;
    --kk-edge-shift: 0px;
    --kk-logo-shift: 0px;
    --kk-action-shift: 0px;
    --kk-content-y: 0px;
    --kk-content-scale: 1;
  }

  /* Do not animate row width/gaps while the GPU capsule is collapsing. */
  nav.kk-nav[data-kk-fixed-header].kk-nav--compact:not(:has(.kk-mobile-nav[open])) .kk-nav__links {
    max-width: 580px;
    gap: 12px;
  }
}
