/*
 * rich-content.css — 補助金図鑑 投稿本文スタイル
 *
 * スコープ : .gi-rich-content (single-grant.php / single-column.php)
 * 準拠     : WCAG 2.1 AA（コントラスト比 ≥4.5:1、フォーカス可視、タッチ44px）
 * 対象要素 : 17,000 投稿内のすべての HTML パターン
 *
 * 目次
 *   1.  トークン（CSS カスタムプロパティ）
 *   2.  タイポグラフィ基盤（h2–h4, p, ul/ol, a, strong, blockquote）
 *   3.  テーブル（レスポンシブ対応）
 *   4.  定義リスト（dl / dt / dd）
 *   5.  セクションコンテナ（.grant-target 等）
 *   6.  サマリーボックス（.gi-summary-box & 無クラス div）
 *   7.  FAQ アコーディオン（details / summary）
 *   8.  申請ステップ（ol.gi-steps / ul.gi-steps）
 *   9.  コールアウト（.gi-callout バリアント）
 *  10.  グリッド / スタットカード（.gi-grid / .gi-stat）
 *  11.  インラインマーカー（.gi-marker, .gi-badge-inline）
 *  12.  AI 生成画像（.gi-ai-generated-image）
 *  13.  フォーカス & アクセシビリティ共通
 *  14.  モバイルレスポンシブ
 */

/* ===========================================================
 * 1. トークン
 * =========================================================== */
.gi-rich-content {
  --rc-navy:       #0F1B3D;
  --rc-navy-2:     #192952;
  --rc-primary:    #1244B8; /* #1A56DB より暗くして small text でも AA */
  --rc-amber:      #92400E;
  --rc-amber-bg:   #FFFBEB;
  --rc-amber-bd:   #D97706;
  --rc-green:      #065F46;
  --rc-green-bg:   #ECFDF5;
  --rc-green-bd:   #059669;
  --rc-red:        #991B1B;
  --rc-red-bg:     #FEF2F2;
  --rc-red-bd:     #DC2626;
  --rc-blue-bg:    #EFF6FF;
  --rc-blue-bd:    #3B82F6;
  --rc-text:       #1F2937;
  --rc-text-2:     #374151;
  --rc-muted:      #4B5563;
  --rc-border:     #E5E7EB;
  --rc-border-2:   #D1D5DB;
  --rc-bg-alt:     #F8F9FB;
  --rc-radius:     6px;
  --rc-radius-lg:  10px;
  --rc-space:      1.25em;
}

/* ===========================================================
 * 2. タイポグラフィ基盤
 * =========================================================== */
.gi-rich-content {
  color: var(--rc-text);
  font-size: 15px;
  line-height: 1.85;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 要素間の縦マージン */
.gi-rich-content > * + * { margin-top: var(--rc-space); }

/* 見出し */
.gi-rich-content h2 {
  font-size: 1.35em; /* ~20px */
  font-weight: 700;
  color: var(--rc-navy);
  line-height: 1.45;
  margin-top: 2em;
  margin-bottom: .5em;
  padding-bottom: .35em;
  border-bottom: 2px solid var(--rc-border);
}
.gi-rich-content h3 {
  font-size: 1.15em; /* ~17px */
  font-weight: 700;
  color: var(--rc-navy);
  line-height: 1.5;
  margin-top: 1.75em;
  margin-bottom: .4em;
  padding-left: .75em;
  border-left: 4px solid var(--rc-navy);
}
.gi-rich-content h4 {
  font-size: 1.0em; /* 15px */
  font-weight: 700;
  color: var(--rc-navy);
  line-height: 1.5;
  margin-top: 1.5em;
  margin-bottom: .35em;
}

/* 段落 */
.gi-rich-content p { margin: 0 0 .85em; }
.gi-rich-content p:last-child { margin-bottom: 0; }

/* リスト */
.gi-rich-content ul,
.gi-rich-content ol {
  margin: .6em 0 1em 1.5em;
  padding: 0;
}
.gi-rich-content ul  { list-style-type: disc; }
.gi-rich-content ol  { list-style-type: decimal; }
.gi-rich-content li  { margin: .3em 0; line-height: 1.75; }
.gi-rich-content li + li { margin-top: .25em; }

/* リンク（色と下線で二重識別 → WCAG 1.4.1） */
.gi-rich-content a {
  color: var(--rc-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s, text-decoration-color .15s;
}
.gi-rich-content a:hover {
  color: var(--rc-navy);
  text-decoration-color: currentColor;
}

/* インライン強調 */
.gi-rich-content strong,
.gi-rich-content b { font-weight: 700; color: var(--rc-navy); }
.gi-rich-content em { font-style: italic; }

/* 引用 */
.gi-rich-content blockquote {
  margin: 1.2em 0;
  padding: .85em 1.2em;
  border-left: 4px solid var(--rc-border-2);
  background: var(--rc-bg-alt);
  color: var(--rc-muted);
  border-radius: 0 var(--rc-radius) var(--rc-radius) 0;
  font-size: .95em;
}
.gi-rich-content blockquote > :last-child { margin-bottom: 0; }

/* 小見出し text */
.gi-rich-content small { font-size: .85em; color: var(--rc-muted); }

/* ===========================================================
 * 3. テーブル
 * =========================================================== */

/* スクロールラッパー（横幅超過時） */
.gi-rich-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93em;
  line-height: 1.6;
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-lg);
  overflow: hidden;
  background: #fff;
}

