@charset "utf-8";
/* エレメンタリペディア（/pedia/・/pedia/<slug>/。2026-11-28 サク決定）の見た目。手で書くファイル（生成しない）。
   - 形は Gamma の見本（gamma/20261128-085725-e556 の docs/drafts/elementaripedia-mockup/style.css の .ep-*）をうつしたもの。
   - 色・角丸・影・書体は DESIGN.md 第1章のトークン（manabi.css の :root）だけを使う。新しい色は足さない。
   - 押せる物 = 墨の線 2px ＋ 真下の墨の影／読むだけの箱 = 1.5px の静かな枠・影なし／丸いチップ = 影なし。
   - 文字は 14px 以上、押せる所は高さ 44px 以上。
   - 長く読む「くわしく」の箱と、大人向けの「出典と基準日」の区画は無地（方眼を敷かない）。
   manabi.css のあとに読む。 */

.ep-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.ep-jump__list { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ep-jump__chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px;
  background: var(--bg-card); border: 1.5px solid var(--rule-line); border-radius: var(--r-pill);
  font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.ep-jump__chip:hover { background: var(--wood-light); border-color: var(--ink); color: var(--ink); }

/* 題名まわり */
.ep-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-top: 16px; padding-bottom: 16px; }
.ep-head__main { flex: 1 1 auto; min-width: 0; }
.ep-head .m-qr { margin-top: 0; flex: none; }
.ep-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.ep-pill {
  display: inline-flex; align-items: center; min-height: 30px; padding: 3px 12px;
  border: 1.5px solid var(--rule-line); border-radius: var(--r-pill); background: var(--bg-card);
  font-family: var(--font-head); font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--ink);
}
.ep-pill--wood { background: var(--wood-light); border-color: var(--wood-edge); }
.ep-pill--ink { background: var(--ink); border-color: var(--ink); color: var(--bg-paper); }
.ep-title { margin: 0; font-family: var(--font-head); font-weight: 900; font-size: clamp(24px, 3vw, 32px); line-height: 1.3; color: var(--ink); word-break: auto-phrase; }
.ep-title__accent { background: linear-gradient(transparent 66%, var(--wood-light) 66%); padding-inline: 2px; }
.ep-reading { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-muted); }
.ep-lead { margin: 12px 0 0; max-width: 46rem; font-size: 16px; line-height: 1.75; color: var(--ink); }
.ep-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 0; font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* 段（1〜5） */
.ep-section { padding-top: 20px; padding-bottom: 24px; scroll-margin-top: 24px; }
.ep-section + .ep-section { border-top: 1.5px solid var(--grid-line); }
.ep-h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-family: var(--font-head); font-weight: 900; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.3; color: var(--ink); }
.ep-num {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding-inline: 8px;
  border-radius: var(--r-pill); background: var(--wood-light); border: 1.5px solid var(--wood-edge);
  font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.ep-sub { margin: -4px 0 12px; font-size: 14px; color: var(--ink-muted); }

/* 1 ひとこと（読むだけ・静かな枠・影なし・左の木の帯） */
.ep-summary { background: var(--bg-card); border: 1.5px solid var(--rule-line); border-left: 6px solid var(--wood-edge); border-radius: var(--r-md); padding: 24px; }
.ep-summary__eyebrow {
  display: inline-flex; align-items: center; margin: 0 0 12px; padding: 2px 12px;
  background: var(--wood-light); border: 1.5px solid var(--wood-edge); border-radius: var(--r-pill);
  font-family: var(--font-head); font-size: 14px; font-weight: 700;
}
.ep-summary__lead { margin: 0; max-width: 46rem; font-size: clamp(17px, 2vw, 19px); font-weight: 700; line-height: 1.75; }
.ep-summary__sub { margin: 12px 0 0; max-width: 46rem; font-size: 16px; line-height: 1.75; }

/* 2 図と「さわって わかる」 */
.ep-visual { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: stretch; }
.ep-visual--single { grid-template-columns: minmax(0, 1fr); }
.ep-figure { margin: 0; display: flex; flex-direction: column; background: var(--bg-card); border: 1.5px solid var(--rule-line); border-radius: var(--r-md); padding: 16px; }
.ep-figure__stage {
  flex: 1; background-color: var(--bg-paper);
  background-image: linear-gradient(to right, rgba(227, 221, 204, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(227, 221, 204, 0.55) 1px, transparent 1px);
  background-size: 20px 20px; border: 1.5px solid var(--grid-line); border-radius: var(--r-sm); padding: 16px;
}
.ep-figure__tag {
  display: inline-flex; margin: 0 0 10px; padding: 2px 12px; background: var(--bg-quiet);
  border: 1.5px solid var(--rule-line); border-radius: var(--r-pill); font-family: var(--font-head); font-size: 14px; font-weight: 700;
}
.ep-figure__stage--art { padding: 8px; }
.ep-figure__svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.ep-figure__text { margin: 0; font-size: 16px; line-height: 1.8; }
.ep-sawaru-list { display: grid; gap: 16px; align-content: start; }
.ep-sawaru {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; color: var(--ink); text-decoration: none;
  background: var(--bg-card); border: 2px solid var(--ink); border-radius: var(--r-md); box-shadow: var(--shadow-md);
  transition: background-color 120ms ease, transform 90ms ease, box-shadow 90ms ease;
}
.ep-sawaru:hover { background: var(--wood-light); color: var(--ink); }
.ep-sawaru:active { transform: translateY(2px); box-shadow: var(--shadow-active); }
.ep-sawaru .ep-chips { margin: 0; }
.ep-sawaru__thumb { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1.5px solid var(--ink); border-radius: var(--r-sm); }
.ep-sawaru__title { font-family: var(--font-head); font-size: 20px; font-weight: 900; line-height: 1.35; }
.ep-sawaru__desc { font-size: 15px; line-height: 1.65; }
.ep-sawaru__note { padding: 8px 12px; background: var(--bg-quiet); border: 1.5px solid var(--grid-line); border-radius: var(--r-sm); font-size: 14px; line-height: 1.5; }
.ep-sawaru__go {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 16px;
  background: var(--wood); border: 2px solid var(--ink); border-radius: var(--r-sm);
  font-family: var(--font-head); font-size: 15px; font-weight: 700;
}
.ep-sawaru:hover .ep-sawaru__go { background: var(--wood-dark); }

/* 3 くわしく（長く読むので無地の白い箱・46rem） */
.ep-detail { background: var(--bg-card); border: 1.5px solid var(--rule-line); border-radius: var(--r-md); padding: 32px; }
.ep-prose { max-width: 46rem; }
.ep-prose > :first-child { margin-top: 0; }
.ep-prose h3 {
  margin: 32px 0 12px; padding-left: 14px; border-left: 4px solid var(--wood-edge);
  font-family: var(--font-head); font-size: 19px; font-weight: 900; line-height: 1.4; color: var(--ink);
}
.ep-prose p { margin: 0 0 16px; font-size: 16px; line-height: 1.8; }
.ep-prose ul { margin: 0 0 16px; padding-left: 1.4em; font-size: 16px; line-height: 1.8; }
.ep-prose li + li { margin-top: 6px; }
.ep-prose strong { font-weight: 700; background: linear-gradient(transparent 72%, var(--wood-light) 72%); padding-inline: 2px; }
/* 「もっと なぜ？」（深く 知りたい 人向け。読むだけの箱・左の木の帯・影なし） */
.ep-more { margin: 32px 0 0; padding: 16px 24px; background: var(--bg-quiet); border: 1.5px solid var(--rule-line); border-left: 5px solid var(--wood-edge); border-radius: var(--r-sm); }
.ep-prose .ep-more__title { margin: 0 0 12px; padding-left: 0; border-left: 0; font-size: 18px; }
.ep-more p:last-child, .ep-more ul:last-child { margin-bottom: 0; }

/* 4 関係する 単元（カードは manabi.css の .m-unit-card） */
.ep-section .m-units { margin-top: 4px; }

/* 5 出典と基準日（大人向け。無地・上に墨の罫） */
.ep-source { margin-top: 24px; padding: 32px 0; background: var(--bg-card); border-top: 2px solid var(--ink); border-bottom: 1.5px solid var(--grid-line); scroll-margin-top: 24px; }
.ep-source__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.ep-source__box { background: var(--bg-paper); border: 1.5px solid var(--rule-line); border-left: 5px solid var(--wood-edge); border-radius: var(--r-md); padding: 24px; }
.ep-source__title { margin: 0 0 12px; font-family: var(--font-head); font-size: 18px; font-weight: 900; }
.ep-source__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: 15px; line-height: 1.8; }
.ep-source__list li { padding-bottom: 14px; border-bottom: 1px solid var(--grid-line); }
.ep-source__list li:last-child { padding-bottom: 0; border-bottom: 0; }
.ep-source__list a { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; text-decoration-color: var(--rule-line); overflow-wrap: anywhere; }
.ep-source__list a:hover { background: var(--wood-light); text-decoration-color: var(--ink); }
.ep-source__note { display: block; margin-top: 2px; }
.ep-source__date { display: block; font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ep-source__dates { margin: 16px 0 0; font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* 前後の項目・棚の一覧へ */
.ep-pager { padding-top: 32px; padding-bottom: 64px; }
.ep-pager__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ep-pager__link {
  display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 44px; padding: 12px 16px; color: var(--ink); text-decoration: none;
  background: var(--bg-card); border: 2px solid var(--ink); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: background-color 120ms ease, transform 90ms ease, box-shadow 90ms ease;
}
.ep-pager__link:hover { background: var(--wood-light); color: var(--ink); }
.ep-pager__link:active { transform: translateY(2px); box-shadow: var(--shadow-active); }
.ep-pager__link--center { align-items: center; text-align: center; }
.ep-pager__dir { font-size: 14px; color: var(--ink-muted); }
.ep-pager__title { font-family: var(--font-head); font-size: 16px; font-weight: 700; }

/* 一覧（/pedia/）の項目のカード（押せるカード・墨 2px ＋ 影） */
.ep-section--first { border-top: 0; }
.ep-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ep-cards > li { display: flex; }
.ep-card {
  flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px; color: var(--ink); text-decoration: none;
  background: var(--bg-card); border: 2px solid var(--ink); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: background-color 120ms ease, transform 90ms ease, box-shadow 90ms ease;
}
.ep-card:hover { background: var(--wood-light); color: var(--ink); }
.ep-card:active { transform: translateY(2px); box-shadow: var(--shadow-active); }
.ep-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-tag { display: inline-flex; align-items: center; padding: 1px 10px; border: 1.5px solid var(--rule-line); border-radius: var(--r-pill); background: var(--bg-quiet); font-size: 14px; font-weight: 700; line-height: 1.4; }
.ep-tag--sawaru { background: var(--wood-light); border-color: var(--wood-edge); }
.ep-card__title { font-family: var(--font-head); font-size: 18px; font-weight: 900; line-height: 1.4; }
.ep-card__excerpt { flex: 1; font-size: 15px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ep-card__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--grid-line); font-size: 14px; color: var(--ink-muted); }
.ep-card__units { font-variant-numeric: tabular-nums; }
.ep-card__go { font-family: var(--font-head); font-weight: 700; color: var(--ink); }

/* 学年から たどる（読むだけの箱。スクリプトなしで たどれる索引） */
.ep-index { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 24px; background: var(--bg-card); border: 1.5px solid var(--rule-line); border-radius: var(--r-md); }
.ep-index__label { margin: 0 0 8px; font-family: var(--font-head); font-size: 16px; font-weight: 900; }
.ep-index__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ep-index__list a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule-line); }
.ep-index__list a:hover { text-decoration-color: var(--ink); }

