/* =============================================
   VERTEX 数学解説サイト — 共通スタイル
   カラー：#FFE800（Yellow）× #000（Black）× #FFF（White）
   ============================================= */

/* ── リセット & ベース ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow:       #FFE800;
  --yellow-dark:  #E6D000;
  --yellow-pale:  #FFFDE7;
  --black:        #111111;
  --gray-900:     #1a1a1a;
  --gray-700:     #333333;
  --gray-500:     #666666;
  --gray-300:     #CCCCCC;
  --gray-100:     #F5F5F5;
  --white:        #FFFFFF;
  --orange-pale:  #FFF3E0;
  --orange-mid:   #FF8F00;
  --green-pale:   #F1F8E9;
  --green-mid:    #558B2F;
  --border:       1.5px solid #111;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow-sm:    2px 3px 0 #000;
  --shadow-md:    3px 5px 0 #000;
  --shadow-lg:    5px 8px 0 #000;
  --font-main:    'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  --max-w:        900px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.8;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── サイトヘッダー ── */
.site-header {
  background: var(--black);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  border-bottom: 3px solid var(--yellow);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-mark {
  background: var(--yellow);
  color: var(--black);
  font-size: 0.95rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: center;
}
.logo-mark small {
  display: block;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}
.logo-text {
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  display: none; /* モバイルでは非表示 */
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  min-width: 0;
}
.site-nav a {
  color: var(--gray-300);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--yellow); background: rgba(255,232,0,0.08); }
.site-nav .nav-cta {
  background: var(--yellow);
  color: var(--black);
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 6px;
  margin-left: 4px;
  border: 1.5px solid var(--yellow);
}
.site-nav .nav-cta:hover { background: var(--yellow-dark); }

/* ハンバーガー（モバイル） */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.2s;
}
.nav-drawer {
  display: none;
  position: fixed;
  inset: 63px 0 0 0;
  background: var(--black);
  z-index: 190;
  padding: 24px;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid #333;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  color: var(--white);
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 8px;
  border-bottom: 1px solid #222;
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { background: #222; color: var(--yellow); }

/* ── パンくずリスト ── */
.breadcrumb {
  background: var(--gray-100);
  border-bottom: 1.5px solid #e0e0e0;
  padding: 10px 0;
}
.breadcrumb .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--gray-500);
}
.breadcrumb a { color: var(--gray-700); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--black); text-decoration: underline; }
.breadcrumb .sep { color: var(--gray-300); }
.breadcrumb .current { color: var(--black); font-weight: 600; }

/* ── コンテナ ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── ボタン ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  border: var(--border);
  line-height: 1.3;
  text-decoration: none;
}
.btn-primary {
  background: var(--yellow);
  color: var(--black);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--yellow-dark);
  box-shadow: none;
  transform: translate(2px, 3px);
}
.btn-secondary {
  background: var(--white);
  color: var(--black);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--gray-100);
  box-shadow: none;
  transform: translate(2px, 3px);
}
.btn-black {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
  box-shadow: var(--shadow-sm);
}
.btn-black:hover {
  background: var(--gray-900);
  box-shadow: none;
  transform: translate(2px, 3px);
}
.btn-sm {
  padding: 7px 16px;
  font-size: 0.83rem;
}

/* ── タグ・バッジ ── */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1.5px solid currentColor;
}
.tag-yellow { background: var(--yellow); color: var(--black); border-color: var(--black); }
.tag-black  { background: var(--black);  color: var(--white); border-color: var(--black); }
.tag-gray   { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-300); }
.tag-green  { background: var(--green-pale); color: var(--green-mid); border-color: var(--green-mid); }
.tag-orange { background: var(--orange-pale); color: var(--orange-mid); border-color: var(--orange-mid); }

