/* Historium v105: keep desktop header intact; simplify mobile header. */

@media (min-width: 761px) {
  .site-header.is-hidden {
    transform: none !important;
    pointer-events: auto !important;
  }
}

@media (max-width: 760px) {
  html,
  body,
  .site-shell {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    touch-action: pan-y !important;
  }

  .site-shell,
  .main,
  main {
    height: auto !important;
    min-height: 0 !important;
    overflow-y: visible !important;
    touch-action: pan-y !important;
  }

  .site-header,
  .site-header.is-compact {
    position: sticky !important;
    top: 0 !important;
    z-index: 50000 !important;
    display: block !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 7px 10px !important;
    overflow: visible !important;
    transform: translate3d(0, 0, 0) !important;
    transition: transform 190ms ease, background 160ms ease, border-color 160ms ease !important;
    will-change: transform !important;
  }

  .site-header .brand,
  .site-header .header-search {
    display: none !important;
  }

  .site-header .nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    touch-action: pan-x pan-y !important;
  }

  .site-header .nav::-webkit-scrollbar {
    display: none !important;
  }

  .site-header .nav > a,
  .site-header .language-select,
  .site-header .auth-link,
  .site-header .theme-toggle {
    flex: 0 0 auto !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 9px !important;
    border-radius: 10px !important;
    font-size: 0.68rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .site-header .language-select {
    width: auto !important;
    min-width: 88px !important;
    max-width: 112px !important;
  }

  .site-header .theme-toggle,
  .site-header .auth-user {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
  }

  .site-header .auth-link.google,
  .site-header .auth-link.compact-login {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    justify-content: center !important;
    padding: 0 !important;
    overflow: hidden !important;
    letter-spacing: 0 !important;
  }

  .site-header .auth-user span,
  .site-header .auth-link span {
    display: none !important;
  }

  .site-header.is-hidden {
    transform: translate3d(0, -112%, 0) !important;
    pointer-events: none !important;
  }

  body.header-search-active .site-header,
  body.header-search-active .site-header.is-hidden,
  .site-header:focus-within {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
  }
}
