/* =============================================================================
   a11y.css — 落地页可访问性收口层
   -----------------------------------------------------------------------------
   为什么单独一层而不是塞进 tokens.css：这一层要**最后**加载（它的 :focus-visible
   与 prefers-reduced-motion 必须压过 main.css / extra.css / spacex.css 里的
   组件规则），而令牌层要**最先**加载。顺序相反，所以拆成两个文件。

   三件事：
   1. 键盘焦点：全局 :focus-visible 可见轮廓（此前只有 .nl-burger / .nl-theme
      有，正文链接、导航、CTA 全都没有焦点提示）。
   2. 触控目标 ≥44×44：可点元素里「块状控件」直接给 min-height，「行内文字
      链接」用不可见的 ::before 扩命中区 —— 后者不改排版，避免把页脚的
      法律入口撑成两行。
   3. prefers-reduced-motion: reduce：关掉过渡/动画/平滑滚动；无限循环的
      装饰跑马灯直接停在起始帧（有限次的入场动画用 0.001ms 收敛到终态，
      否则移动菜单的条目会停在 opacity:0 上看不见）。
   ========================================================================== */

/* ── 1. 键盘焦点 ──────────────────────────────────────────────────────────── */
:where(a, button, [role="button"], summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--ld-accent);
  outline-offset: 2px;
}

/* 压影像的控件：面积色在照片高光上会糊掉，换亮绿 + 深色外描边 */
.nl-block--plate :where(a, button):focus-visible,
.nl-hero :where(a, button):focus-visible,
#hero :where(a, button):focus-visible {
  outline-color: var(--ld-accent-on-plate);
  box-shadow: 0 0 0 1px rgba(5, 5, 7, 0.6);
}

/* 鼠标点击不画环（键盘用户仍看得到上面那条）；不支持 :focus-visible 的
   浏览器会整条忽略，退化成 UA 默认焦点环，不会丢可访问性。 */
:where(a, button, [role="button"], summary, [tabindex]):focus:not(:focus-visible) {
  outline: none;
}

/* ── 2. 触控目标 ≥44px ────────────────────────────────────────────────────── */
/* 块状控件：直接给最小高度。 */
.nl-mnav__cta,
.nl-mnav__ghost,
.nl-mnav__item {
  min-height: 44px;
}
.nl-burger,
.nl-theme {
  min-width: 44px;
  min-height: 44px;
}

/* 行内文字链接：扩一层不可见命中区，不参与排版（inset 越大命中区越高）。
   44px = 行高约 16px + 上下各 14px。 */
.nl-nav__link,
.a11y-hit,
header a[data-nl-auth-desktop],
header a[data-nl-mnav-ghost],
.nullity-brand,
.nullity-legal-link,
.nl-link {
  position: relative;
}
.nl-nav__link::before,
header a[data-nl-auth-desktop]::before,
.nullity-brand::before,
.nullity-legal-link::before,
.nl-link::before {
  content: "";
  position: absolute;
  inset: -14px -10px;
  /* 只作为命中区存在：不画、不接收事件以外的任何作用 */
  background: transparent;
}

/* 页脚法律入口之间只有 10px 间距：横向少扩一点，避免两块命中区重叠 */
.nullity-legal-link::before {
  inset: -14px -4px;
}

/* ── 3. 减少动态 ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html,
  :root {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  /* 无限循环的装饰层：停在起始帧（0.001ms 会让它们瞬移到终帧） */
  .nl-ticker__track,
  .nl-strips,
  .nl-scroll::after,
  .nl-hero__scroll::after,
  .nl-ticker__item::after {
    animation: none !important;
  }
}
