/* ============================================
   Modern CSS Reset v1.0
   最新ブラウザ対応 (Chrome, Safari, Firefox, Edge)
   ============================================ */

/* --- 1. Box Sizing --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --- 2. マージン・パディングのリセット --- */
*{
  margin: 0;
  padding: 0;
}

/* --- 3. ルート設定 --- */
html {
  /* スクロール挙動（アンカーリンク等のスムーズスクロール） */
  scroll-behavior: smooth;

  /* テキストサイズの自動調整を防止（モバイル対応） */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;

  /* タブサイズの統一 */
  tab-size: 4;
  -moz-tab-size: 4;

  /* フォントスムージング（Safari/Chrome向け） */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Safariでのスクロールバーによるレイアウトシフト防止 */
  scrollbar-gutter: stable;
}

/* --- 4. bodyの基本設定 --- */
body {
  /* 最小高さをビューポート全体に（モバイル対応） */
  min-height: 100dvh;

  /* テキストレンダリングの最適化 */
  text-rendering: optimizeLegibility;

  /* 行の高さ */
  line-height: 1.5;

  /* フォントファミリー（システムフォントスタック） */
  font-family:
    "Helvetica Neue",
    Arial,
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    "Noto Sans JP",
    Meiryo,
    sans-serif;
}

/* --- 6. フォーム要素のフォント継承 --- */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* --- 7. テキストオーバーフロー対策 --- */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 見出しのフォントサイズをリセット（自由に設定できるように） */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/* --- 8. リスト --- */
ul,
ol {
  list-style: none;
}

/* --- 9. リンク --- */
a {
  color: inherit;
  text-decoration: none;
}

/* --- 10. テーブル --- */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* --- 11. ボタンリセット --- */
button {
  cursor: pointer;
  background: none;
  border: none;
  appearance: none;
}

/* --- 12. テキストエリア --- */
textarea {
  /* テキストエリアは縦方向のみリサイズ可能に */
  resize: vertical;
}

/* --- 13. fieldset --- */
fieldset {
  border: none;
}

/* --- 14. summary（details要素用） --- */
summary {
  cursor: pointer;
}

/* --- 15. 非表示属性の確実な適用 --- */
[hidden] {
  display: none !important;
}

/* --- 16. スクロールマージン（アンカーリンク時にヘッダーに隠れない） --- */
:target {
  scroll-margin-block-start: 5rem;
}

/* --- 17. フォーカス表示（アクセシビリティ） --- */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* --- 18. prefers-reduced-motion対応 --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}