/*
 * article-style.css
 * mizumaru-apps.com 記事ページ共通スタイル
 * 対象：kiso / pachinko / slot / kyoshitsu / column 配下の記事ページ
 * 最終更新：2026-07-23（v2デザイン改修：資格教材・参考書の文法を参考に、
 *   lead-box/term-box/voice-box/formula-box/example-box/cta-box/related-cardを
 *   全面改修。既存ページ（kyoshitsu・column）は旧マークアップのままでも大きくは
 *   崩れないよう配慮しているが、新デザインの恩恵（タグ・番号バッジ等）を得るには
 *   本文HTML側の追記が必要。h2のchapter-head（章番号タブ）は完全な追加コンポー
 *   ネントのため、既存の<h2>単体使用には影響しない）
 *
 * 含まれるコンポーネント：
 *   リセット・ベース / ヘッダー / パンくず / 記事メタ情報 / カテゴリバッジ
 *   chapter-head（章番号タブ・新設） /
 *   lead-box / term-box / voice-box / formula-box / example-box /
 *   cta-box / reference-section / image-caption / disclaimer
 *   table（記事本文内の表） / chip（色チップ・color-seq）
 *   related-section / フッター
 */

/* ═══════════════════════════════════════
   0. Google Fonts
═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Serif+JP:wght@400;600;700&display=swap');

/* ═══════════════════════════════════════
   1. CSS カスタムプロパティ
═══════════════════════════════════════ */
:root {
  --bg:           #f5f7fa;
  --white:        #ffffff;
  --border:       #e2e8f0;
  --border2:      #cbd5e1;
  --accent:       #1a56db;
  --accent-light: #eff6ff;
  --text:         #1e293b;
  --muted:        #64748b;
  --muted2:       #94a3b8;
  --header-bg:    #0f2057;

  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);

  --font-sans:    'Noto Sans JP', sans-serif;
  --font-serif:   'Noto Serif JP', serif;
}

/* ═══════════════════════════════════════
   2. リセット・ベース
═══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  font-size: 15px;
}

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

img { max-width: 100%; height: auto; }

.image-caption {
  font-size: 11px;
  color: var(--muted2);
  text-align: center;
  margin: 8px 0 20px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════
   3. ヘッダー
═══════════════════════════════════════ */
.article-header {
  background: var(--header-bg);
  padding: 0;
}
.article-header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 32px;
}

/* ═══════════════════════════════════════
   4. パンくずリスト
═══════════════════════════════════════ */
.breadcrumb {
  font-size: 11px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.breadcrumb a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}
.breadcrumb a:hover { color: rgba(255,255,255,0.85); }
.breadcrumb .sep {
  color: rgba(255,255,255,0.25);
  margin: 0 2px;
}
.breadcrumb .current {
  color: rgba(255,255,255,0.85);
}

/* ═══════════════════════════════════════
   5. カテゴリバッジ・記事メタ情報
═══════════════════════════════════════ */
.category-badge {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  font-size: 10px;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.45;
  margin-bottom: 16px;
}

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}
.meta-row time { letter-spacing: 0.5px; }
.meta-author { letter-spacing: 0.3px; }

/* ═══════════════════════════════════════
   6. 記事本文エリア
═══════════════════════════════════════ */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* 見出し */
.article-body h2 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--header-bg);
  margin: 52px 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border2);
  line-height: 1.45;
}
.article-body h2:first-child { margin-top: 0; }

/* 章番号タブ付き見出し（新設・オプション）
   使い方：<div class="chapter-head"><span class="chapter-num">第1章</span><h2 class="chapter-title">見出し</h2></div>
   通常の <h2>見出し</h2> 単体で使う場合は、上のh2ルールがそのまま適用され、
   このコンポーネントを使わなくても問題なく表示される（後方互換） */
.chapter-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 52px 0 18px;
}
.chapter-head:first-child { margin-top: 0; }
.chapter-num {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--header-bg);
  padding: 5px 12px 5px 10px;
  letter-spacing: 1px;
  flex-shrink: 0;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
}
.chapter-head .chapter-title,
.article-body .chapter-head h2.chapter-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--header-bg);
  line-height: 1.45;
  border-bottom: 2px solid var(--border2);
  padding-bottom: 10px;
  margin: 0;
  flex: 1;
}

.article-body h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}

.article-body h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 8px;
}

/* 本文テキスト */
.article-body p {
  margin-bottom: 16px;
  color: #374151;
  line-height: 1.9;
}