/* 親 div に overflow を付与（js 非依存） */
.gi-rich-content div:is(:not([class]),[class=""]):has(> table) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--rc-radius-lg);
  border: 1px solid var(--rc-border);
  margin: .8em 0 1em;
}
.gi-rich-content div:is(:not([class]),[class=""]):has(> table) table {
  border: none;
  border-radius: 0;
  margin: 0;
}

.gi-rich-content th,
.gi-rich-content td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rc-border);
  vertical-align: top;
}
.gi-rich-content th {
  background: var(--rc-bg-alt);
  color: var(--rc-navy);
  font-weight: 600;
  white-space: nowrap;
  border-right: 1px solid var(--rc-border);
}
.gi-rich-content tr:last-child th,
.gi-rich-content tr:last-child td { border-bottom: none; }
.gi-rich-content tbody tr:hover { background: #F5F7FF; }

/* ===========================================================
 * 4. 定義リスト
 * =========================================================== */
.gi-rich-content dl {
  margin: .8em 0 1em;
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 0;
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-lg);
  overflow: hidden;
  font-size: .93em;
}
.gi-rich-content dt {
  background: var(--rc-bg-alt);
  color: var(--rc-navy);
  font-weight: 600;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rc-border);
  border-right: 1px solid var(--rc-border);
}
.gi-rich-content dd {
  padding: 9px 14px;
  border-bottom: 1px solid var(--rc-border);
  color: var(--rc-text);
  margin: 0;
}
.gi-rich-content dt:last-of-type,
.gi-rich-content dd:last-of-type { border-bottom: none; }

/* ===========================================================
 * 5. セクションコンテナ
 *    .grant-target / .required-documents-detailed /
 *    .eligible-expenses-detailed / .post-content
 * =========================================================== */

