/* ============================================================
   緊急特集「RAG × Jev」— Corpus2Skill + Jev ハイブリッド探索
   親サイト styles.css の上に読み込む特集専用スタイル
   テーマ: 深いインディゴの夜 × 警告アンバー（緊急特集）× エメラルド（ナビゲート）
   ============================================================ */

:root {
  --fx-night: #0f0d2e;
  --fx-night-2: #1b1850;
  --fx-amber: #f59e0b;
  --fx-amber-soft: #fef3c7;
  --fx-amber-ink: #92400e;
  --fx-code-bg: #14122f;
  --fx-code-ink: #e7e5ff;
}

/* 見出しの折り返し（短い行残り対策） */
.fx-hero h1,
.fx-article h2,
.fx-article h3,
.fx-article h4,
.fx-card h3,
.fx-series-title,
.fx-callout-title,
.fx-code-title,
.fx-summary-title,
.fx-promo-title {
  text-wrap: balance;
  word-break: auto-phrase;
  line-break: strict;
  overflow-wrap: break-word;
}

img { height: auto; }

/* ---------- 緊急特集バー ---------- */
.fx-alert-bar {
  background: repeating-linear-gradient(-45deg, var(--fx-amber) 0 14px, #fbbf24 14px 28px);
  color: var(--fx-night);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0.35rem 1rem;
}
.fx-alert-bar span {
  background: var(--fx-night);
  color: var(--fx-amber);
  padding: 0.1rem 0.6rem;
  border-radius: 3px;
  margin-right: 0.5rem;
}

/* ---------- ヒーロー ---------- */
.fx-hero {
  position: relative;
  color: #fff;
  background-color: var(--fx-night);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.fx-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(15, 13, 46, 0.96) 0%, rgba(15, 13, 46, 0.86) 45%, rgba(27, 24, 80, 0.45) 100%);
  pointer-events: none;
}
.fx-hero-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.2rem 1.2rem 2.8rem;
}
.fx-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--fx-amber);
  margin-bottom: 1rem;
}
.fx-kicker .fx-badge {
  background: var(--fx-amber);
  color: var(--fx-night);
  padding: 0.18rem 0.6rem;
  border-radius: 3px;
  letter-spacing: 0.06em;
}
.fx-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.8rem);
  font-weight: 900;
  line-height: 1.45;
  max-width: 820px;
  margin: 0 0 1rem;
  color: #fff;
}
.fx-hero h1 em {
  font-style: normal;
  color: var(--fx-amber);
}
.fx-hero-lead {
  max-width: 760px;
  font-size: 1.02rem;
  line-height: 1.9;
  color: #dcdaf8;
  margin: 0 0 1.4rem;
}
.fx-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  font-size: 0.85rem;
  color: #b9b6ec;
}
.fx-hero-meta strong { color: #fff; }

/* 章の進捗トラッカー */
.fx-progress {
  display: flex;
  gap: 0.4rem;
  margin-top: 1.6rem;
  max-width: 620px;
  list-style: none;
  padding: 0;
}
.fx-progress li {
  flex: 1;
  margin: 0;
}
.fx-progress a {
  display: block;
  text-decoration: none;
  color: #b9b6ec;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding-top: 0.45rem;
  border-top: 4px solid rgba(255, 255, 255, 0.22);
}
.fx-progress a:hover { color: #fff; }
.fx-progress li.is-done a { border-top-color: var(--emerald-600); color: #d1fae5; }
.fx-progress li.is-current a { border-top-color: var(--fx-amber); color: var(--fx-amber); }

/* ---------- 本文 ---------- */
.fx-article {
  font-size: 1rem;
  line-height: 1.95;
}
.fx-article .article-eyecatch { margin-bottom: 1.8rem; }
.fx-article h2 {
  border-left-color: var(--fx-amber);
}
.fx-article h2::before {
  content: "■ ";
  color: var(--fx-amber);
}
.fx-article a { color: var(--indigo-700); }

.fx-summary {
  background: var(--fx-night);
  color: #e7e5ff;
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem 1.1rem;
  margin: 0 0 2.2rem;
  border-top: 4px solid var(--fx-amber);
}
.fx-summary-title {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--fx-amber);
  margin-bottom: 0.5rem;
}
.fx-summary ul { margin: 0; padding-left: 1.2rem; }
.fx-summary li { margin-bottom: 0.4rem; }
.fx-summary strong { color: #fff; background: none; }

/* 数値タイル */
.fx-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin: 1.6rem 0 2rem;
}
.fx-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.9rem;
  border-bottom: 4px solid var(--emerald-600);
}
.fx-stat.is-warn { border-bottom-color: var(--fx-amber); }
.fx-stat-num {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 900;
  white-space: nowrap;
  color: var(--indigo-900);
  line-height: 1.2;
}
.fx-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 0.3rem;
}