@media (max-width: 1024px) {
  .ep-visual, .ep-source__grid { grid-template-columns: minmax(0, 1fr); }
  .ep-cards, .ep-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .ep-head { flex-direction: column; gap: 12px; }
  .ep-jump__list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; max-width: 100%; }
  .ep-jump__list::-webkit-scrollbar { display: none; }
  .ep-jump__chip { white-space: nowrap; }
  .ep-topbar nav { min-width: 0; max-width: 100%; }
  .ep-summary, .ep-detail, .ep-source__box, .ep-index { padding: 16px; }
  .ep-more { padding: 16px; }
  .ep-cards, .ep-index { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ep-jump__chip, .ep-sawaru, .ep-card, .ep-pager__link { transition: none; }
}
@media print {
  .ep-jump, .ep-pager { display: none !important; }
  .ep-sawaru, .ep-card, .ep-pager__link { box-shadow: none !important; }
  .ep-figure__stage { background-image: none; }
}

/* manabi.css の部品で 13px のもの（棚の札・カードの副題・QR の説明）を、ペディアのページだけ 14px にする
   （DESIGN.md の「文字は 14px 以上」。さわって わかるのページ・学校の棚と同じ直し方。manabi.css は他のページに効くので変えない） */
.ep-body .m-unit-card__shelf,
.ep-body .m-unit-card__title small,
.ep-body .m-qr__lead { font-size: 14px; }