/* ── セクション見出し（本文用） ── */
.article h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--black);
  margin: 52px 0 16px;
  padding: 12px 16px;
  background: var(--yellow);
  border-left: 5px solid var(--black);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.4;
}
.article h2:first-child { margin-top: 0; }
.article h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--black);
  margin: 32px 0 10px;
  padding-left: 14px;
  border-left: 3px solid var(--black);
}
.article p { margin-bottom: 14px; color: var(--gray-700); }
.article p:last-child { margin-bottom: 0; }

/* ── 図・画像スペース ── */
.figure-block {
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 24px 0;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.fig-placeholder {
  background: var(--gray-100);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: 0.9rem;
  gap: 8px;
  border-bottom: var(--border);
}
.figure-block figcaption {
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* ── GeoGebra スペース ── */
.geogebra-wrap {
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.ggb-label {
  background: var(--black);
  color: var(--yellow);
  padding: 9px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.geogebra-wrap iframe {
  display: block;
  width: 100%;
  border: none;
}

/* ── 定義ボックス ── */
.definition-box {
  background: var(--yellow-pale);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.definition-box .def-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--black);
  background: var(--yellow);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
  border: 1.5px solid var(--black);
}
.definition-box .def-body {
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  line-height: 1.7;
}

/* ── よくある間違いボックス ── */
.mistake-box {
  background: var(--orange-pale);
  border: 2px solid #FF8F00;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin: 28px 0;
  box-shadow: 3px 4px 0 #FF8F00;
}
.mistake-box .mistake-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FF8F00;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}
.mistake-box p { color: #4E2600; margin-bottom: 8px; }
.mistake-box p:last-child { margin-bottom: 0; }
.mistake-box strong { color: #BF360C; }

/* 正誤比較 */
.wrong-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.wr-box {
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1.5px solid;
}
.wr-box.wrong { background: #FFEBEE; border-color: #E53935; }
.wr-box.right { background: #E8F5E9; border-color: #43A047; }
.wr-label { font-size: 0.72rem; font-weight: 700; margin-bottom: 4px; }
.wr-box.wrong .wr-label { color: #C62828; }
.wr-box.right  .wr-label { color: #2E7D32; }
.wr-content { font-family: 'Georgia', serif; font-style: italic; font-size: 1.05rem; color: var(--black); }

/* ── ポイントボックス（黄色ボーダー） ── */
.point-box {
  border-left: 4px solid #FFE800;
  background: #FFFDE7;
  border-radius: 0 8px 8px 0;
  padding: 16px 18px;
  margin: 20px 0;
}
.point-box .point-label {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #7a6000;
  margin-bottom: 8px;
}

/* ── 定義ボックス（青ボーダー） ── */
.def-box {
  border-left: 4px solid #2196F3;
  background: #E3F2FD;
  border-radius: 0 8px 8px 0;
  padding: 16px 18px;
  margin: 20px 0;
}
.def-box .def-box-label {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #0D47A1;
  margin-bottom: 8px;
}

/* ── 警告ボックス（赤ボーダー） ── */
.warn-box {
  border-left: 4px solid #FF5252;
  background: #FFEBEE;
  border-radius: 0 8px 8px 0;
  padding: 16px 18px;
  margin: 20px 0;
}
.warn-box .warn-label {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #B71C1C;
  margin-bottom: 8px;
}

/* ── 補足ボックス（グレー背景） ── */
.supplement-box {
  background: #F5F5F5;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: #444;
}

/* ── 証明（折りたたみ） ── */
details.proof-details summary {
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
  background: #F0F0F0;
  border-radius: 6px;
  margin: 12px 0 0;
  list-style: none;
  user-select: none;
}
details.proof-details summary::-webkit-details-marker { display: none; }
details.proof-details summary::before { content: '▶ '; }
details[open].proof-details summary::before { content: '▼ '; }
details.proof-details .proof-body {
  padding: 14px 16px;
  background: #FAFAFA;
  border-radius: 0 0 6px 6px;
  border: 1px solid #E0E0E0;
  border-top: none;
}

/* ── 問題ブロック ── */
.exercise-block {
  border: 2px solid #111;
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}
.exercise-q {
  padding: 14px 18px;
  background: #111;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.exercise-q-num { color: #FFE800; margin-right: 8px; }
.exercise-body {
  padding: 16px 18px;
}
details.sol-details summary {
  cursor: pointer;
  font-weight: 700;
  padding: 9px 14px;
  background: #FFFDE7;
  border: 1.5px solid #FFE800;
  border-radius: 6px;
  margin-top: 10px;
  list-style: none;
  user-select: none;
  font-size: 0.88rem;
}
details.sol-details summary::-webkit-details-marker { display: none; }
details.sol-details summary::before { content: '▶ 解説を見る'; }
details[open].sol-details summary::before { content: '▼ 解説を閉じる'; }
details.sol-details .sol-body {
  padding: 14px 16px;
  border: 1.5px solid #FFE800;
  border-top: none;
  border-radius: 0 0 6px 6px;
  font-size: 0.9rem;
  line-height: 1.9;
  background: #FFFDE7;
}

/* ── インタラクティブ ウィジェット ── */
.interactive-widget {
  border: 2px solid var(--black);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 28px 0;
  box-shadow: var(--shadow-md);
}
.widget-head {
  background: var(--black);
  color: var(--yellow);
  padding: 10px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.widget-body { padding: 20px; background: var(--white); }

/* ── データテーブル ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}
.data-table th {
  background: var(--black);
  color: var(--yellow);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
}
.data-table td {
  border: 1px solid #ddd;
  padding: 9px 14px;
  vertical-align: top;
}
.data-table tbody tr:nth-child(odd) { background: #fafafa; }
.data-table tbody tr:hover { background: #f0f8f0; }

/* ── 例題ボックス ── */
.example-box {
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 28px 0;
  box-shadow: var(--shadow-md);
}
.example-header {
  background: var(--black);
  color: var(--yellow);
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.04em;
}
.example-body { padding: 20px 22px; background: var(--yellow-pale); }
.example-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--gray-300);
  line-height: 1.7;
}

/* ── 折りたたみ ── */
details {
  border: var(--border);
  border-radius: var(--radius);
  margin-top: 10px;
  overflow: hidden;
  background: var(--white);
}
details + details { margin-top: 8px; }
summary {
  padding: 13px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--black);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  background: var(--gray-100);
  transition: background 0.15s;
  user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary:hover { background: var(--yellow); }
summary .summary-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--black);
  color: var(--yellow);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
details[open] summary .summary-icon { transform: rotate(90deg); }
.details-body {
  padding: 16px 18px;
  font-size: 0.92rem;
  color: var(--gray-700);
  border-top: 1.5px solid var(--gray-300);
}
.details-body p { margin-bottom: 10px; }
.details-body p:last-child { margin-bottom: 0; }

/* ステップ表示 */
.step-list { display: flex; flex-direction: column; gap: 10px; }
.step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.step-num {
  background: var(--yellow);
  color: var(--black);
  border: 1.5px solid var(--black);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── 練習問題 ── */
.practice-section {
  background: var(--green-pale);
  border: 2px solid var(--green-mid);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 36px 0;
  box-shadow: 3px 4px 0 var(--green-mid);
}
.practice-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--white);
  background: var(--green-mid);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.practice-item {
  background: var(--white);
  border: 1.5px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}
.practice-item:last-child { margin-bottom: 0; }
.q-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green-mid);
  margin-bottom: 6px;
  letter-spacing: 0.08em;
}
.q-text { font-size: 0.95rem; color: var(--black); margin-bottom: 12px; font-weight: 500; }

/* ── まとめボックス ── */
.summary-box {
  background: #FFFDE7;
  border: 2px solid #F9A825;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin: 36px 0;
  box-shadow: 3px 4px 0 #F9A825;
}
.summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--black);
  background: #FFD600;
  border: 1.5px solid var(--black);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.summary-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.summary-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--black);
}
.summary-list li::before {
  content: '★';
  color: #F9A825;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 3px;
}

/* ── トピックナビゲーション ── */
.topic-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--black);
}
.topic-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
  color: var(--black);
}
.topic-nav-btn:hover {
  background: var(--yellow);
  box-shadow: none;
  transform: translate(2px, 3px);
}
.topic-nav-btn.next { flex-direction: row-reverse; text-align: right; }
.nav-arrow { font-size: 1.3rem; flex-shrink: 0; }
.nav-meta { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 0.7rem; color: var(--gray-500); }
.nav-title { font-size: 0.9rem; font-weight: 700; }
.topic-nav-sub {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
}
.topic-nav-sub a {
  font-size: 0.82rem;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-300);
  transition: color 0.15s;
}
.topic-nav-sub a:hover { color: var(--black); border-color: var(--black); }