/* コールアウト */
.fx-callout {
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.6rem 0;
  border: 1px solid var(--indigo-200);
  background: var(--indigo-50);
}
.fx-callout.is-warn {
  border-color: #fcd34d;
  background: var(--fx-amber-soft);
}
.fx-callout.is-ok {
  border-color: #a7f3d0;
  background: var(--emerald-50);
}
.fx-callout-title {
  font-weight: 700;
  color: var(--indigo-900);
  margin-bottom: 0.4rem;
}
.fx-callout.is-warn .fx-callout-title { color: var(--fx-amber-ink); }
.fx-callout p:last-child,
.fx-callout ul:last-child { margin-bottom: 0; }

/* 図 */
.fx-figure {
  margin: 2rem 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1rem 0.9rem;
}
.fx-figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 760px;
  margin: 0 auto;
}
.fx-figure figcaption {
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.7rem;
  line-height: 1.6;
}

/* 表 */
.fx-table-wrap {
  overflow-x: auto;
  margin: 1.6rem 0 2rem;
  -webkit-overflow-scrolling: touch;
}
.fx-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
}
.fx-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  color: var(--indigo-900);
  padding-bottom: 0.5rem;
}
.fx-table th,
.fx-table td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  vertical-align: top;
  text-align: left;
  line-height: 1.7;
}
.fx-table thead th {
  background: var(--fx-night);
  color: #fff;
}
.fx-table tbody th {
  background: var(--paper-2);
  color: var(--indigo-950);
  white-space: nowrap;
}
.fx-table .is-hl { background: var(--emerald-50); font-weight: 700; }

/* コード */
.fx-code {
  margin: 1.4rem 0 1.8rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--fx-code-bg);
  box-shadow: var(--shadow-sm);
}
.fx-code-title {
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--fx-amber);
  background: #0b0a22;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #2a2760;
}
.fx-code pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  color: var(--fx-code-ink);
  font-size: 0.82rem;
  line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}
.fx-code code { background: none; color: inherit; padding: 0; }
.fx-code .c { color: #8b88c9; }
.fx-code .k { color: #93c5fd; }
.fx-code .s { color: #86efac; }
.fx-article :not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--indigo-50);
  color: var(--indigo-900);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
}

/* 出典 */
.fx-sources {
  margin: 2.6rem 0 1.4rem;
  padding: 1.2rem 1.4rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.88rem;
}
.fx-sources h2 {
  font-size: 1.1rem;
  margin: 0 0 0.7rem;
  border: none;
  padding: 0;
}
.fx-sources h2::before { content: ""; }
.fx-sources ol { margin: 0; padding-left: 1.3rem; }
.fx-sources li { margin-bottom: 0.4rem; line-height: 1.7; word-break: break-word; }

/* 前後ナビ */
.fx-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin: 2.4rem 0 1rem;
}
.fx-pager a {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.9rem 1.1rem;
  color: var(--indigo-900);
  font-weight: 700;
  line-height: 1.6;
}
.fx-pager a small {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
}
.fx-pager a.is-next { text-align: right; border-color: var(--fx-amber); }
.fx-pager a:hover { box-shadow: var(--shadow-md); }