/* 共通ベース */
.gi-rich-content .grant-target,
.gi-rich-content .required-documents-detailed,
.gi-rich-content .eligible-expenses-detailed {
  position: relative;
  margin: 1.25em 0;
  padding: 16px 18px 16px 22px;
  border: 1px solid var(--rc-border);
  border-left-width: 4px;
  border-radius: 0 var(--rc-radius-lg) var(--rc-radius-lg) 0;
  background: #fff;
  overflow: hidden;
}
.gi-rich-content .grant-target h3,
.gi-rich-content .required-documents-detailed h3,
.gi-rich-content .eligible-expenses-detailed h3 {
  font-size: 1em;
  font-weight: 700;
  margin: 0 0 .5em;
  padding: 0;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: .4em;
}
.gi-rich-content .grant-target h3::before,
.gi-rich-content .required-documents-detailed h3::before,
.gi-rich-content .eligible-expenses-detailed h3::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* 色分け: 対象者（ネイビー） */
.gi-rich-content .grant-target {
  border-left-color: var(--rc-navy);
  background: #F8FAFF;
}
.gi-rich-content .grant-target h3 { color: var(--rc-navy); }
.gi-rich-content .grant-target h3::before {
  /* person icon (inline SVG data URI) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F1B3D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

/* 色分け: 必要書類（アンバー） */
.gi-rich-content .required-documents-detailed {
  border-left-color: var(--rc-amber-bd);
  background: var(--rc-amber-bg);
}
.gi-rich-content .required-documents-detailed h3 { color: var(--rc-amber); }
.gi-rich-content .required-documents-detailed h3::before {
  /* document icon */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2392400E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E");
}

/* 色分け: 対象経費（グリーン） */
.gi-rich-content .eligible-expenses-detailed {
  border-left-color: var(--rc-green-bd);
  background: var(--rc-green-bg);
}
.gi-rich-content .eligible-expenses-detailed h3 { color: var(--rc-green); }
.gi-rich-content .eligible-expenses-detailed h3::before {
  /* check-circle icon */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
}

/* .post-content ラッパー: 特別スタイルなし、内部要素へ inherit */
.gi-rich-content .post-content { /* pass-through wrapper */ }

/* ===========================================================
 * 6. サマリーボックス
 *    クラスあり: .gi-summary-box
 *    無クラス div > p × 2 パターン: ハイライトボックスとして扱う
 * =========================================================== */
/* .gi-summary-box + 無クラス div > p:first + p:2nd パターン（後続の空 p を無視） */
.gi-rich-content .gi-summary-box,
.gi-rich-content div:is(:not([class]),[class=""]):has(> p:first-child + p):not(:has(table)):not(:has(ul)):not(:has(ol)):not(:has(.gdc-paragraph)) {
  padding: 14px 18px;
  background: var(--rc-bg-alt);
  border: 1px solid var(--rc-border);
  border-left: 4px solid var(--rc-blue-bd);
  border-radius: 0 var(--rc-radius-lg) var(--rc-radius-lg) 0;
  margin: 1em 0;
}
/* ラベル */
.gi-rich-content .gi-summary-box > p:first-child,
.gi-rich-content div:is(:not([class]),[class=""]):has(> p:first-child + p):not(:has(table)):not(:has(ul)):not(:has(ol)):not(:has(.gdc-paragraph)) > p:first-child {
  font-size: .8em;
  font-weight: 700;
  color: var(--rc-primary);
  letter-spacing: .03em;
  margin: 0 0 3px;
  border-left: none;
}
/* 値 */
.gi-rich-content .gi-summary-box > p:first-child + p,
.gi-rich-content div:is(:not([class]),[class=""]):has(> p:first-child + p):not(:has(table)):not(:has(ul)):not(:has(ol)):not(:has(.gdc-paragraph)) > p:first-child + p {
  font-size: 1.25em;
  font-weight: 800;
  color: var(--rc-navy);
  line-height: 1.3;
  margin: 0;
}

/* ===========================================================
 * 7. FAQ アコーディオン（details / summary）
 * =========================================================== */
.gi-rich-content details {
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-lg);
  overflow: hidden;
  margin: .5em 0;
  background: #fff;
  transition: box-shadow .2s;
}
.gi-rich-content details + details { margin-top: -1px; border-radius: 0; }
.gi-rich-content details:first-of-type { border-radius: var(--rc-radius-lg) var(--rc-radius-lg) 0 0; }
.gi-rich-content details:last-of-type  { border-radius: 0 0 var(--rc-radius-lg) var(--rc-radius-lg); }
.gi-rich-content details:only-of-type  { border-radius: var(--rc-radius-lg); }

.gi-rich-content details[open] {
  box-shadow: 0 2px 8px rgba(15,27,61,.08);
  position: relative;
  z-index: 1;
  border-radius: var(--rc-radius-lg) !important;
}
.gi-rich-content details[open] + details { border-radius: 0 0 0 0; }

/* summary: クリッカブル行 */
.gi-rich-content summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  background: #fff;
  user-select: none;
  position: relative;
  padding-right: 40px; /* 矢印スペース */
}
.gi-rich-content summary::-webkit-details-marker { display: none; }

/* 矢印（右端） */
.gi-rich-content summary::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.gi-rich-content details[open] > summary::after {
  transform: translateY(-50%) rotate(180deg);
}

/* Q バッジ（summary 内の最初の span） */
.gi-rich-content summary > span:first-child:not(:only-child) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  background: var(--rc-navy);
  color: #fff; /* contrast ~16:1 ✅ */
  font-size: .8em;
  font-weight: 700;
  border-radius: var(--rc-radius);
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: .03em;
}

/* 質問テキスト */
.gi-rich-content summary > span:last-child:not(:first-child),
.gi-rich-content summary > span:only-child {
  font-size: .97em;
  font-weight: 600;
  color: var(--rc-text);
  line-height: 1.55;
  flex: 1;
}

