/* 1. box-sizingを全要素とその擬似要素に適用し、サイズ計算を統一 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. デフォルトの余白を初期化 */
* {
  margin: 0;
  padding: 0;
}

/* 3. HTMLとbodyの基盤設定 */
html {
  /* ユーザーの文字サイズ拡大設定を尊重しつつレイアウト崩れを防止 */
  -webkit-text-size-adjust: 100%;
  /* アンカーリンクのスムーススクロール（アクセシビリティ対応） */
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  min-height: 100vh;
  min-height: 100dvh; /* モバイルのアドレスバー伸縮に対応 */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeSpeed;
}

/* 4. メディア要素のレスポンシブ化と余白バグ防止 */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 5. フォーム要素のフォント継承とデザインのベース化 */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* ボタンのクリック領域と不要なスタイルの除去 */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* 6. テキストエリアのサイズ調整を縦方向のみに制限 */
textarea {
  resize: vertical;
}

/* 7. テキストの折り返しとオーバーフロー防止 */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 8. リストスタイルの解除（クラスが付与されたもののみ初期化し、セマンティック構造を維持） */
ul[class],
ol[class] {
  list-style: none;
}

/* 9. テーブルのボーダー崩れ防止 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}