/* サイドバー：特集の章立て */
.fx-series {
  background: var(--fx-night);
  color: #e7e5ff;
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 0.8rem;
  margin-bottom: 1.4rem;
}
.fx-series-title {
  font-family: var(--serif);
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}
.fx-series-sub {
  font-size: 0.74rem;
  color: var(--fx-amber);
  letter-spacing: 0.1em;
  margin-bottom: 0.7rem;
}
.fx-series ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: fx;
}
.fx-series li {
  counter-increment: fx;
  border-top: 1px solid #2f2b6e;
}
.fx-series li a {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.4rem;
  padding: 0.6rem 0;
  color: #d4d2f6;
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.55;
}
.fx-series li a::before {
  content: counter(fx, decimal-leading-zero);
  font-family: var(--serif);
  font-weight: 900;
  color: #6f6bc0;
}
.fx-series li.is-current a { color: #fff; font-weight: 700; }
.fx-series li.is-current a::before { color: var(--fx-amber); }
.fx-series li a:hover { color: #fff; }
.fx-series li.fx-series-top { counter-increment: none; }
.fx-series li.fx-series-top a::before { content: "◆"; }

/* ---------- 特集トップ：章カード ---------- */
.fx-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  margin: 1.6rem 0 2.2rem;
}
.fx-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.fx-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.fx-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.fx-card-body { padding: 0.95rem 1.1rem 1.1rem; flex: 1; display: flex; flex-direction: column; }
.fx-card-no {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--fx-amber-ink);
}
.fx-card h3 {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--indigo-950);
  margin: 0.3rem 0 0.5rem;
  padding: 0;
}
.fx-card h3::before { display: none; }
.fx-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.75; margin: 0 0 0.8rem; flex: 1; }
.fx-card a.fx-card-link {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--indigo-700);
  text-decoration: none;
}
.fx-card a.fx-card-link::after { content: " →"; }

/* ---------- TOPページ用 特集プロモ ---------- */
.fx-promo {
  max-width: 1180px;
  margin: 2rem auto 0;
  padding: 0 1.2rem;
}
.fx-promo-link {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  background: var(--fx-night);
  color: #fff;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--fx-amber);
  transition: transform 0.2s;
}
.fx-promo-link:hover { transform: translateY(-2px); }
.fx-promo-text { padding: 1.6rem 1.8rem; }
.fx-promo-kicker {
  display: inline-block;
  background: var(--fx-amber);
  color: var(--fx-night);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.7rem;
  border-radius: 3px;
  margin-bottom: 0.8rem;
}
.fx-promo-title {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 900;
  line-height: 1.5;
  margin: 0 0 0.7rem;
  color: #fff;
}
.fx-promo-title em { font-style: normal; color: var(--fx-amber); }
.fx-promo-desc { color: #d4d2f6; font-size: 0.93rem; line-height: 1.85; margin: 0 0 1rem; }
.fx-promo-cta {
  display: inline-block;
  background: var(--fx-amber);
  color: var(--fx-night);
  font-weight: 700;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
}
.fx-promo-img { background-size: cover; background-position: center; min-height: 220px; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 960px) {
  .fx-promo-link { grid-template-columns: 1fr; }
  .fx-promo-img { min-height: 180px; order: -1; }
}
@media (max-width: 600px) {
  .fx-hero-inner { padding: 2.2rem 1rem 2rem; }
  .fx-progress a { font-size: 0.62rem; }
  .fx-pager { grid-template-columns: 1fr; }
  .fx-pager a.is-next { text-align: left; }
  .fx-promo-text { padding: 1.2rem 1.1rem; }
  .fx-figure { padding: 0.8rem 0.5rem 0.7rem; }
  .fx-code pre { font-size: 0.76rem; }
  .fx-stat-num { font-size: 1.2rem; }
}
