/* ==========================================================================
   base.css — CSS変数 / リセット / タイポグラフィ基盤
   読み込み順: base.css → layout.css → components.css → pages/*.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS カスタムプロパティ（全ファイル共通の設計トークン）
   -------------------------------------------------------------------------- */
:root {
  /* カラー */
  --color-text:        #1a1a1a;
  --color-text-muted:  #6b6b6b;
  --color-primary:     #0d0d0d;
  --color-bg:          #fafafa;
  --color-surface:     #ffffff;
  --color-border:      #e5e5e5;

  /* フォント */
  --font-ja: 'Noto Sans JP', sans-serif;
  --font-en: 'Inter', sans-serif;

  /* タイポグラフィスケール */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-md:   1.25rem;    /* 20px */
  --text-lg:   1.5rem;     /* 24px */
  --text-xl:   2rem;       /* 32px */
  --text-2xl:  2.5rem;     /* 40px */
  --text-3xl:  3rem;       /* 48px */

  /* スペーシング（8px グリッド） */
  --space-1:   0.5rem;     /* 8px  */
  --space-2:   1rem;       /* 16px */
  --space-3:   1.5rem;     /* 24px */
  --space-4:   2rem;       /* 32px */
  --space-5:   2.5rem;     /* 40px */
  --space-6:   3rem;       /* 48px */
  --space-8:   4rem;       /* 64px */
  --space-12:  6rem;       /* 96px */
  --space-16:  8rem;       /* 128px */

  /* コンテナ幅 */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1200px;

  /* その他 */
  --border-radius: 4px;
  --transition:  0.2s ease;

  /* ヘッダー高さ（JS から参照可能にする） */
  --header-height: 64px;
}

/* --------------------------------------------------------------------------
   2. モダン CSS リセット
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  overflow-x: clip; /* 横スクロール防止保険。clip は scroll container を作らないため position:sticky を壊さない */
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ja);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

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

ul,
ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   3. タイポグラフィ基盤
   -------------------------------------------------------------------------- */

/* 英数字は Inter を優先 */
h1, h2, h3, h4, h5, h6,
.is-en {
  font-family: var(--font-en), var(--font-ja);
}

h1 { font-size: var(--text-2xl); font-weight: 700; line-height: 1.3; }
h2 { font-size: var(--text-xl);  font-weight: 700; line-height: 1.3; }
h3 { font-size: var(--text-lg);  font-weight: 600; line-height: 1.4; }
h4 { font-size: var(--text-md);  font-weight: 600; line-height: 1.4; }
h5 { font-size: var(--text-base); font-weight: 600; }
h6 { font-size: var(--text-sm);  font-weight: 600; }

p {
  line-height: 1.8;
}

/* レスポンシブ見出し（モバイルで縮小） */
@media (max-width: 767px) {
  h1 { font-size: var(--text-xl); }
  h2 { font-size: var(--text-lg); }
  h3 { font-size: var(--text-md); }
}

/* --------------------------------------------------------------------------
   4. WordPress コアスタイル上書き
   -------------------------------------------------------------------------- */

/* アイキャッチ画像のオーバーフロー防止 */
.wp-post-image {
  max-width: 100%;
  height: auto;
}

/* Gutenberg ブロックのデフォルトマージンリセット */
.wp-block-paragraph,
.wp-block-heading {
  margin-block: 0;
}
