/* ===================================================================
 * DADS Base — Phase 1.5.0
 *
 * 1.5.0 では既存 UI の見た目を変えないため、ここでは最小限のリセット
 * (box-sizing, focus-visible, sr-only) のみ。
 *
 * body / heading / link 等のグローバルなタイポは 1.5.5 (Visual Refactor)
 * で別ファイル (dads-typography.css 予定) として追加し、各テンプレ側で
 * inline style を撤去するのと同タイミングで有効化する。
 *
 * 参照: docs/phase1.5/plan.md §10 (1.5.0 / 1.5.5)
 * =================================================================== */

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

/* キーボード操作時のフォーカスリング (どの要素でも共通) */
:focus-visible {
  outline: 2px solid var(--c-border-focus, #0017c1);
  outline-offset: 2px;
  border-radius: 2px;
}

/* スクリーンリーダー専用 (将来 skip-link 等で使用) */
.dads-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 画像はデフォルトでブロック化 + 100% 幅で安全 (CLS 緩和) */
img { max-width: 100%; height: auto; }

/* prefers-reduced-motion の尊重 (skill §7 reduced-motion) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }
}

/* ---------------------------------------------------------------
 * .dads-shell 採用時の body リセット (1.5.1+)
 * 既存テンプレの inline `body { max-width: ...; margin: 24px auto }`
 * を、shell 採用画面でのみ無効化する。:has() は Chrome 105+ /
 * Safari 15.4+ / Firefox 121+ 対応、本プロジェクト対象ブラウザは
 * 全て満たす。
 * --------------------------------------------------------------- */
body:has(.dads-shell) {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  background: var(--c-bg-page);
  color: var(--c-text-body);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic Medium", "Noto Sans JP", "Noto Sans", sans-serif;
  font-size: 16px; /* mobile auto-zoom 防止 */
  line-height: 1.7;
}
