/* ==========================================
   AIジャーナル 記事装飾CSS (aij-art-*)
   ========================================== */

:root {
  --aij-brand: #0066ff;
  --aij-brand-dark: #004fcc;
  --aij-ink: #0e1317;
  --aij-ink-2: #2b343c;
  --aij-muted: #6b7783;
  --aij-line: #e4e8ee;
  --aij-line-2: #f0f2f6;
  --aij-red: #e02b2b;
  --aij-amber: #f59e0b;
  --aij-green: #059669;
  --aij-purple: #7c3aed;
}

/* 1. リード文 */
.aij-art-lead {
  font-size: 16px;
  line-height: 1.85;
  color: var(--aij-ink-2);
  padding: 20px 24px;
  border-left: 4px solid var(--aij-brand);
  background: linear-gradient(90deg, rgba(0, 102, 255, 0.04), transparent);
  margin: 20px 0;
  font-weight: 500;
}
.aij-art-lead strong { color: var(--aij-brand); font-weight: 700; }

/* 2. コールアウト */
/* 2. コールアウト（v4 完全最終版） */
.aij-art-callout {
  border: 1px solid var(--aij-line) !important;
  border-left: 4px solid var(--aij-brand) !important;
  border-radius: 6px !important;
  padding: 18px 22px !important;
  margin: 18px 0 !important;
  background: #fafbfc !important;
  display: block !important;
}

/* ラベル：ブロック要素化で確実に改行 */
.aij-art-callout .label {
  display: block !important;
  width: fit-content !important;
  max-width: fit-content !important;
  font-family: "JetBrains Mono", "Roboto Mono", monospace !important;
  font-size: 10px !important;
  letter-spacing: 0.15em !important;
  font-weight: 700 !important;
  padding: 4px 11px !important;
  border-radius: 3px !important;
  background: var(--aij-brand) !important;
  color: #fff !important;
  margin: 0 0 12px 0 !important;
  line-height: 1.4 !important;
  float: none !important;
}

/* コールアウト内のテキスト */
.aij-art-callout p {
  font-size: 14px !important;
  color: var(--aij-ink-2) !important;
  line-height: 1.8 !important;
  margin: 0 !important;
  display: block !important;
}

.aij-art-callout > p + p {
  margin-top: 10px !important;
}

/* strong などのインライン要素はインラインのまま */
.aij-art-callout strong,
.aij-art-callout em,
.aij-art-callout a,
.aij-art-callout span:not(.label) {
  display: inline !important;
}

/* SWELLの.post_content :first-child 対策 */
.aij-art-callout :first-child {
  margin-top: 0 !important;
}

/* カラーバリエーション */
.aij-art-callout.info {
  border-left-color: var(--aij-brand) !important;
  background: #f0f9ff !important;
}
.aij-art-callout.info .label { background: var(--aij-brand) !important; }

.aij-art-callout.tip {
  border-left-color: var(--aij-green) !important;
  background: #f0fdf5 !important;
}
.aij-art-callout.tip .label { background: var(--aij-green) !important; }

.aij-art-callout.warn {
  border-left-color: var(--aij-amber) !important;
  background: #fffaf0 !important;
}
.aij-art-callout.warn .label { background: var(--aij-amber) !important; }

.aij-art-callout.danger {
  border-left-color: var(--aij-red) !important;
  background: #fef5f5 !important;
}
.aij-art-callout.danger .label { background: var(--aij-red) !important; }

.aij-art-callout.note {
  border-left-color: var(--aij-purple) !important;
  background: #faf5ff !important;
}
.aij-art-callout.note .label { background: var(--aij-purple) !important; }


/* 3. ステップブロック */
.aij-art-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--aij-line);
  border-radius: 6px;
  margin: 12px 0;
  align-items: start;
}
.aij-art-step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--aij-ink);
  color: #fff;
  border-radius: 6px;
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 3px solid var(--aij-brand);
  letter-spacing: -0.02em;
}
.aij-art-step .body .step-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.aij-art-step .body p {
  font-size: 14px;
  color: var(--aij-ink-2);
  margin: 0;
  line-height: 1.8;
}

/* 4. チェックリスト */
.aij-art-checklist {
  list-style: none;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--aij-line);
  border-radius: 6px;
  margin: 14px 0;
}
.aij-art-checklist li {
  position: relative;
  padding: 10px 0 10px 32px;
  font-size: 14px;
  border-bottom: 1px dashed var(--aij-line-2);
}
.aij-art-checklist li:last-child { border-bottom: none; }
.aij-art-checklist li::before {
  content: "☐";
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--aij-brand);
  font-size: 20px;
  font-weight: 700;
}
.aij-art-checklist li.checked::before {
  content: "☑";
  color: var(--aij-green);
}
.aij-art-checklist li strong { color: var(--aij-ink); }