/* 回答エリア */
.gi-rich-content details > div,
.gi-rich-content details > p {
  padding: 0 16px 14px 52px; /* Q バッジ幅に合わせてインデント */
  font-size: .95em;
  color: var(--rc-text-2);
  line-height: 1.8;
  border-top: 1px solid var(--rc-border);
  background: var(--rc-bg-alt);
}
.gi-rich-content details > div > :last-child,
.gi-rich-content details > p:last-child { margin-bottom: 0; }

/* ===========================================================
 * 8. 申請ステップ（ol.gi-steps / ul.gi-steps）
 * =========================================================== */
.gi-rich-content ol.gi-steps,
.gi-rich-content ul.gi-steps {
  list-style: none;
  margin: 1em 0;
  padding: 0;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gi-rich-content ol.gi-steps > li,
.gi-rich-content ul.gi-steps > li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 14px;
  position: relative;
  padding-bottom: 20px;
  margin: 0;
  counter-increment: step-counter;
}

/* 縦のコネクティングライン */
.gi-rich-content ol.gi-steps > li:not(:last-child)::before,
.gi-rich-content ul.gi-steps > li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--rc-border-2);
}

/* 番号バッジ */
.gi-rich-content ol.gi-steps > li::after,
.gi-rich-content ul.gi-steps > li::after {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--rc-navy);
  color: #fff; /* contrast ✅ */
  font-weight: 700;
  font-size: .9em;
  border-radius: 50%;
  flex-shrink: 0;
  position: absolute;
  left: 0;
  top: 0;
  grid-row: 1;
  grid-column: 1;
  z-index: 1;
}

/* ul.gi-steps: 番号なしは • にフォールバック */
.gi-rich-content ul.gi-steps > li::after {
  content: '•';
  font-size: 1.2em;
  background: var(--rc-border-2);
  color: var(--rc-navy);
}

/* ステップ本文（右カラム） */
.gi-rich-content ol.gi-steps > li > *,
.gi-rich-content ul.gi-steps > li > * {
  grid-column: 2;
  padding-top: 8px;
}
.gi-rich-content ol.gi-steps > li > strong:first-child,
.gi-rich-content ul.gi-steps > li > span:first-child {
  display: block;
  font-weight: 700;
  color: var(--rc-navy);
  font-size: .97em;
  line-height: 1.5;
}

/* .gi-steps-container ラッパー */
.gi-rich-content .gi-steps-container {
  background: var(--rc-bg-alt);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-lg);
  padding: 20px 20px 4px;
  margin: 1em 0;
}

/* ===========================================================
 * 9. コールアウト（.gi-callout バリアント）
 * =========================================================== */
.gi-rich-content .gi-callout {
  display: flex;
  flex-direction: column;
  gap: .6em;
  padding: 16px 18px;
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-lg);
  margin: 1.1em 0;
  background: var(--rc-bg-alt);
  border-left: 4px solid var(--rc-border-2);
}
.gi-rich-content .gi-callout .gi-callout__title {
  font-size: 1em;
  font-weight: 700;
  color: var(--rc-navy);
  margin: 0;
  padding: 0;
  border: none;
}
.gi-rich-content .gi-callout p,
.gi-rich-content .gi-callout li { font-size: .97em; color: var(--rc-text-2); }

/* バリアント */
.gi-rich-content .gi-callout--info  { border-left-color: var(--rc-blue-bd);  background: var(--rc-blue-bg); }
.gi-rich-content .gi-callout--warn  { border-left-color: var(--rc-amber-bd); background: var(--rc-amber-bg); }
.gi-rich-content .gi-callout--caution { border-left-color: var(--rc-amber-bd); background: var(--rc-amber-bg); }
.gi-rich-content .gi-callout--tip   { border-left-color: var(--rc-green-bd); background: var(--rc-green-bg); }
.gi-rich-content .gi-callout--error { border-left-color: var(--rc-red-bd);   background: var(--rc-red-bg); }

