/* =============================================== */
/*  RESET.CSS                                      */
/*  Modern, minimal reset — 為整站建立一致基準     */
/* =============================================== */

/* 1. Box-sizing：所有元素 (含 ::before / ::after) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. 清除預設 margin / padding */
html,
body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
dl, dd,
ul, ol {
  margin: 0;
  padding: 0;
}

/* 3. html / body 基本設定，防止水平捲軸 */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* 防止整頁水平捲軸 */
}

/* 4. 圖片 / 媒體：永遠不撐破容器 */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 5. 表單元素繼承字型 */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* 6. 移除 list 預設樣式（套到 nav / footer 等清單） */
ul,
ol {
  list-style: none;
}

/* 7. 連結預設 */
a {
  color: inherit;
  text-decoration: none;
}

/* 8. 按鈕重置 */
button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

/* 9. 標題粗細交由各區塊 / variables 控制 */
h1, h2, h3, h4, h5, h6 {
  font-weight: inherit;
  line-height: 1.2;
}

/* 10. 段落文字平衡換行（現代瀏覽器） */
p {
  text-wrap: pretty;
}

/* 11. 表格 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 12. 為視障使用者保留焦點外框，但客製樣式 */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* 13. 減少動畫偏好 (a11y) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}
