/* ==========================================================================
   DE:ZIGN 記事パーツ共通CSS（2026-11〜 Claude が書く記事用）
   - 記事専用CSS（<slug>.css）がない記事でだけ読み込まれる。既存記事には効かない。
   - 色は記事ごとに CSS 変数で渡す（フロントマターの accent / accent_light、
     なければカテゴリの既定色）。<article class="article-body parts" style="--accent:…">
   - 使い方とHTMLの見本は docs/writing-guide.md の「部品」の章。
   ========================================================================== */

.article-body.parts {
  --accent: #2563eb;
  --accent-light: #93c5fd;
  --accent-soft: color-mix(in srgb, var(--accent) 7%, #fff);
  --accent-ink: color-mix(in srgb, var(--accent) 78%, #000);
  --code-bg: #1a1a2e;
}

/* 日本語の見出しを単語の途中で折り返さない（旧CSSの break-all を打ち消す） */
.article-body.parts h1,
.article-body.parts h2,
.article-body.parts h3,
.article-body.parts .article-title {
  word-break: normal !important;
  line-break: strict !important;
  overflow-wrap: anywhere !important;
}
@supports (word-break: auto-phrase) {
  .article-body.parts h1,
  .article-body.parts h2,
  .article-body.parts h3,
  .article-body.parts .article-title { word-break: auto-phrase !important; }
}

/* ---------- ヒーロー ---------- */
.article-body.parts .article-hero { padding: 80px 24px 60px; max-width: 850px; margin: 0 auto; }
.article-body.parts .article-tag { display: inline-block; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 2px; padding: 4px 14px; border-radius: 20px; margin-bottom: 24px; text-transform: uppercase; }
.article-body.parts .article-title { font-size: clamp(28px, 4.6vw, 46px); font-weight: 900; line-height: 1.25; letter-spacing: -0.5px; margin-bottom: 20px; }
.article-body.parts .article-title .highlight { color: var(--accent); }
.article-body.parts .article-lead { font-size: 18px; color: #555; line-height: 1.85; margin-bottom: 32px; }
.article-body.parts .article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: #666; padding-top: 24px; border-top: 1px solid #e8e8e8; }
.article-body.parts .meta-author { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #0e0e0e; }
.article-body.parts .avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-light)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }

/* ---------- 本文 ---------- */
.article-body.parts .section { margin-bottom: 72px; }
.article-body.parts h2 { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; margin: 0 0 20px; padding: 0 0 0 16px; border: 0; border-left: 4px solid var(--accent); line-height: 1.35; color: #0e0e0e; }
.article-body.parts h3 { font-size: 19px; font-weight: 700; margin: 36px 0 14px; color: #2a2a2a; }
.article-body.parts p { margin-bottom: 20px; color: #333; line-height: 1.9; }
.article-body.parts p:last-child { margin-bottom: 0; }
.article-body.parts a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.article-body.parts strong { font-weight: 700; color: #111; }
.article-body.parts .section ul:not([class]),
.article-body.parts .section ol:not([class]) { margin: 0 0 20px; padding-left: 1.5em; color: #333; line-height: 1.85; }
.article-body.parts .section ul:not([class]) { list-style: disc; }
.article-body.parts .section ol:not([class]) { list-style: decimal; }
.article-body.parts .section li + li { margin-top: 6px; }
.article-body.parts .note { font-size: 13px; color: #888; }

/* ---------- インラインコード・コードブロック ---------- */
.article-body.parts .inline-code { background: var(--code-bg); color: var(--accent-light); font-family: 'JetBrains Mono', monospace; font-size: 13px; padding: 2px 8px; border-radius: 4px; word-break: break-all; }
.article-body.parts .code-block { background: var(--code-bg); border: 0; border-radius: 12px; overflow: hidden; margin: 28px 0; }
.article-body.parts .code-label { background: rgba(255,255,255,0.08); padding: 8px 16px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #94a3b8; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.article-body.parts .code-block pre { padding: 20px; overflow-x: auto; font-family: 'JetBrains Mono', monospace; font-size: 13.5px; line-height: 1.7; color: #e2e8f0; margin: 0; background: transparent; white-space: pre; word-break: normal; }
.article-body.parts .code-block .tag { color: #7dd3fc; }
.article-body.parts .code-block .attr { color: #86efac; }
.article-body.parts .code-block .val { color: #fca5a5; }
.article-body.parts .code-block .prop { color: #c4b5fd; }
.article-body.parts .code-block .num { color: #fde68a; }
.article-body.parts .code-block .cm { color: #64748b; font-style: italic; }
.article-body.parts .code-block .var { color: #a78bfa; }
.article-body.parts .code-block .fn { color: #fdba74; }
.article-body.parts .bad { color: #f87171; font-weight: 700; }
.article-body.parts .good { color: #4ade80; font-weight: 700; }

/* ---------- ライブデモ ---------- */
.article-body.parts .demo-area { background: var(--accent-soft); border: 2px dashed var(--accent-light); border-radius: 12px; padding: 32px 24px 24px; margin: 28px 0; position: relative; word-break: normal !important; }
.article-body.parts .demo-label { display: inline-block; background: var(--accent); color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 4px 12px; border-radius: 6px; margin-bottom: 20px; }

/* ---------- コールアウト（.is-warn 注意 / .is-tip 経験則 / 無印 ポイント） ---------- */
.article-body.parts .callout { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; padding: 20px 24px; margin: 28px 0; font-size: 15px; line-height: 1.85; word-break: normal !important; }
.article-body.parts .callout-label { font-weight: 700; color: var(--accent); font-size: 12px; letter-spacing: 1.5px; margin-bottom: 6px; }
.article-body.parts .callout.is-warn { background: #fff7ed; border-left-color: #ea580c; }
.article-body.parts .callout.is-warn .callout-label { color: #c2410c; }
.article-body.parts .callout.is-tip { background: #f0fdf4; border-left-color: #16a34a; }
.article-body.parts .callout.is-tip .callout-label { color: #15803d; }

/* ---------- 運営者のメモ（実体験の引用。運営者のメモがあるときだけ使う） ---------- */
.article-body.parts .owner-note { border: 1px solid #e5e7eb; border-radius: 12px; padding: 18px 22px; margin: 28px 0; background: #fafafa; font-size: 15px; line-height: 1.85; }
.article-body.parts .owner-note-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: #6b7280; margin-bottom: 6px; }

/* ---------- 表 ---------- */
.article-body.parts .table-wrap { overflow-x: auto; margin: 28px 0 8px; border: 1px solid #eee; border-radius: 12px; }
.article-body.parts .data-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.article-body.parts .table-wrap .data-table { min-width: 640px; }
.article-body.parts .data-table th,
.article-body.parts .data-table td { padding: 12px 14px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
.article-body.parts .data-table thead th { background: var(--code-bg); color: #fff; font-size: 12px; letter-spacing: 1px; white-space: nowrap; }
.article-body.parts .data-table tbody th { white-space: nowrap; font-weight: 700; color: #0e0e0e; }
.article-body.parts .data-table tbody tr:nth-child(even) { background: var(--accent-soft); }
.article-body.parts .data-table .note { display: block; font-size: 12px; margin-top: 4px; }
.article-body.parts .table-caption { font-size: 12px; color: #888; margin: 0 0 28px; }

/* ---------- ファイル構成 ---------- */
.article-body.parts .tree { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px 20px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.8; color: #334155; white-space: pre; overflow-x: auto; margin: 24px 0; word-break: normal !important; }

/* ---------- 手順（番号付きのステップ） ---------- */
.article-body.parts .steps { list-style: none; counter-reset: step; margin: 28px 0; padding: 0; }
.article-body.parts .steps > li { counter-increment: step; position: relative; padding: 0 0 20px 48px; line-height: 1.85; color: #333; }
.article-body.parts .steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.article-body.parts .steps > li strong { display: block; margin-bottom: 2px; }

/* ---------- 向いている人／向いていない人 ---------- */
.article-body.parts .fit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 28px 0; }
.article-body.parts .fit-card { border-radius: 12px; padding: 18px 20px; font-size: 15px; line-height: 1.8; }
.article-body.parts .fit-card h4 { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.article-body.parts .fit-card ul { margin: 0; padding-left: 1.2em; list-style: disc; }
.article-body.parts .fit-card.is-yes { background: #f0fdf4; border: 1px solid #bbf7d0; }
.article-body.parts .fit-card.is-yes h4 { color: #15803d; }
.article-body.parts .fit-card.is-no { background: #fef2f2; border: 1px solid #fecaca; }
.article-body.parts .fit-card.is-no h4 { color: #b91c1c; }

/* ---------- まとめ ---------- */
.article-body.parts .summary-box { background: #0e0e0e; color: #fff; border-radius: 16px; padding: 36px; margin-top: 64px; word-break: normal !important; }
.article-body.parts .summary-box h2 { border-left-color: var(--accent); color: #fff; margin-bottom: 24px; }
.article-body.parts .summary-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 20px 0 0; padding: 0; }
.article-body.parts .summary-list li { display: flex; gap: 12px; align-items: flex-start; color: #e2e8f0; font-size: 15px; line-height: 1.7; }
.article-body.parts .summary-list li::before { content: '✓'; color: var(--accent-light); font-weight: 700; flex-shrink: 0; margin-top: 2px; }

/* ---------- 参考・出典 ---------- */
.article-body.parts .sources { margin-top: 48px; padding-top: 28px; border-top: 1px solid #e5e7eb; }
.article-body.parts .sources h2 { font-size: 18px; border-left-width: 3px; margin-bottom: 14px; }
.article-body.parts .source-list { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.7; color: #555; }
.article-body.parts .source-list li { padding: 6px 0 6px 18px; position: relative; border-bottom: 1px dashed #eee; }
.article-body.parts .source-list li::before { content: '↗'; position: absolute; left: 0; color: var(--accent); font-size: 12px; top: 8px; }
.article-body.parts .source-list .checked { color: #999; font-size: 12px; white-space: nowrap; }
.article-body.parts .sources-note { font-size: 12px; color: #999; margin-top: 12px; }

@media (max-width: 768px) {
  .article-body.parts h2 { font-size: 22px; }
  .article-body.parts .summary-box { padding: 26px 22px; }
  .article-body.parts .code-block pre { font-size: 12.5px; }
}