.gi-rich-content .gi-callout--info  .gi-callout__title { color: #1244B8; }
.gi-rich-content .gi-callout--warn  .gi-callout__title,
.gi-rich-content .gi-callout--caution .gi-callout__title { color: var(--rc-amber); }
.gi-rich-content .gi-callout--tip   .gi-callout__title { color: var(--rc-green); }
.gi-rich-content .gi-callout--error .gi-callout__title { color: var(--rc-red); }

/* ===========================================================
 * 10. グリッド / スタットカード（.gi-grid / .gi-stat）
 * =========================================================== */
.gi-rich-content .gi-grid {
  display: grid;
  gap: 12px;
  margin: 1em 0;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.gi-rich-content .gi-grid--2 { grid-template-columns: repeat(2, 1fr); }
.gi-rich-content .gi-grid--3 { grid-template-columns: repeat(3, 1fr); }
.gi-rich-content .gi-grid--4 { grid-template-columns: repeat(4, 1fr); }

.gi-rich-content .gi-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 12px;
  background: #fff;
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-lg);
  text-align: center;
  min-height: 88px;
}
.gi-rich-content .gi-stat__num {
  display: block;
  font-size: 1.5em;
  font-weight: 800;
  color: var(--rc-navy);
  line-height: 1.2;
  word-break: keep-all;
}
.gi-rich-content .gi-stat__label {
  display: block;
  font-size: .8em;
  color: var(--rc-muted);
  line-height: 1.4;
}

/* ===========================================================
 * 11. インラインマーカー
 * =========================================================== */
