/* Мобильное меню в шапке (кнопка появляется на экранах до 1100px) */
.burger { display: none; }
.top__menu[hidden] { display: none !important; }
@media (max-width: 1100px) {
  .top .btn { margin-left: auto; white-space: nowrap; padding: 0 16px; }
  .burger { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 13px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: box-shadow .2s; }
  .burger:hover, .burger:focus-visible { box-shadow: inset 0 0 0 1.5px var(--accent-line); outline: none; }
  .burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .2s, opacity .2s; }
  .top.is-menu .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .top.is-menu .burger span:nth-child(2) { opacity: 0; }
  .top.is-menu .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  /* The menu is never taller than the screen below the header: on a phone held sideways (568×320) the last
     items and the theme switch were off-screen. It scrolls inside itself; the page behind stays put. */
  .top .top__menu { max-height: calc(100vh - var(--top-h, 73px)); max-height: calc(100dvh - var(--top-h, 73px)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  /* only the root: overflow on body too made body a scroll box and the sticky header slid away */
  html.menu-open { overflow: hidden; }
  .top .top__menu { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; display: flex; flex-direction: column; padding: 8px clamp(16px, 4vw, 48px) 16px; background: var(--menu-bg); border-bottom: 1px solid var(--line); box-shadow: 0 18px 40px -20px var(--shadow, rgba(0,0,0,.8)); }
  .top .top__menu a { display: flex; align-items: center; min-height: 52px; padding: 0 4px; font-size: 18px; font-weight: 600; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
  .top .top__menu a:last-child { border-bottom: 0; }
  .top .top__menu a:hover, .top .top__menu a:focus-visible { color: var(--accent-ink); outline: none; }
}
@media (max-width: 420px) {
  .top .burger { width: 40px; height: 40px; }
  .top .btn.btn--small { padding: 0 12px; }
}
/* narrow-screen header rules for every page (with or without this menu) are in style.css */
/* шесть ссылок в шапке: на экранах 1101–1300px сжимаем отступы, чтобы кнопка «Проверить сайт» не уезжала за край */
@media (min-width: 1101px) and (max-width: 1300px) {
  .top { gap: 12px; }
  .top__nav { gap: 18px; font-size: 15px; }
}
