/* 中学生向け学習サイト 記事用CSS（kids-tech article.cssをベースに数学・証明用の要素を追加） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Hiragino Kaku Gothic ProN", "Helvetica Neue", Helvetica, Arial, sans-serif; line-height: 1.8; color: #333; background: #f5f5f5; }

header { position: fixed; top: 0; width: 100%; background: #fff; border-bottom: 1px solid #ddd; z-index: 100; }
.header-container { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px; max-width: 1100px; margin: 0 auto; }
.site-title { font-size: 1.05rem; font-weight: 700; color: #222; text-decoration: none; }
.site-title small { display: block; font-size: 0.7rem; font-weight: 400; color: #777; margin-top: 2px; }
.subject-nav { display: flex; gap: 12px; }
.subject-nav a { text-decoration: none; color: #444; font-size: 0.85rem; padding: 4px 10px; border-radius: 4px; }
.subject-nav a:hover { background: #f0f0f0; }
.subject-nav a.current { background: #2563eb; color: #fff; }

main { margin-top: 70px; padding: 30px 20px 60px; }
.tech-post { max-width: 860px; margin: 0 auto; background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); padding: 40px 48px; }

.breadcrumb { font-size: 0.82rem; color: #64748b; margin-bottom: 18px; }
.breadcrumb a { color: #475569; text-decoration: none; font-weight: 700; }
.breadcrumb a:hover { text-decoration: underline; }

.post-header { margin-bottom: 28px; border-bottom: 2px solid #f0f0f0; padding-bottom: 24px; }
.post-tag { display: inline-block; font-size: 0.78rem; color: #fff; background: #2563eb; padding: 3px 10px; border-radius: 3px; margin-bottom: 14px; }
.post-title { font-size: 1.7rem; font-weight: bold; color: #222; line-height: 1.45; }
.post-lead { font-size: 0.95rem; color: #666; margin-top: 14px; line-height: 1.8; }

.post-body { font-size: 1rem; line-height: 1.95; color: #444; }
.post-body p { margin-bottom: 1.4em; }
.post-body h2 { font-size: 1.2rem; color: #2563eb; margin: 2em 0 0.8em; padding-left: 12px; border-left: 4px solid #2563eb; }
.post-body h3 { font-size: 1.05rem; color: #1e40af; margin: 1.6em 0 0.6em; }
.post-body ul { margin: 0 0 1.4em 1.4em; }
.post-body ul li { margin-bottom: 0.4em; }
.post-body ol { margin: 0 0 1.4em 1.4em; }
.post-body ol li { margin-bottom: 0.4em; }

/* 共通ボックス */
.summary-box { background: #eef2ff; border-left: 4px solid #2563eb; padding: 14px 18px; margin: 1.4em 0; border-radius: 4px; font-size: 0.95rem; }
.action-box  { background: #fff8e1; border-left: 4px solid #f59e0b; padding: 14px 18px; margin: 1.4em 0; border-radius: 4px; font-size: 0.95rem; }
.warn-box    { background: #fff1f2; border-left: 4px solid #e11d48; padding: 14px 18px; margin: 1.4em 0; border-radius: 4px; font-size: 0.95rem; }

/* Internal AI/RAG data. Keep it in HTML for extraction, but never show it in the human UI. */
.ai-learning-block,
.phase1-rag-augmentation {
  display: none !important;
}

/* AI先生の学習データ向け補強ブロック */
.ai-learning-block {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #475569;
  border-radius: 8px;
  padding: 18px 22px;
  margin: 1.8em 0;
}
.ai-learning-block h2 {
  border-left: 0;
  padding-left: 0;
  margin: 0 0 0.9em;
  color: #1e293b;
}
.ai-learning-block h3 {
  color: #334155;
  margin: 1.2em 0 0.4em;
}
.ai-learning-block dl {
  margin: 0.5em 0 1.2em;
}
.ai-learning-block dt {
  font-weight: 700;
  color: #1e293b;
  margin-top: 0.8em;
}
.ai-learning-block dd {
  margin: 0.25em 0 0.7em 1em;
}
.ai-learning-block .ai-note {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 1em;
}

/* 用語カード（定義・定理など、覚えるべき言葉を強調） */
.term-card { background: #f0fdf4; border: 1.5px solid #16a34a; border-radius: 8px; padding: 14px 18px; margin: 1.2em 0; }
.term-card .term-label { display: inline-block; background: #16a34a; color: #fff; font-size: 0.78rem; padding: 2px 8px; border-radius: 3px; margin-bottom: 8px; font-weight: bold; }
.term-card .term-name { font-size: 1.05rem; font-weight: bold; color: #14532d; margin-bottom: 4px; }
.term-card .term-body { font-size: 0.95rem; color: #333; }

/* 定理カード（橙色） */
.theorem-card { background: #fff7ed; border: 1.5px solid #ea580c; border-radius: 8px; padding: 14px 18px; margin: 1.2em 0; }
.theorem-card .term-label { display: inline-block; background: #ea580c; color: #fff; font-size: 0.78rem; padding: 2px 8px; border-radius: 3px; margin-bottom: 8px; font-weight: bold; }
.theorem-card .term-name { font-size: 1.05rem; font-weight: bold; color: #7c2d12; margin-bottom: 4px; }

/* 証明ボックス */
.proof-box { background: #fafafa; border: 1px solid #ddd; border-radius: 6px; padding: 18px 22px; margin: 1.4em 0; font-size: 0.95rem; }
.proof-box .proof-title { font-weight: bold; color: #1e3a8a; margin-bottom: 10px; font-size: 0.95rem; }
.proof-box .proof-line { margin: 0.3em 0; }
.proof-box .proof-step { display: inline-block; background: #2563eb; color: #fff; font-size: 0.78rem; padding: 1px 7px; border-radius: 3px; margin-right: 6px; }
.proof-box .proof-end  { margin-top: 0.8em; padding-top: 0.6em; border-top: 1px dashed #ccc; font-weight: bold; color: #1e3a8a; }

/* 仮定・結論 表記 */
.hypothesis, .conclusion { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 0.85rem; font-weight: bold; }
.hypothesis { background: #dbeafe; color: #1e3a8a; }
.conclusion { background: #fee2e2; color: #991b1b; }

/* 数式インライン */
.math { font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif; font-style: normal; }

/* 練習問題セクション */
.problems-section { margin-top: 2.4em; padding-top: 1.2em; border-top: 3px double #2563eb; }
.problem-box { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; padding: 16px 20px; margin: 1.2em 0; }
.problem-box .problem-num { display: inline-block; background: #0f172a; color: #fff; font-size: 0.82rem; padding: 2px 10px; border-radius: 3px; margin-bottom: 10px; font-weight: bold; }
.problem-box .problem-question { margin-bottom: 0.8em; }

/* 解答開閉（detailsベース） */
details.answer { margin-top: 0.8em; background: #fff; border: 1px solid #e2e8f0; border-radius: 4px; padding: 8px 14px; }
details.answer summary { cursor: pointer; font-size: 0.85rem; font-weight: bold; color: #2563eb; padding: 2px 0; list-style: none; }
details.answer summary::-webkit-details-marker { display: none; }
details.answer summary::before { content: "▶ "; display: inline-block; transition: transform 0.2s; margin-right: 4px; }
details.answer[open] summary::before { transform: rotate(90deg); }
details.answer[open] summary { color: #1e3a8a; margin-bottom: 8px; border-bottom: 1px solid #eee; padding-bottom: 4px; }
details.answer .answer-body { font-size: 0.93rem; color: #333; }
details.answer .answer-body p { margin-bottom: 0.6em; }

/* 図 */
.figure { margin: 1.6em 0; text-align: center; }
.figure svg { max-width: 100%; height: auto; }
.figure figcaption { font-size: 0.85rem; color: #777; margin-top: 8px; }

/* 関連記事 */
.related-area { margin-top: 28px; }
.related-link { display: block; border: 1px solid #d6dfff; border-radius: 6px; padding: 12px 14px; color: #1e40af; text-decoration: none; background: #f5f8ff; line-height: 1.55; margin-bottom: 8px; }
.related-link:hover { background: #eef2ff; }
.related-label { display: block; color: #60706c; font-size: 0.78rem; font-weight: 700; margin-bottom: 3px; }

.post-footer { margin-top: 36px; padding-top: 20px; border-top: 1px solid #eee; }
.back-link { color: #2563eb; text-decoration: none; font-size: 0.9rem; font-weight: bold; }

footer { background: #222; color: #ddd; text-align: center; padding: 20px; font-size: 0.9rem; margin-top: 40px; }
.footer-content { max-width: 900px; margin: 0 auto; }

@media (max-width: 600px) {
  .tech-post { padding: 24px 18px; }
  .post-title { font-size: 1.3rem; }
  .post-body h2 { font-size: 1.1rem; }
  .header-container { flex-direction: column; gap: 6px; padding: 8px 12px; }
  .subject-nav { flex-wrap: wrap; justify-content: center; }
  main { margin-top: 90px; }
}

/* === 標準サイトヘッダー（全ページ共通仕様に統一・2026-05-30追加） === */
header { position: static; }            /* 2段ヘッダーのため固定解除（高さ可変に強い） */
main { margin-top: 24px; }              /* 固定解除に伴いオフセット縮小 */
.header-top { border-bottom: 1px solid #eee; }
.logo-link { display: flex; align-items: center; text-decoration: none; gap: 10px; }
.logo-img { width: 96px; height: auto; display: block; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; font-size: 0.95rem; font-weight: 700; color: #333; line-height: 1.3; }
.logo-text-sub { font-size: 0.62rem; font-weight: 400; color: #666; }
.main-nav { display: flex; gap: 24px; align-items: flex-start; }
.nav-group { display: flex; flex-direction: column; align-items: flex-start; }
.nav-group .bubble { position: relative; display: inline-block; margin: 0 0 5px; padding: 4px 10px; font-size: 0.82rem; color: #fff; border-radius: 6px; }
.nav-group ul { list-style: none; display: flex; flex-wrap: nowrap; gap: 6px; white-space: nowrap; margin: 0; padding: 0; }
.nav-group ul li a { display: block; text-decoration: none; color: #333; font-size: 0.82rem; font-weight: bold; padding: 4px 8px; border-radius: 5px; }
.nav-group ul li a:hover { background: #f0f0f0; }
.nav-group ul li a.current { background: #2563eb; color: #fff; }
.header-donate-btn { display: inline-block; padding: 5px 12px; background: #8e44ad; color: #fff; border-radius: 4px; text-decoration: none; font-size: 0.85rem; font-weight: bold; white-space: nowrap; margin-left: 8px; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; outline: none; }
.menu-toggle span { display: block; width: 25px; height: 3px; margin: 4px auto; background-color: #333; }
@media (max-width: 900px) {
  .menu-toggle { display: block; order: 3; }
  .header-top { position: relative; flex-wrap: wrap; }
  .main-nav { display: none; width: 100%; flex-direction: column; gap: 14px; padding: 10px 0 4px; }
  .main-nav.open { display: flex; }
  .nav-group ul { flex-wrap: wrap; white-space: normal; }
}
/* ヘッダー2段化の微調整 */
.logo-text { white-space: nowrap; }
.logo-text-sub { white-space: nowrap; }
header .header-container { max-width: 100%; }

/* === シンプル共通ヘッダー（2026-05-31 こども学びシリーズ統一） === */
header { background:#fff !important; border-bottom:3px solid #1abc9c; padding:10px 20px; position:sticky; top:0; z-index:100; }
main { margin-top: 24px; }
header .header-container { display:flex; align-items:center; gap:14px; max-width:1100px !important; margin:0 auto; }
.logo-link { display:flex; align-items:center; gap:10px; text-decoration:none; flex-shrink:0; }
.logo-img { height:40px !important; width:auto !important; display:block; }
.logo-text { display:flex; flex-direction:column; font-size:0.95rem; font-weight:700; color:#333; line-height:1.2; white-space:nowrap; }
.logo-text-sub { font-size:0.62rem; font-weight:400; color:#666; }
.header-nav { display:flex; flex-wrap:wrap; align-items:center; gap:2px; }
.header-nav a { color:#172033; text-decoration:none; font-weight:700; font-size:0.82rem; padding:6px 9px; border-radius:999px; white-space:nowrap; }
.header-nav a:hover { background:#f0f0f0; }
.header-nav a[aria-current="page"] { background:#1abc9c; color:#fff; }
.header-actions { margin-left:auto; flex-shrink:0; display:flex; align-items:center; gap:8px; }
.header-donate-btn { display:inline-block; padding:6px 14px; background:#8e44ad; color:#fff; border-radius:999px; text-decoration:none; font-size:0.82rem; font-weight:bold; white-space:nowrap; }
@media (max-width:820px){ header .header-container{flex-wrap:wrap;} .header-nav{order:3;width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px;} }
