/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   base.css — やすおのたび デザインシステム
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── 1. CSS変数 ─────────────────────────────── */
:root {
  /* カラーパレット — ミニマル・ノイズレス */
  --color-bg:          #fafafa;
  --color-bg-alt:      #f2f2f0;
  --color-bg-dark:     #111111;
  --color-text:        #1a1a1a;
  --color-text-muted:  #6b6b6b;
  --color-text-light:  #999999;
  --color-border:      #e0e0de;
  --color-border-dark: #333333;
  --color-accent:      #2c2c2c;
  --color-white:       #ffffff;

  /* タイムラインの点の色 — 各フェーズで微妙に変える */
  --color-dot-africa:  #8B7355;
  --color-dot-japan:   #5B6E5B;
  --color-dot-glocal:  #6B5B7B;
  --color-dot-ntc:     #5B6B8B;
  --color-dot-kenya:   #8B6B55;

  /* タイポグラフィ */
  --font-serif:   'Shippori Mincho', 'Noto Serif JP', 'Yu Mincho', '游明朝', serif;
  --font-serif-b: 'Shippori Mincho B1', 'Shippori Mincho', serif;
  --font-sans:    'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
  --font-accent:  'Cormorant Garamond', 'Georgia', serif;

  /* フォントサイズ */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-md:   1.125rem;   /* 18px */
  --text-lg:   1.375rem;   /* 22px */
  --text-xl:   1.75rem;    /* 28px */
  --text-2xl:  2.25rem;    /* 36px */
  --text-3xl:  3rem;       /* 48px */
  --text-4xl:  4rem;       /* 64px */

  /* 行間 */
  --leading-tight:  1.3;
  --leading-normal: 1.8;
  --leading-loose:  2.2;

  /* 余白 */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  3.5rem;
  --space-xl:  5rem;
  --space-2xl: 7.5rem;

  /* レイアウト */
  --content-width:   720px;
  --content-wide:    960px;
  --content-full:    1200px;
  --header-height:   60px;

  /* トランジション */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms;
  --duration-mid:  400ms;
  --duration-slow: 800ms;

  /* シャドウ */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
}


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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}

a:hover {
  opacity: 0.7;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background-color: var(--color-text);
  color: var(--color-bg);
}


/* ── 3. タイポグラフィ ─────────────────────── */

/* 見出し — 明朝体で知性を表現 */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: 0.02em;
}

h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }
h5 { font-size: var(--text-md);  }
h6 { font-size: var(--text-base); }

/* 本文中の段落 */
.entry-content p {
  margin-bottom: 1.6em;
  font-size: var(--text-md);
  line-height: var(--leading-loose);
}

/* 英数字のアクセント */
.accent-font {
  font-family: var(--font-accent);
  font-style: italic;
  letter-spacing: 0.03em;
}

/* 年号・数字ラベル */
.year-label {
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-light);
}


/* ── 4. レイアウトユーティリティ ──────────── */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.container--wide {
  max-width: var(--content-wide);
}

.container--full {
  max-width: var(--content-full);
}

.section {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-lg);
}


/* ── 5. 目次（TOC） ───────────────────────── */
.toc {
  margin: var(--space-lg) 0;
  padding: var(--space-md);
  background: var(--color-bg-alt);
  border-left: 3px solid var(--color-border);
}

.toc__title {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}

.toc__list {
  margin-top: var(--space-sm);
  padding-left: 1.2em;
  list-style-type: decimal;
}

.toc__item {
  margin-bottom: 0.4em;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.toc__item a {
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.toc__item a:hover {
  opacity: 1;
  border-bottom-color: var(--color-text-muted);
}

.toc__item--sub {
  padding-left: 1em;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}


/* ── 6. アニメーション基盤 ─────────────────── */

/* フェードインの基底クラス — JSで .is-visible を付与 */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* スライドイン（左から） */
.slide-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.slide-in-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* スライドイン（右から） */
.slide-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.slide-in-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}


/* ── 7. レスポンシブ ──────────────────────── */
@media (max-width: 768px) {
  :root {
    --text-3xl: 2.25rem;
    --text-2xl: 1.75rem;
    --text-xl:  1.375rem;
    --space-lg: 2.5rem;
    --space-xl: 3.5rem;
    --space-2xl: 5rem;
  }

  .container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
}

@media (max-width: 480px) {
  :root {
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
    --text-xl:  1.25rem;
  }
}

/* ヘッダー回り込み防止（下層ページ用） */
#main-content {
  padding-top: var(--header-height);
}

.home #main-content {
  padding-top: 0;
}
