/* ==========================================================================
   STEEL LIVE — Base   v1.1
   リセット + 基本要素 + アクセシビリティ基盤
   ========================================================================== */

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

html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol, table, th, td {
  margin: 0;
  padding: 0;
}

ul[class], ol[class] { list-style: none; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 固定ヘッダー分だけアンカー位置をずらす */
  scroll-padding-top: calc(var(--header-h) + var(--sp-3));
}

@media (min-width: 1024px) {
  html { scroll-padding-top: calc(var(--header-h-lg) + var(--sp-4)); }
}

body {
  min-height: 100vh;
  background-color: var(--bg);   /* 透過させない（暗転演出の土台） */
  color: var(--fg);
  font-family: var(--font-base);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 横スクロールは原因側で潰す方針。ここでは保険をかけない */
}

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

img, video { height: auto; }

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

/* iOS の自動ズーム防止（入力欄は 16px 以上） */
input, textarea, select { font-size: max(16px, 1rem); }

table { border-collapse: collapse; width: 100%; }

/* --- 見出し・本文 --------------------------------------------------------- */
h1, h2, h3, h4 {
  line-height: var(--lh-heading);
  font-weight: var(--fw-bold);
  color: var(--fg-strong);
  /* 日本語の禁則処理。
     strict にすると小書きのカナ（ォ 等）や長音符の前で改行されなくなる。
     v2 は文字が大きいぶん、1文字の泣き別れが致命的に目立つ。 */
  line-break: strict;
  text-wrap: pretty;
  word-break: normal;
  overflow-wrap: break-word;
}

/* 本文側にも同じ禁則を適用する */
p, li, dd {
  line-break: strict;
  text-wrap: pretty;
}

/* anywhere は日本語を単語途中で割るため break-word にする */
p { overflow-wrap: break-word; }

/* 英字ディスプレイ用のユーティリティ */
.en {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-display);
  /* Space Grotesk 未読込時に不自然にならないよう合成をオフ */
  font-synthesis: none;
}

/* --- リンク --------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: color var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease);
}

@media (hover: hover) {
  a:hover { color: var(--fg-strong); }
}

/* --- フォーカス（絶対に消さない） ------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--sl-blue);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* マウス操作時のリングは出さないが、キーボードでは必ず出す */
:focus:not(:focus-visible) { outline: none; }

/* --- スキップリンク -------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: var(--z-skip);
  padding: var(--sp-3) var(--sp-4);
  background: var(--sl-white);
  color: var(--sl-black);
  font-weight: var(--fw-bold);
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform var(--dur-fast) var(--ease);
}

.skip-link:focus-visible { transform: translateY(0); }

/* --- スクリーンリーダー専用 ------------------------------------------------ */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- 選択範囲 ------------------------------------------------------------- */
::selection {
  background: var(--sl-violet);
  color: var(--sl-white);
}

/* --- iOS のタップ時ハイライトを抑制 ---------------------------------------- */
a, button, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* --- モーション低減（必須対応） -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