.gi-rich-content .gi-marker {
  background: linear-gradient(transparent 50%, #FEF08A 50%);
  padding: 0 .1em;
  border-radius: 2px;
  /* #FEF08A on white ≈ 1.1:1 (背景は装飾、テキストは親の色を継承) */
}
.gi-rich-content .gi-badge-inline {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .8em;
  font-weight: 700;
  background: var(--rc-bg-alt);
  color: var(--rc-navy);
  border: 1px solid var(--rc-border-2);
  vertical-align: middle;
  margin: 0 2px;
}

/* ===========================================================
 * 12. AI 生成画像
 * =========================================================== */
.gi-rich-content .gi-ai-generated-image,
.gi-rich-content figure.gi-ai-generated-image {
  display: block;
  margin: 1.2em auto;
  border-radius: var(--rc-radius-lg);
  overflow: hidden;
  max-width: 100%;
  border: 1px solid var(--rc-border);
}
.gi-rich-content .gi-ai-generated-image img,
.gi-rich-content figure.gi-ai-generated-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===========================================================
 * 13. フォーカス & アクセシビリティ共通
 *     WCAG 2.1 2.4.11 Focus Appearance (AA)
 * =========================================================== */
.gi-rich-content :focus-visible {
  outline: 2px solid #1244B8;
  outline-offset: 2px;
  border-radius: 2px;
}

/* details/summary: タッチターゲット min 44px */
.gi-rich-content summary {
  min-height: 44px;
}

/* スキップリンク等は上位 CSS に委ねる */

/* ===========================================================
 * 14. モバイルレスポンシブ（≤ 767px）
 * =========================================================== */
@media (max-width: 767px) {
  .gi-rich-content { font-size: 14.5px; }

  .gi-rich-content h2 { font-size: 1.2em; margin-top: 1.6em; }
  .gi-rich-content h3 { font-size: 1.08em; margin-top: 1.4em; }

  /* テーブル: th を左に、td を右に縦並び */
  .gi-rich-content table th { width: 120px; }

  /* dl: 縦並び */
  .gi-rich-content dl {
    grid-template-columns: 1fr;
  }
  .gi-rich-content dt { border-right: none; }
  .gi-rich-content dd { border-top: 1px solid var(--rc-border); padding-top: 6px; }
  .gi-rich-content dt { padding-bottom: 4px; }

  /* FAQ: padding 調整 */
  .gi-rich-content details > div,
  .gi-rich-content details > p { padding-left: 16px; }

  /* グリッド: 2 列 → 1-2 列 */
  .gi-rich-content .gi-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .gi-rich-content .gi-grid--3 { grid-template-columns: repeat(2, 1fr); }

  /* ステップ: バッジを小さく */
  .gi-rich-content ol.gi-steps > li,
  .gi-rich-content ul.gi-steps > li {
    grid-template-columns: 34px 1fr;
    gap: 0 10px;
  }
  .gi-rich-content ol.gi-steps > li::after,
  .gi-rich-content ul.gi-steps > li::after {
    width: 34px;
    height: 34px;
    font-size: .8em;
  }
  .gi-rich-content ol.gi-steps > li:not(:last-child)::before,
  .gi-rich-content ul.gi-steps > li:not(:last-child)::before {
    left: 16px;
    top: 34px;
  }

  /* サマリーボックス: グリッド解除不要（display:block はデフォルト） */
}

@media (max-width: 480px) {
  .gi-rich-content .gi-grid--2 { grid-template-columns: 1fr; }
}

/* ===========================================================
 * 15. gdc-* クラス（コンテンツ生成システム固有）
 *     見出し / 段落 / テーブル / リスト / リンク / 強調 / 画像
 *     通常の HTML 要素セレクタに加えてクラス別に上書き
 * =========================================================== */

/* 見出し: level 別の装飾は h2/h3/h4 基底スタイルに委ねる */
.gi-rich-content .gdc-heading { display: block; }
.gi-rich-content .gdc-heading--h2 { font-size: 1.35em; font-weight: 700; color: var(--rc-navy); line-height: 1.45; margin-top: 2em; margin-bottom: .5em; padding-bottom: .35em; border-bottom: 2px solid var(--rc-border); }
.gi-rich-content .gdc-heading--h3 { font-size: 1.15em; font-weight: 700; color: var(--rc-navy); line-height: 1.5; margin-top: 1.75em; margin-bottom: .4em; padding-left: .75em; border-left: 4px solid var(--rc-navy); }
.gi-rich-content .gdc-heading--h4 { font-size: 1.0em; font-weight: 700; color: var(--rc-navy); margin-top: 1.5em; margin-bottom: .35em; }

/* 段落: 基底スタイルで十分だが、lead だけ少し大きく */
.gi-rich-content .gdc-paragraph { margin: 0 0 .85em; }
.gi-rich-content .gdc-paragraph--lead { font-size: 1.05em; font-weight: 500; color: var(--rc-text); line-height: 1.8; }

/* テーブル: gdc クラスで包まれていても同一スタイル */
.gi-rich-content .gdc-table { width: 100%; }
.gi-rich-content .gdc-table--striped tbody tr:nth-child(even) { background: var(--rc-bg-alt); }
.gi-rich-content .gdc-table--with-header thead th { background: var(--rc-navy); color: #fff; font-weight: 700; }

/* リスト */
.gi-rich-content .gdc-list { }
.gi-rich-content .gdc-list--unordered { list-style-type: disc; }

/* 強調・リンク */
.gi-rich-content .gdc-strong { font-weight: 700; color: var(--rc-navy); }
.gi-rich-content .gdc-link { color: var(--rc-primary); text-decoration: underline; text-underline-offset: 3px; }

/* 画像 */
.gi-rich-content .gdc-image { display: block; max-width: 100%; height: auto; border-radius: var(--rc-radius-lg); margin: 1em auto; }
.gi-rich-content .gdc-image--responsive { width: 100%; }

/* ===========================================================
 * 16. gdc-paragraph--short ペア: ラベル + 値 のサマリーボックス
 *     構造: div[class=""] > p.gdc-paragraph--short × 2
 *     (div:is() セレクターでキャッチ済みだが念のため明示指定)
 * =========================================================== */

/* ラベル行（first-child） — ":last-child" は不要（後続に空 p が存在するケースに対応） */
.gi-rich-content div:is(:not([class]),[class=""])
  > .gdc-paragraph.gdc-paragraph--short:first-child {
  font-size: .8em;
  font-weight: 700;
  color: var(--rc-primary);
  letter-spacing: .03em;
  margin: 0 0 2px;
}

/* 値行（ラベルの直後の .gdc-paragraph--short） */
.gi-rich-content div:is(:not([class]),[class=""])
  > .gdc-paragraph--short:first-child + .gdc-paragraph--short {
  font-size: 1.25em;
  font-weight: 800;
  color: var(--rc-navy);
  line-height: 1.3;
  margin: 0;
}

/* 親 div のカード枠（直後兄弟パターンで判定: :last-child 不要） */
.gi-rich-content div:is(:not([class]),[class=""]):has(
  > .gdc-paragraph--short:first-child + .gdc-paragraph--short
):not(:has(table)):not(:has(ul)):not(:has(ol)) {
  padding: 14px 18px;
  background: var(--rc-bg-alt);
  border: 1px solid var(--rc-border);
  border-left: 4px solid var(--rc-blue-bd);
  border-radius: 0 var(--rc-radius-lg) var(--rc-radius-lg) 0;
  margin: 1em 0;
}
