/* ==========================================================
   Scenic Iceland — reset 与基础排版
   ========================================================== */

*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 1rem); }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  /* 用 clip 而不是 hidden：overflow-x: hidden 会把 body 变成滚动容器，
     导致锚点跳转失效、position: sticky 失去参照。clip 只裁掉溢出，
     不建立滚动容器。 */
  overflow-x: clip;
}

img,
svg,
video { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--color-accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-accent-hover); }

ul, ol { list-style: none; }

button { font-family: inherit; }

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.02em; line-height: 1.2; font-weight: 700; }

/* 键盘可达性：鼠标点击不显示焦点环，键盘导航时清晰可见 */
:focus-visible {
  outline: 3px solid var(--color-accent-bright);
  outline-offset: 2px;
  border-radius: 2px;
}

/* 屏幕阅读器专用文本 */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 1rem; left: 1rem; z-index: 999;
  width: auto; height: auto; clip: auto;
  padding: 0.75rem 1.25rem; background: var(--color-white);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  font-weight: 700;
}

/* 尊重用户的减少动效偏好（§11） */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
