/* =========================================
 * 2025年以降向け プロ仕様CSSリセット
 * Tailwind CSSやChakra UIのようなモダンフレームワーク向けに設計。
 * -----------------------------------------
 * 目的：
 * - ブラウザ間の差異を標準化する。
 * - アクセシビリティとユーザビリティを向上させる。
 * - モダンデザインシステムのための堅牢な基盤を提供する。
 * ========================================= */

/* =========================================
 * ボックスサイジングとルートスタイル
 * ========================================= */

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html:focus-within {
    scroll-behavior: smooth;
  }
}

/* =========================================
 * Bodyと基本タイポグラフィ
 * ========================================= */

body {
  margin: 0;
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
 * レイアウトとメディア
 * ========================================= */

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

/* =========================================
 * タイポグラフィリセット
 * ========================================= */

p,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
  overflow-wrap: break-word;
}

/* =========================================
 * リストリセット
 * ========================================= */

ul,
ol {
  padding: 0;
  list-style: none;
}

/* =========================================
 * リンクと水平線（hr）のリセット
 * ========================================= */

a {
  color: inherit;
  text-decoration: inherit;
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
}

/* =========================================
 * フォーム要素のリセット
 * ========================================= */

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  padding: 0;
  margin: 0;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

::placeholder {
  opacity: 1;
  color: #9ca3af;
}

/* =========================================
 * アクセシビリティとフォーカススタイル
 * ========================================= */

:focus-visible {
  outline: 2px solid var(--focus-color, #3b82f6);
  outline-offset: 2px;
}

@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;
  }
}

/* =========================================
 * ルートコンテキストとSVGカラー
 * ========================================= */

#root,
#__next {
  isolation: isolate;
}

:where(svg:not([fill])) {
  fill: currentColor;
}