/* 5. コードブロック */
.aij-art-code {
  background: #0e1317;
  color: #e4e8ee;
  border-radius: 6px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid #1c232a;
}
.aij-art-code .bar {
  background: #1c232a;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 10px;
  color: #6b7783;
  letter-spacing: 0.05em;
}
.aij-art-code .bar .dots { display: flex; gap: 5px; }
.aij-art-code .bar .dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}
.aij-art-code .bar .dots span:nth-child(2) { background: #febc2e; }
.aij-art-code .bar .dots span:nth-child(3) { background: #28c840; }
.aij-art-code .bar .title { margin-left: 8px; }
.aij-art-code pre {
  padding: 16px 20px;
  margin: 0;
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #e4e8ee;
  white-space: pre-wrap;
  background: transparent !important;
  border: none !important;
}
.aij-art-code .prompt { color: #10b981; margin-right: 6px; }
.aij-art-code .comment { color: #6b7783; }
.aij-art-code .str { color: #7ad28a; }

/* 6. スペックテーブル */
.aij-art-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--aij-line);
}
.aij-art-table th {
  background: var(--aij-ink);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.03em;
  border-bottom: 3px solid var(--aij-brand);
}
.aij-art-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--aij-line);
  vertical-align: top;
}
.aij-art-table tr:nth-child(even) td { background: #fafbfc; }
.aij-art-table tr:hover td { background: #f0f9ff; }
.aij-art-table td.mono {
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  color: var(--aij-brand);
  font-weight: 600;
}
.aij-art-table .tag-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.aij-art-table .tag-pill.good { background: var(--aij-green); color: #fff; }
.aij-art-table .tag-pill.ok { background: var(--aij-amber); color: #fff; }
.aij-art-table .tag-pill.bad { background: var(--aij-red); color: #fff; }

/* 7. 引用 */
.aij-art-quote {
  padding: 24px 28px;
  background: #fff;
  border: 1px solid var(--aij-line);
  border-left: 6px solid var(--aij-ink);
  border-radius: 0 6px 6px 0;
  margin: 18px 0;
  font-style: normal;
  position: relative;
}
.aij-art-quote::before {
  content: "\201C";
  position: absolute;
  top: 0;
  left: 14px;
  font-size: 60px;
  color: var(--aij-line);
  line-height: 1;
  font-family: Georgia, serif;
}
.aij-art-quote p {
  margin: 0 0 0 40px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--aij-ink-2);
}
.aij-art-quote footer {
  margin: 10px 0 0 40px;
  font-size: 11px;
  color: var(--aij-muted);
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  letter-spacing: 0.05em;
}

/* 8. セクション区切り */
.aij-art-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0 20px;
}
.aij-art-divider .num {
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  background: var(--aij-brand);
  border-radius: 3px;
}
.aij-art-divider .title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--aij-ink);
}
.aij-art-divider .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--aij-brand) 0%, var(--aij-line) 80%, transparent);
}

/* 9. 記事内CTA */
.aij-art-cta {
  background: linear-gradient(135deg, #0066ff 0%, #7c3aed 100%);
  color: #fff;
  padding: 28px 32px;
  border-radius: 8px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}
.aij-art-cta::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.2), transparent 60%);
  border-radius: 50%;
}
.aij-art-cta .kicker {
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  opacity: 0.9;
  margin-bottom: 8px;
  position: relative;
}
.aij-art-cta h4 {
  font-size: 20px;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  position: relative;
  color: #fff;
}
.aij-art-cta p {
  font-size: 13px;
  opacity: 0.92;
  margin-bottom: 14px;
  position: relative;
}
.aij-art-cta .btn {
  display: inline-block;
  background: #fff;
  color: var(--aij-brand);
  padding: 10px 24px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  position: relative;
}
.aij-art-cta .btn:hover {
  background: #f0f9ff;
}

/* レスポンシブ（スマホ） */
@media (max-width: 768px) {
  .aij-art-step {
    grid-template-columns: 44px 1fr;
    gap: 14px;
    padding: 16px 18px;
  }
  .aij-art-step .num {
    width: 44px;
    height: 44px;
    font-size: 13px;
  }
  .aij-art-divider .title { font-size: 17px; }
  .aij-art-cta { padding: 22px 24px; }
  .aij-art-cta h4 { font-size: 17px; }
  .aij-art-table { font-size: 12px; }
  .aij-art-table th, .aij-art-table td { padding: 10px 12px; }
}