.article-body ul,
.article-body ol {
  padding-left: 22px;
  margin-bottom: 16px;
}
.article-body li {
  margin-bottom: 6px;
  color: #374151;
  line-height: 1.85;
}

/* 表（対局のターン一覧など） */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 13px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.article-body th,
.article-body td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.5;
}
.article-body th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.article-body td:first-child,
.article-body th:first-child {
  text-align: center;
  white-space: nowrap;
}
.article-body tbody tr:last-child td { border-bottom: none; }
.article-body tbody tr:nth-child(even) { background: #fafbfc; }

/* 表を横スクロール可能なラッパーで囲む場合用（任意） */
.table-scroll {
  overflow-x: auto;
  margin: 20px 0 28px;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table { margin: 0; min-width: 520px; }

/* 色チップ（回答の色並びを視覚的に見せる） */
.color-seq {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}
.chip.c-red    { background:#fee2e2; color:#dc2626; }
.chip.c-blue   { background:#dbeafe; color:#2563eb; }
.chip.c-green  { background:#dcfce7; color:#16a34a; }
.chip.c-yellow { background:#fef9c3; color:#ca8a04; }
.chip.c-pink   { background:#fce7f3; color:#db2777; }
.chip.c-white  { background:#f8fafc; color:#64748b; border-color: var(--border2); }

/* ═══════════════════════════════════════
   7. lead-box（結論ファースト）
═══════════════════════════════════════ */
.lead-box {
  position: relative;
  background: var(--white);
  border: none;
  border-top: 3px solid var(--header-bg);
  border-bottom: 1px solid var(--border2);
  border-radius: 0;
  padding: 26px 22px 20px;
  margin: 0 0 36px;
  font-size: 14.5px;
  line-height: 1.95;
  color: #1e293b;
}
.lead-box .lead-tag {
  position: absolute;
  top: -14px;
  left: 20px;
  display: inline-block;
  background: var(--header-bg);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 5px 16px;
  margin-bottom: 0;
}

/* ═══════════════════════════════════════
   8. term-box（専門用語の定義）
═══════════════════════════════════════ */
.term-box {
  background: none;
  border: none;
  border-top: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
  border-radius: 0;
  padding: 16px 4px;
  margin: 20px 0;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--muted);
}
.term-box .term-label {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 14px;
}
.term-box dt {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.term-box dt::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.term-box dd {
  margin-left: 0;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  margin-bottom: 12px;
}
.term-box dd:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════
   9. voice-box（運営者の見解・コメント）
═══════════════════════════════════════ */
.voice-box {
  position: relative;
  background: #fffaf0;
  border: 1px solid #f0dcb0;
  border-left: none;
  border-radius: 0;
  padding: 20px 20px 18px 22px;
  margin: 24px 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: #5c4111;
}
.voice-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 16px 16px 0 0;
  border-color: #d9a441 transparent transparent transparent;
}
.voice-box .voice-label {
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #a5670f;
  margin-bottom: 8px;
  display: block;
}
.voice-box p { margin: 0 0 12px; }
.voice-box p:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════
   10. formula-box（数式・計算式）
═══════════════════════════════════════ */
.formula-box {
  position: relative;
  background:
    linear-gradient(var(--white), var(--white)),
    repeating-linear-gradient(0deg, #eef2fb 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, #eef2fb 0 1px, transparent 1px 22px);
  border: 1px solid #d6e4fb;
  border-left: none;
  border-radius: 0;
  padding: 24px 22px 20px;
  margin: 24px 0;
}
.formula-box .formula-label {
  position: absolute;
  top: -13px;
  left: 30px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 6px 22px;
  margin-bottom: 0;
  display: inline-block;
}
.formula-box .formula-content {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 15.5px;
  color: #0f2057;
  line-height: 2.1;
  letter-spacing: 0.2px;
  white-space: pre-wrap;
}
.formula-box .formula-content strong {
  font-weight: 700;
  color: var(--accent);
}
.formula-box .formula-note {
  font-size: 12px;
  color: #64748b;
  margin-top: 14px;
  line-height: 1.7;
}

/* ═══════════════════════════════════════
   11. example-box（具体例）
═══════════════════════════════════════ */
/* 使い方：
   <div class="example-box">
     <div class="example-num">1</div>
     <div class="example-content">
       <span class="example-label">モデル</span>（「例題」「ケース」「具体例」等に差し替え可）
       <p>本文</p>
     </div>
   </div>
*/
.example-box {
  display: flex;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border2);
  border-left: none;
  border-radius: 4px;
  padding: 18px 20px;
  margin: 24px 0;
}
.example-box .example-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: var(--header-bg);
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.example-box .example-content p {
  font-size: 13.5px;
  color: #374151;
  margin: 0;
  line-height: 1.85;
}
/* 安全策：旧仕様（.example-num/.example-contentのラッパーなしで<p>を直接入れる形）で
   使われていた場合、flexの横並びで崩れないよう縦積みにフォールバックする */
.example-box:not(:has(.example-num)) {
  display: block;
}
.example-box:not(:has(.example-num)) p {
  margin: 0 0 10px;
}
.example-box:not(:has(.example-num)) p:last-child {
  margin-bottom: 0;
}
.example-box .example-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted2);
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════
   12. cta-box（アプリ等への誘導・行動喚起）
═══════════════════════════════════════ */
/* 使い方：
   <div class="cta-box">
     <span class="cta-arrow">→</span>
     <span class="cta-text"><strong>ラベル</strong>本文＋<a href="...">リンク</a></span>
   </div>
*/
.cta-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--header-bg);
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 18px 22px;
  margin: 36px 0;
  font-size: 13.5px;
  line-height: 1.9;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 3% 100%);
}
.cta-box .cta-arrow {
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  color: #93c5fd;
}
.cta-box .cta-text strong {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  color: #93c5fd;
  margin-bottom: 4px;
}
.cta-box a {
  font-weight: 700;
  color: #fff;
  text-decoration: underline;
}
/* 安全策：旧仕様（.cta-arrowのラッパーなしで<strong>+<br>+<a>+テキストを直接入れる形）で
   使われていた場合、flexの横並びで崩れないよう縦積み（従来のブロック表示）にフォールバックする */
.cta-box:not(:has(.cta-arrow)) {
  display: block;
}

/* ═══════════════════════════════════════
   13. reference-section（参考資料）
═══════════════════════════════════════ */
.reference-section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.reference-section h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 12px;
  /* h2共通スタイルの上書き防止 */
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 0;
}
.reference-section ul {
  padding-left: 18px;
  margin-bottom: 0;
}
.reference-section li {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.8;
}

/* ═══════════════════════════════════════
   14. disclaimer（免責・注意事項）
═══════════════════════════════════════ */
.disclaimer {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin: 32px 0 0;
  font-size: 11.5px;
  color: var(--muted2);
  line-height: 1.8;
}

/* ═══════════════════════════════════════
   15. related-section（関連記事）
═══════════════════════════════════════ */
.related-section {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 2px solid var(--border2);
}
.related-section h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 16px;
  /* h2共通スタイルの上書き防止 */
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 0;
}
/* 使い方：
   <div class="related-section">
     <div class="related-list">
       <a class="related-card" href="...">
         <span class="related-card-arrow">→</span>
         <span class="related-card-cat">カテゴリ名</span>
         <span class="related-card-title">記事タイトル</span>
       </a>
     </div>
   </div>
*/
.related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.related-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 0;
  background: var(--header-bg);
  border-radius: 0;
  padding: 14px 20px;
  text-decoration: none !important;
  box-shadow: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 2.5% 100%);
  transition: filter .15s;
}
.related-card:hover {
  filter: brightness(1.15);
  box-shadow: none;
  transform: none;
}
.related-card-arrow {
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  color: #93c5fd;
}
.related-card-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  margin-bottom: 0;
}
.related-card-cat {
  position: static;
  top: auto;
  left: auto;
  display: inline-block;
  background: #ffffff;
  color: #0284c7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 3px;
  box-shadow: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.related-card-excerpt {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.75;
}

/* ═══════════════════════════════════════
   16. フッター
═══════════════════════════════════════ */
.article-footer {
  background: var(--header-bg);
  padding: 24px 20px;
  text-align: center;
}
.article-footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.article-footer-link {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  letter-spacing: 0.5px;
}
.article-footer-link:hover { color: rgba(255,255,255,0.85); }
.article-footer-copy {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════
   17. レスポンシブ
═══════════════════════════════════════ */
@media (max-width: 600px) {
  .article-header-inner { padding: 20px 16px 24px; }
  .article-body { padding: 28px 16px 60px; }
  .article-body h2 { font-size: 17px; }
  .formula-box { padding: 16px; }
  .formula-box .formula-content { font-size: 13px; }
}