/* ── 目次（サイドバー） ── */
.toc-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 76px;
}
.toc-header {
  background: var(--black);
  color: var(--yellow);
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.toc-list { list-style: none; padding: 12px 0; }
.toc-list li a {
  display: block;
  padding: 7px 16px;
  font-size: 0.83rem;
  color: var(--gray-700);
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.toc-list li a:hover,
.toc-list li a.active {
  color: var(--black);
  background: var(--yellow-pale);
  border-left-color: var(--black);
  font-weight: 600;
}

/* サイドバー単元リスト */
.unit-sidebar-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
}
.unit-sidebar-header {
  background: var(--yellow);
  color: var(--black);
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-bottom: var(--border);
}
.unit-progress-list { list-style: none; padding: 8px 0; }
.unit-progress-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 0.82rem;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-100);
}
.unit-progress-list li:last-child { border-bottom: none; }
.unit-progress-list li.done { color: var(--gray-700); }
.unit-progress-list li.current {
  color: var(--black);
  font-weight: 700;
  background: var(--yellow-pale);
}
.up-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  flex-shrink: 0;
  border: 1.5px solid var(--gray-300);
}
.done .up-dot { background: var(--black); border-color: var(--black); }
.current .up-dot { background: var(--yellow); border: 2px solid var(--black); }

