/* =========================================
   Reset CSS (Modern, Universal)
   - Box sizing
   - Margin/padding reset
   - Typography & media defaults
   - Forms & interactive elements
   - Reduced motion support
   ========================================= */

/* 1) すべての要素でボックスサイズをborder-boxに統一 */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2) 余白のリセット＆基本の行高 */
* {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  line-height: 1.5;
  /* スクロールの挙動は各プロジェクト方針で。必要なら解除 */
  /* scroll-behavior: smooth; */
}

/* 3) ベースのタイポグラフィ設定（継承＆可読性） */
body {
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #111;
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 4) 見出しはサイズのみ後から指定しやすいように継承 */
h1, h2, h3, h4, h5, h6 {
  font: inherit;
  font-weight: inherit;
}

/* 5) 画像・メディアをコンテナ幅に収める */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 6) ul/olのデフォルトマーカーは一旦解除（必要箇所で再付与） */
ul, ol {
  list-style: none;
}

/* 7) aタグの初期化（色と下線はユーティリティ/コンポーネントで制御） */
a {
  color: inherit;
  text-decoration: none;
}

/* 8) ボタン/フォーム要素はフォント継承・境界スタイルを統一 */
button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  outline: 0;
}
button {
  cursor: pointer;
}
fieldset {
  border: 0;
}
textarea {
  resize: vertical;
}

/* 9) テーブル：レイアウトの基礎だけ整える */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}
th, td {
  text-align: left;
  vertical-align: top;
  font-weight: normal;
}

/* 10) 引用・コード系の初期化 */
blockquote, q {
  quotes: none;
}
blockquote::before, blockquote::after,
q::before, q::after {
  content: '';
}
code, kbd, samp, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Noto Sans Mono CJK JP", monospace;
  font-size: .95em;
}

/* 11) アクセシビリティ：フォーカスリングは見えるように */
:focus-visible {
  outline: 2px solid #2684FF;
  outline-offset: 2px;
}

/* 12) ユーザー選択やドラッグの挙動（必要に応じて上書き） */
img {
  -webkit-user-drag: none;
  user-select: none;
}

/* 13) Prefers-reduced-motion: アニメーションを抑制 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
