/* =========================================================
   こども経済新聞 — 共通スタイル（実際のデザインに準拠）
   ========================================================= */

:root {
  --teal: #0e7c74;
  --teal-hover: #0a5c56;
  --ink: #1f3a3d;
  --ink-soft: #5b7a7c;
  --meta: #8a9a96;
  --body-text: #4c6467;

  --bg: #f6f4ee;
  --card-border: #e2ddd0;

  --yellow: #f4e04d;
  --yellow-bg: #fdf6c9;
  --yellow-border: #e8d34a;
  --quiz-gold: #b09410;

  --blue: #2f6fb0;
  --orange: #c05a2e;
  --purple: #7452a8;

  --parent-bg: #eef1f4;
  --parent-text: #3d5560;

  --correct-bg: #e4f2f0;
  --wrong-bg: #f9e9e1;
  --mascot-note-bg: #eef6f5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
  color: var(--ink);
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-hover); text-decoration: underline; }

rt { font-size: 0.5em; color: var(--ink-soft); font-weight: 500; }
/* ふりがなOFF時に <rt> を隠す。トグルはJSでbodyのdata-furi属性を切り替える */
body[data-furi="off"] rt { display: none; }
/* 濃い緑背景(トップニュースカード・3行まとめ)のふりがなは白にする */
.top-story__card rt,
.summary-box rt { color: #fff; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 64px; }
.wrap--narrow { max-width: 820px; }

/* --- ヘッダー（トップページ） --- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 0 16px;
  border-bottom: 4px double var(--teal);
}

.site-header__eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.12em;
}

.site-header h1 {
  margin: 2px 0 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.site-header__meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header__date {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.site-header__date span {
  font-size: 12px;
  font-weight: 500;
}

/* --- ふりがなトグルボタン --- */
.furigana-toggle {
  border: 2px solid var(--teal);
  background: var(--teal);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.furigana-toggle[aria-pressed="false"] {
  background: #fff;
  color: var(--teal);
}

/* --- 記事詳細用の簡易ヘッダー --- */
.article-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 14px;
  border-bottom: 4px double var(--teal);
}

.article-header__back {
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
}

.article-header__meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.article-header__date {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.furigana-toggle--sm {
  font-size: 13px;
  padding: 6px 14px;
}

/* --- ケイザイくんの吹き出し（帯タイプ／トップページ冒頭） --- */
.mascot-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--yellow-bg);
  border: 2px solid var(--yellow-border);
  border-radius: 14px;
  padding: 12px 18px;
  margin: 20px 0 28px;
}

.mascot-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--yellow-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.mascot-bar__text {
  font-size: 15px;
  line-height: 1.7;
}

/* --- ケイザイくんの吹き出し（記事本文中に差し込むタイプ） --- */
.mascot-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--yellow-bg);
  border: 2px solid var(--yellow-border);
  border-radius: 14px;
  padding: 14px 18px;
}

.mascot-avatar--sm {
  width: 44px;
  height: 44px;
  font-size: 22px;
}

.mascot-note__text {
  font-size: 14px;
  line-height: 1.9;
}

/* --- きょうのトップニュース（トップページ） --- */
.top-story {
  display: block;
  color: inherit;
  margin-bottom: 36px;
}

.top-story__card {
  background: var(--teal);
  color: var(--bg);
  border-radius: 18px;
  padding: 32px 32px 28px;
  display: grid;
  gap: 14px;
}

.top-story__badges { display: flex; gap: 8px; align-items: center; }

.badge-top {
  background: var(--yellow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.top-story__page {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}

.top-story__card h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.6;
}

.top-story__card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
  opacity: 0.95;
}

.top-story__cta {
  font-size: 14px;
  font-weight: 700;
  color: var(--yellow);
}

/* --- きのうのニュース一覧 --- */
.section-heading {
  font-size: 20px;
  font-weight: 800;
  border-left: 6px solid var(--teal);
  padding-left: 12px;
  margin: 0 0 18px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.news-card {
  color: inherit;
}

.news-card__inner {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.news-card:hover .news-card__inner {
  border-color: var(--teal);
  box-shadow: 0 4px 14px rgba(14,124,116,0.12);
}

.news-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* カテゴリピル（色はカテゴリ対応表に沿って割り当てる） */
.pill {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
}
.pill--teal { background: var(--teal); }
.pill--blue { background: var(--blue); }
.pill--orange { background: var(--orange); }
.pill--purple { background: var(--purple); }

.news-card__page { font-size: 11px; color: var(--meta); }

.news-card h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.7;
}

.news-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: var(--body-text);
  flex: 1;
}

.news-card__cta {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
}

/* --- キーワード／クイズ 2カラム --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.keyword-box {
  background: #fff;
  border: 2px solid var(--teal);
  border-radius: 16px;
  padding: 24px;
}

.keyword-box h3, .keyword-box h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  color: var(--teal);
}

.keyword-box dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 14px;
  line-height: 1.8;
}

.keyword-box dt { font-weight: 800; }
.keyword-box dd { margin: 0; }

.keyword-term {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.keyword-desc {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.9;
}

.keyword-mascot {
  background: var(--mascot-note-bg);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.8;
}

/* --- クイズ --- */
.quiz-box {
  background: #fff;
  border: 2px solid var(--yellow-border);
  border-radius: 16px;
  padding: 24px;
}

.quiz-box h3, .quiz-box h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  color: var(--quiz-gold);
}

.quiz-question {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.8;
}

.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-choice {
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--card-border);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.6;
}

.quiz-choice.is-correct {
  border-color: var(--teal);
  background: var(--correct-bg);
}

.quiz-choice.is-wrong {
  border-color: var(--orange);
  background: var(--wrong-bg);
}

.quiz-choice[disabled] { cursor: default; }

.quiz-feedback {
  margin-top: 12px;
  background: var(--yellow-bg);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.8;
}

.quiz-feedback[hidden] { display: none; }

/* --- 保護者・先生向けメモ --- */
.parent-note {
  background: var(--parent-bg);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 40px;
}

.parent-note h3, .parent-note h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--parent-text);
}

.parent-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: var(--parent-text);
}

/* --- 記事本文（記事詳細ページ） --- */
.summary-box {
  background: var(--teal);
  color: var(--bg);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.summary-box h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--yellow);
}

.summary-box ol {
  margin: 0;
  padding-left: 22px;
  font-size: 15px;
  line-height: 2;
  font-weight: 500;
}

.article-body {
  font-size: 16px;
  line-height: 2.1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-body p { margin: 0; }

.article-title {
  margin: 0 0 20px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.6;
}

.back-cta {
  margin-top: 32px;
  text-align: center;
}

.back-cta a {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: 999px;
}
.back-cta a:hover { text-decoration: none; background: var(--teal-hover); }

/* --- フッター --- */
.site-footer {
  border-top: 1px solid #d8d2c2;
  padding-top: 16px;
  font-size: 12px;
  color: var(--meta);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- レスポンシブ --- */
@media (max-width: 640px) {
  .news-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .site-header h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