/* ── 数式インライン表示 ── */
.math-inline {
  font-family: 'Georgia', serif;
  font-style: italic;
  font-size: 1em;
  background: var(--gray-100);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--gray-300);
  white-space: nowrap;
}
.math-block {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}
.math-block .inner {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 16px 32px;
  font-family: 'Georgia', serif;
  font-size: 1.25rem;
  color: var(--black);
  font-style: italic;
  box-shadow: var(--shadow-sm);
  line-height: 1.8;
}

/* ── サイトフッター ── */
.site-footer {
  background: var(--black);
  color: var(--gray-300);
  padding: 52px 24px 28px;
  margin-top: 80px;
  border-top: 3px solid var(--yellow);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid #333;
}
.footer-brand .logo-mark {
  margin-bottom: 12px;
}
.footer-brand p { font-size: 0.82rem; color: var(--gray-500); line-height: 1.6; }
.footer-col h4 { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; color: var(--yellow); margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: 0.83rem; color: var(--gray-400, #aaa); transition: color 0.15s; }
.footer-col ul li a:hover { color: var(--white); }
.footer-bottom {
  max-width: 1100px;
  margin: 24px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--gray-500);
}

/* ── ページ共通ヒーロー ── */
.page-hero {
  background: var(--black);
  color: var(--white);
  padding: 56px 24px 48px;
  border-bottom: 3px solid var(--yellow);
}
.page-hero .inner { max-width: var(--max-w); margin: 0 auto; }
.page-hero .eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--yellow);
  margin-bottom: 12px;
}
.page-hero h1 {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 14px;
  line-height: 1.25;
}
.page-hero h1 em {
  font-style: normal;
  color: var(--yellow);
}
.page-hero .desc { font-size: 1rem; color: #aaa; max-width: 520px; }

/* ── トピックページヘッダー ── */
.topic-hero {
  background: var(--black);
  color: var(--white);
  padding: 44px 24px 0;
  border-bottom: 3px solid var(--yellow);
}
.topic-hero .inner { max-width: var(--max-w); margin: 0 auto; }
.topic-hero .unit-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--yellow);
  margin-bottom: 10px;
}
.topic-hero h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 22px;
  line-height: 1.3;
}
.topic-hero .learn-box {
  background: rgba(255,232,0,0.1);
  border: 1.5px solid rgba(255,232,0,0.4);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 22px;
  max-width: 540px;
}
.topic-hero .learn-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--yellow);
  margin-bottom: 10px;
}
.topic-hero .learn-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.topic-hero .learn-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: #eee;
}
.topic-hero .learn-list li::before {
  content: '✓';
  color: var(--yellow);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── 2カラムレイアウト ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 40px;
  align-items: start;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── レスポンシブ ── */
@media (max-width: 1024px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .logo-text { display: none; }

  .page-hero h1, .topic-hero h1 { font-size: 1.6rem; }

  .two-col { grid-template-columns: 1fr; padding: 24px 16px 60px; }
  .two-col .sidebar { display: none; }

  .topic-nav { grid-template-columns: 1fr; }
  .wrong-right { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  .container, .container-wide { padding: 0 16px; }
  .article h2 { font-size: 1.15rem; }
}

@media (min-width: 1025px) {
  .logo-text { display: block; }
}

/* ── 学年別アクセントカラー ── */
:root {
  --color-elementary: #FF6B2B;
  --color-junior:     #2ECC71;
  --color-high:       #2C3E8C;
}

.badge-elementary { background: #FFF0E8; color: #CC4A14; border: 1.5px solid #FF6B2B; font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.badge-junior     { background: #E8F8EF; color: #1a8a4a; border: 1.5px solid #2ECC71; font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.badge-high       { background: #E8EAF6; color: #2C3E8C; border: 1.5px solid #2C3E8C; font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.badge-coming     { background: var(--gray-100); color: var(--gray-500); border: 1.5px solid var(--gray-300); font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }

/* ── トピックページ CTA セクション ── */
.topic-cta-section {
  background: var(--yellow);
  border-top: 3px solid var(--black);
  border-bottom: 3px solid var(--black);
  padding: 60px 24px;
  text-align: center;
}
.topic-cta-inner { max-width: 600px; margin: 0 auto; }
.topic-cta-heading {
  font-size: clamp(1.3rem, 3.5vw, 1.85rem);
  font-weight: 900;
  color: var(--black);
  line-height: 1.35;
  margin-bottom: 24px;
}
.topic-cta-heading em { font-style: normal; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.topic-cta-list {
  list-style: none;
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  margin-bottom: 24px;
  background: rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 18px 28px;
}
.topic-cta-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--black);
}
.topic-cta-list li::before {
  content: '✓';
  width: 22px; height: 22px;
  background: var(--black);
  color: var(--yellow);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 900;
  flex-shrink: 0;
}
.topic-cta-sub { font-size: 1.05rem; font-weight: 700; color: var(--black); margin-bottom: 28px; }
.topic-cta-btn {
  display: inline-block;
  background: var(--black);
  color: var(--yellow);
  border: 2.5px solid var(--black);
  border-radius: var(--radius);
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 4px 5px 0 rgba(0,0,0,0.2);
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.topic-cta-btn:hover { box-shadow: none; transform: translate(3px,4px); }
.topic-cta-note { font-size: 0.8rem; color: var(--gray-700); margin-top: 16px; }

/* ── 追加ボタンバリアント ── */
.btn-yellow { background: var(--yellow); color: var(--black); border-color: var(--yellow); box-shadow: var(--shadow-sm); }
.btn-yellow:hover { background: var(--yellow-dark); box-shadow: none; transform: translate(2px,3px); }
.btn-white  { background: var(--white); color: var(--black); border-color: var(--white); box-shadow: var(--shadow-sm); }
.btn-white:hover  { background: var(--gray-100); box-shadow: none; transform: translate(2px,3px); }
