/* =========================================================
   Chillarin Blog - article.css
   記事ページ専用スタイル (Claude Design 移植 / D-3a)
   tokens.css の :root / :root.light に依存
   ========================================================= */

/* ===== Article root ===== */
.article {
  --warn: oklch(0.76 0.15 45);
  font-family: var(--font-sans);
  line-height: 1.8;
  font-feature-settings: "palt" 1;
  color: var(--text);
}

/* ===== Hero (Variant B) ===== */
.a-hero {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  isolation: isolate;
}

.a-hero-bg {
  position: absolute;
  inset: -60px;
  background-size: cover;
  background-position: center;
  filter: blur(64px) brightness(.55) saturate(1.25);
  transform: scale(1.15);
  z-index: 0;
}

/* ライトモード: 背景の blur 画像はほぼ消し、カバーを右の本物だけで見せる
   (トップ hero-dark と同じく、黒字が読みやすい明るいグラデ背景に揃える) */
:root.light .a-hero-bg {
  opacity: 0;
}

/* ライトモード: hero 本体に明るいグラデを敷いて黒字が読める背景を作る */
:root.light .a-hero {
  background: linear-gradient(135deg, var(--bg-elev) 0, var(--bg-card) 45%, var(--bg) 100%);
}

.a-hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 45%, var(--bg) 100%),
    linear-gradient(90deg,
      var(--bg) 0, transparent 30%, transparent 70%, var(--bg) 100%),
    radial-gradient(ellipse at 72% 35%, var(--accent-soft), transparent 60%);
}

:root.light .a-hero-scrim {
  background:
    linear-gradient(180deg, transparent 55%, var(--bg) 100%),
    radial-gradient(ellipse at 72% 35%, var(--accent-soft), transparent 65%) !important;
}

.a-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 32px 64px;
  display: grid;
  grid-template-columns: 1fr 560px;
  gap: 48px;
  align-items: center;
}

.a-hero-copy { max-width: 640px; }

/* ライトモードはトップ (hero-dark) に揃えて黒字統一 */
:root.light .a-hero-copy { color: var(--text); }
:root.light .a-hero-copy .a-subtitle { color: var(--text-dim); }
:root.light .a-hero-copy .a-metabar { color: var(--muted); }
:root.light .a-hero-copy .a-metabar .a-dot { background: var(--muted); }

.a-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.a-kicker::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--accent);
}

/* ライトモード: トップ kicker と同じく落ち着いた色味 (text-shadow なし) */
:root.light .a-kicker,
:root.light .a-metabar .a-cat {
  color: var(--accent) !important;
  text-shadow: none;
}

:root.light .a-kicker::before {
  background: var(--accent);
}

.a-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  margin: 0 0 18px;
  text-wrap: balance;
}

/* ライトモード: タイトルもトップに合わせて黒字 (text-shadow なし) */
:root.light .a-title {
  color: var(--text) !important;
  text-shadow: none;
}

.a-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0 0 24px;
  max-width: 560px;
  text-wrap: pretty;
}

.a-metabar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--muted);
}

.a-metabar .a-cat {
  color: var(--accent);
  font-weight: 500;
}

.a-metabar .a-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .6;
}

.a-hero-cover {
  position: relative;
  width: 560px;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .05) inset;
  justify-self: end;
}

.a-hero-mascot {
  position: absolute;
  bottom: -36px;
  width: 48px;
  height: 48px;
  background: url('/images/chinchilla-logo.png') center / contain no-repeat;
  filter:
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 8px var(--accent-glow));
  pointer-events: none;
}
.a-hero-mascot--right { right: -56px; }
.a-hero-mascot--left {
  left: -56px;
  transform: scaleX(-1);
}

.a-hero-chip {
  position: absolute;
  left: 32px;
  bottom: 22px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .12em;
  color: var(--muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 2px;
}

:root.light .a-hero-chip {
  color: var(--muted);
  background: var(--bg-elev);
  border-color: var(--border);
  backdrop-filter: none;
}

:root.light .a-hero-cover {
  border-color: var(--border);
  box-shadow:
    0 12px 32px rgba(11, 17, 22, .14),
    0 0 0 1px rgba(11, 17, 22, .04) inset;
}

.a-hero-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ===== Hero --lite (cover 無しのシンプル版、members 等で使用) ===== */
.a-hero--lite {
  min-height: auto;
  border-bottom: 1px solid var(--border);
}
.a-hero--lite .a-hero-scrim {
  background:
    linear-gradient(180deg, transparent 40%, var(--bg) 100%),
    radial-gradient(ellipse at 50% 40%, var(--accent-soft), transparent 60%);
}
:root.light .a-hero--lite .a-hero-scrim {
  background:
    linear-gradient(180deg, transparent 50%, var(--bg) 100%),
    radial-gradient(ellipse at 50% 40%, var(--accent-soft), transparent 65%) !important;
}
.a-hero-inner--lite {
  grid-template-columns: 1fr;
  padding: 72px 32px 56px;
  align-items: flex-start;
}
.a-hero--lite .a-hero-copy { max-width: 760px; }
.a-hero--lite .a-title {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
}

/* lite のうち cover 画像が解決できたもの:
   トップの hero-dark と揃え「左テキスト+右画像」の 2 カラム構成。
   cover はやや大きめ＆左寄せ気味で配置する (テキスト幅を絞って画像を前に出す)。
   画像は HTML 側で --cover-dark / --cover-light を CSS 変数で渡し、ここで mode 別に切替。 */
.a-hero--lite-cover { min-height: 420px; }
.a-hero--lite-cover .a-hero-inner--lite {
  grid-template-columns: minmax(0, 1fr) 560px;
  align-items: center;
  gap: 40px;
}
.a-hero--lite-cover .a-hero-copy { max-width: 520px; }
.a-hero--lite-cover .a-hero-cover {
  width: 560px;
  aspect-ratio: 16 / 9;
  justify-self: start;
  background-image: var(--cover-dark);
}
:root.light .a-hero--lite-cover .a-hero-cover {
  background-image: var(--cover-light);
}
.a-hero--lite-cover .a-hero-mascot { display: none; }
/* cover 付き lite の scrim は右寄りグラデで cover に光を寄せる */
.a-hero--lite-cover .a-hero-scrim {
  background:
    linear-gradient(180deg, transparent 50%, var(--bg) 100%),
    radial-gradient(ellipse at 72% 40%, var(--accent-soft), transparent 60%);
}
:root.light .a-hero--lite-cover .a-hero-scrim {
  background:
    linear-gradient(180deg, transparent 60%, var(--bg) 100%),
    radial-gradient(ellipse at 72% 40%, var(--accent-soft), transparent 65%) !important;
}

/* レスポンシブ: 1024px 以下で cover 少し縮小、720px 以下で 1 カラム積み */
@media (max-width: 1024px) {
  .a-hero--lite-cover .a-hero-inner--lite {
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 32px;
  }
  .a-hero--lite-cover .a-hero-cover { width: 440px; }
}
@media (max-width: 720px) {
  .a-hero--lite-cover .a-hero-inner--lite {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .a-hero--lite-cover .a-hero-cover {
    width: 100%;
    max-width: 560px;
    justify-self: start;
  }
  .a-hero--lite-cover .a-hero-copy { max-width: 100%; }
}

/* ===== Layout (main + side) =====
   D-3a ではサイドバーは空だが grid は用意しておく。
   D-3c で .a-side 内の各 card を実装。 */
.a-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 64px;
  align-items: flex-start;
}

/* Sidebar 無し・中央寄せの狭めレイアウト (members 等) */
.a-layout--narrow {
  max-width: 860px;
  grid-template-columns: 1fr;
  gap: 0;
}

.a-main { min-width: 0; }

/* members ページでは本文max幅を layout に合わせて広く */
.article--members .a-body { max-width: none; }

/* members シリーズカード(shortcode members-series-grid) */
.a-body .members-series-grid {
  margin: 24px 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.a-body .extra-series {
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: inherit;
  text-decoration: none !important;
  transition: border-color .15s ease, transform .12s ease;
  position: relative;
}
.a-body .extra-series:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  text-decoration: none !important;
}
.a-body .extra-series .extra-card-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.a-body .extra-series h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.a-body .extra-series .extra-card-desc {
  margin: 0 0 4px;
  font-size: .88rem;
  line-height: 1.65;
  color: var(--text-dim);
}
.a-body .members-series-status {
  align-self: flex-start;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  padding: 2px 10px;
  border-radius: 2px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}

/* ===== Stats strip ===== */
.a-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.a-stat {
  padding: 22px 26px;
  border-right: 1px solid var(--border);
}

.a-stat:last-child { border-right: none; }

.a-stat-num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
}

.a-stat-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ===== Body (Markdown レンダリング結果に当てる) ===== */
.a-body {
  max-width: 720px;
  font-size: 1rem;
  color: var(--text);
  counter-reset: a-h2-counter;
}

.a-lede {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  line-height: 1.8;
  color: var(--text-dim);
  margin: 0 0 36px;
  text-wrap: pretty;
}

.a-lede::first-letter,
.a-body > p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-weight: 700;
  float: left;
  font-size: 4.2rem;
  line-height: .95;
  padding: 6px 14px 0 0;
  color: var(--accent);
}

/* 最初の段落をリード文スタイルに(ただしサイズは通常、first-letterだけ強調) */
.a-body > p:first-of-type {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text-dim);
  margin-bottom: 32px;
  text-wrap: pretty;
}

.a-body p { margin: 0 0 22px; line-height: 1.8; }
.a-body strong { color: var(--text); font-weight: 700; }

.a-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 3px;
  border: 1px solid var(--accent-line);
}

.a-body h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.65rem;
  letter-spacing: -.005em;
  margin: 68px 0 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
  scroll-margin-top: 100px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  counter-increment: a-h2-counter;
}

.a-body h2::before {
  content: "§ " counter(a-h2-counter, decimal-leading-zero);
  flex: none;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  order: -1;
}

.a-body h2::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 56px;
  height: 2px;
  background: var(--accent);
}

.a-body h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 36px 0 10px;
  color: var(--text);
  scroll-margin-top: 100px;
}

.a-body ul {
  padding-left: 0;
  margin: 18px 0 26px;
  list-style: none;
}

.a-body ul > li {
  position: relative;
  padding: 10px 0 10px 28px;
  border-bottom: 1px dashed var(--border);
}

.a-body ul > li:last-child { border-bottom: none; }

.a-body ul > li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}

.a-body ol {
  padding-left: 1.4em;
  margin: 18px 0 26px;
}

.a-body ol li { margin: 8px 0; }

.a-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}

.a-body a:hover { text-decoration-color: var(--accent); }

.a-body blockquote {
  margin: 24px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text-dim);
  font-style: italic;
}

.a-body img,
.a-body video {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 18px 0;
}

.a-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.a-body th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-elev);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.a-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

.a-body tbody tr:last-child td { border-bottom: none; }
.a-body tbody tr:hover { background: var(--accent-soft); }

/* ===== Code block (render hookでラップ: .a-pre コンテナ + .a-pre-head + <pre>) ===== */
.a-body .a-pre {
  margin: 28px 0;
  border-radius: 6px;
  overflow: hidden;
  background: #06090c;
  border: 1px solid var(--border-str);
}

:root.light .a-body .a-pre {
  background: #0f1a22;
  border-color: #1f2a36;
}

.a-body .a-pre-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid #1f2a36;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: #8a96a6;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.a-body .a-pre-dots {
  display: flex;
  gap: 6px;
  flex: none;
}
.a-body .a-pre-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2c3b4d;
}
.a-body .a-pre-dots span:nth-child(1) { background: oklch(0.72 0.17 25); }
.a-body .a-pre-dots span:nth-child(2) { background: oklch(0.85 0.13 80); }
.a-body .a-pre-dots span:nth-child(3) { background: oklch(0.78 0.15 150); }

.a-body .a-pre-title { flex: 1; }

.a-body .a-pre-copy {
  font: inherit;
  font-size: .68rem;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-line);
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: background-color .15s ease;
}
.a-body .a-pre-copy:hover { background: var(--accent-soft); }

/* render hook 後の <pre> or chroma div の中身。既存 style.css のターミナル風緑文字を上書き */
.a-body .a-pre pre,
.a-body .a-pre .highlight,
.a-body .a-pre .highlight pre,
.a-body .a-pre .chroma {
  margin: 0 !important;
  padding: 16px 18px !important;
  background: transparent !important;
  color: #c8d6e6 !important;
  font-family: var(--font-mono);
  font-size: .84rem;
  line-height: 1.65;
  border: none !important;
  overflow-x: auto;
  white-space: pre;
  border-radius: 0 !important;
}
.a-body .a-pre .highlight > pre,
.a-body .a-pre .chroma {
  padding: 16px 18px !important;
}
.a-body .a-pre .highlight {
  padding: 0 !important;
  background: transparent !important;
}

.a-body .a-pre code,
.a-body .a-pre pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border: none !important;
  font-size: inherit !important;
}

/* render hook を通さない素の <pre> (予備: 既存記事で markdown の fence なしテキスト等) */
.a-body > pre {
  margin: 28px 0;
  padding: 16px 18px;
  background: #06090c;
  color: #c8d6e6;
  font-family: var(--font-mono);
  font-size: .84rem;
  line-height: 1.65;
  border: 1px solid var(--border-str);
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre;
}

/* ===== Callout (引用風) ===== */
.a-body .a-callout {
  display: flex;
  gap: 18px;
  margin: 32px 0;
  padding: 20px 24px;
  border-top: 1px solid var(--accent-line);
  border-bottom: 1px solid var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft) 0, transparent 50%);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-dim);
}
.a-body .a-callout-mark {
  font-size: 2.4rem;
  line-height: 1;
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: normal;
  flex: none;
}
.a-body .a-callout > div > :last-child { margin-bottom: 0; }

/* ===== Box (info / warning / danger) ===== */
.a-body .a-box {
  display: flex;
  gap: 14px;
  margin: 28px 0;
  padding: 16px 20px;
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: .94rem;
  line-height: 1.75;
}
.a-body .a-box-warning { border-left-color: var(--warn); }
.a-body .a-box-danger { border-left-color: oklch(0.62 0.2 25); }

.a-body .a-box-icon {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: .9rem;
}
.a-body .a-box-warning .a-box-icon {
  background: oklch(0.78 0.15 45 / .18);
  color: var(--warn);
}
.a-body .a-box-danger .a-box-icon {
  background: oklch(0.62 0.2 25 / .18);
  color: oklch(0.62 0.2 25);
}
.a-body .a-box > div > :last-child { margin-bottom: 0; }

/* ===== Collapse (details/summary) ===== */
.a-body .a-collapse {
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  overflow: hidden;
}
.a-body .a-collapse__summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: .94rem;
  color: var(--text);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color .15s ease;
}
.a-body .a-collapse__summary::-webkit-details-marker { display: none; }
.a-body .a-collapse__summary::before {
  content: "▶";
  font-size: .7rem;
  color: var(--accent);
  transition: transform .2s ease;
}
.a-body .a-collapse[open] .a-collapse__summary::before { transform: rotate(90deg); }
.a-body .a-collapse__summary:hover { background: var(--bg-hover, var(--bg-card)); }
.a-body .a-collapse__body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--border);
  font-size: .94rem;
  line-height: 1.75;
}
.a-body .a-collapse__body > :first-child { margin-top: 12px; }
.a-body .a-collapse__body > :last-child { margin-bottom: 0; }

/* ===== Divider ===== */
.a-divider {
  text-align: center;
  margin: 64px 0 16px;
  color: var(--border-str);
  font-size: 1.4rem;
  letter-spacing: 1em;
}

/* ===== Related Stories ===== */
.a-related {
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  max-width: 720px;
}

.a-related-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.a-related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.a-rel {
  display: block;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .15s;
}

.a-rel:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.a-rel-cat {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.a-rel-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.45;
  margin-bottom: 10px;
}

.a-rel-date {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
}

/* ===== Sidebar (D-3c) ===== */
.a-side {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.a-side-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px;
}

.a-side-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

/* --- Reading Progress bar --- */
.a-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}
.a-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .15s linear;
}
.a-progress-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--muted);
}

/* --- TOC (Hugo .TableOfContents が出力する #TableOfContents nav を装飾) --- */
.a-side-toc #TableOfContents {
  font-size: .84rem;
  line-height: 1.5;
}
.a-side-toc #TableOfContents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.a-side-toc #TableOfContents li { margin: 0; }
.a-side-toc #TableOfContents a {
  display: block;
  padding: 7px 0 7px 12px;
  color: var(--muted);
  text-decoration: none;
  border-left: 1px solid var(--border);
  transition: color .15s, border-color .15s;
}
.a-side-toc #TableOfContents a:hover {
  color: var(--text);
  border-left-color: var(--accent-line);
  text-decoration: none;
}
.a-side-toc #TableOfContents a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
/* ネストしたサブ項目 (h3) */
.a-side-toc #TableOfContents ul ul a {
  padding-left: 28px;
  font-size: .8rem;
}

/* --- Chinchilla live stream card --- */
.a-side-stream-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.a-side-stream-player {
  width: 100%;
  height: 100%;
}
.a-side-stream-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.a-side-stream-offline {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #1a1a1a;
  color: #eee;
  padding: 12px;
}
.a-side-stream-offline-title {
  font-size: .95rem;
  font-weight: 600;
  margin: 0 0 8px;
}
.a-side-stream-offline-schedule {
  font-size: .78rem;
  margin: 0;
  color: #bbb;
  font-family: var(--font-mono);
}
.a-side-stream-caption {
  margin: 10px 0 0;
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}

/* --- Author card --- */
.a-author-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.a-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elev) center center / cover no-repeat;
  border: 1px solid var(--border-str);
  flex: none;
}
.a-author-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: .96rem;
}
.a-author-handle {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
}
.a-author-bio {
  font-size: .82rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin: 10px 0 14px;
}
.a-author-follow {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  color: var(--accent-on);
  background: var(--accent);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: .04em;
  text-align: center;
  text-decoration: none;
  transition: filter .15s ease;
}
.a-author-follow:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

/* --- Tags pill --- */
.a-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.a-tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  padding: 3px 10px;
  border-radius: 2px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.a-tag::before {
  content: "#";
  color: var(--accent);
  margin-right: 2px;
}
.a-tag:hover {
  border-color: var(--accent-line);
  color: var(--text);
  text-decoration: none;
}

/* =========================================================
   共通 button (.a-btn) — Apps Hero CTA 等で使用
   ========================================================= */
.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .02em;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, filter .15s ease;
  white-space: nowrap;
}
.a-btn:hover { text-decoration: none; }

.a-btn--primary {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}
.a-btn--primary:hover { filter: brightness(1.08); color: var(--accent-on); }

.a-btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-str);
}
.a-btn--ghost:hover { border-color: var(--accent-line); color: var(--accent); }

/* =========================================================
   Apps list (/apps/)
   ========================================================= */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin: 32px 0 16px;
}

.app-card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: inherit;
  text-decoration: none !important;
  transition: border-color .15s ease, transform .12s ease;
}
.app-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  text-decoration: none !important;
}

.app-card--soon {
  opacity: .6;
  cursor: default;
  pointer-events: none;
}

.app-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.app-card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: -.005em;
}

.app-card-tagline {
  margin: 0 0 14px;
  font-size: .88rem;
  line-height: 1.65;
  color: var(--text-dim);
}

.app-card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

/* =========================================================
   Apps single (/apps/<slug>/) — Hero & CTA
   ========================================================= */
.a-hero--app .a-hero-inner--lite {
  padding: 72px 32px 56px;
}

.app-status-pill {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 2px;
  padding: 2px 10px;
  font-weight: 500;
}
.app-status-pill--soon {
  color: var(--muted);
  border-color: var(--border-str);
  background: var(--bg-elev);
}

.app-status-note {
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .04em;
  color: var(--muted);
}

.app-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.app-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* Apps sidebar 内の Quick Links */
.app-side-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-side-links li { margin: 0; }
.app-side-links a {
  display: block;
  padding: 8px 0;
  color: var(--text);
  text-decoration: none;
  font-size: .86rem;
  border-bottom: 1px dashed var(--border);
  transition: color .15s ease;
}
.app-side-links li:last-child a { border-bottom: none; }
.app-side-links a:hover { color: var(--accent); text-decoration: none; }

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.flex-row--gap-lg { gap: 16px; }

/* =========================================================
   Breadcrumb (Hero Lite 内などで使用)
   ========================================================= */
.a-breadcrumb {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0 0 18px;
}
.a-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.a-breadcrumb a:hover {
  color: var(--accent);
  text-decoration: none;
}
.a-breadcrumb .sep {
  margin: 0 10px;
  opacity: .6;
}
.a-breadcrumb .current { color: var(--text); }

/* =========================================================
   List pages (カテゴリ / タグ / posts) — 記事カードグリッド
   ========================================================= */
.list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.list-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: inherit;
  text-decoration: none !important;
  transition: border-color .15s ease, transform .12s ease;
}
.list-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  text-decoration: none !important;
}

.list-card-thumb {
  width: 120px;
  height: 84px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elev);
  border: 1px solid var(--border);
}

.list-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-card-cat {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

.list-card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  margin: 0;
  color: var(--text);
  letter-spacing: -.005em;
  overflow-wrap: anywhere;
}

.list-card:hover .list-card-title { color: var(--accent); }

.list-card-date {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  margin-top: auto;
}

.list-empty {
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed var(--border-str);
  border-radius: 6px;
  color: var(--muted);
  font-size: .92rem;
}

@media (max-width: 520px) {
  .list-card { grid-template-columns: 1fr; }
  .list-card-thumb { width: 100%; height: 160px; }
}

/* =========================================================
   Terms index (/categories/, /tags/)
   ========================================================= */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.term-card {
  display: block;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: inherit;
  text-decoration: none !important;
  transition: border-color .15s ease, transform .12s ease;
}
.term-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  text-decoration: none !important;
}

.term-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.term-card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
  letter-spacing: -.005em;
  color: var(--text);
}
.term-card-count {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--muted);
  white-space: nowrap;
}
.term-card-desc {
  margin: 0;
  font-size: .86rem;
  line-height: 1.65;
  color: var(--text-dim);
}

/* =========================================================
   Games (/games/ list + /games/<slug>/ single)
   ========================================================= */

/* --- Games list (1列縦積み・横長カード) --- */
.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 32px;
}

.game-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none !important;
  color: inherit;
  transition: border-color .15s ease, transform .12s ease;
}
.game-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  text-decoration: none !important;
}

.game-card-thumb {
  width: 240px;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.game-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

@media (max-width: 520px) {
  .game-card { grid-template-columns: 1fr; }
  .game-card-thumb { width: 100%; }
}

.game-card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
  letter-spacing: -.005em;
  color: var(--text);
}
.game-card:hover .game-card-title { color: var(--accent); }

.game-card-desc {
  margin: 0;
  font-size: .86rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

/* --- Game single --- */
.game-canvas-wrapper {
  margin: 24px 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  /* 実寸・portrait 等のキャンバス個別サイズは /css/games-v2.css が担当 */
}

.game-ranking {
  margin: 24px 0;
}

.game-controls-card {
  margin: 32px 0;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.game-controls-card .a-side-label {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.game-controls-dl {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px 16px;
  margin: 0 0 16px;
  font-size: .9rem;
}
.game-controls-dl dt {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--muted);
  padding-top: 2px;
}
.game-controls-dl dd {
  margin: 0;
  color: var(--text-dim);
}

.game-controls-card .a-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

@media (max-width: 520px) {
  .game-controls-dl {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  .game-controls-dl dd { margin-bottom: 10px; }
}

/* =========================================================
   List sidebar (/categories/*, /posts/ 等の Sidebar)
   ========================================================= */
.list-sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-sidebar-links li { margin: 0; }
.list-sidebar-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text);
  text-decoration: none;
  font-size: .88rem;
  border-bottom: 1px dashed var(--border);
}
.list-sidebar-links li:last-child a { border-bottom: none; }
.list-sidebar-links a:hover { color: var(--accent); }
.list-sidebar-links .count {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
}

.list-sidebar-posts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.list-sidebar-posts li { margin: 0; }
.list-sidebar-posts a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.list-sidebar-posts li:last-child a {
  padding-bottom: 0;
  border-bottom: none;
}
.list-sidebar-posts time {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--muted);
}
.list-sidebar-posts .title {
  font-size: .86rem;
  line-height: 1.4;
  color: var(--text);
}
.list-sidebar-posts a:hover .title { color: var(--accent); }


/* ===== Responsive ===== */
@media (max-width: 960px) {
  .a-layout { grid-template-columns: 1fr; }
  .a-side { position: static; }
  .a-hero-inner { grid-template-columns: 1fr; }
  .a-hero-cover {
    width: 100%;
    max-width: 560px;
    justify-self: start;
  }
  .a-stats { grid-template-columns: 1fr; }
  .a-stat {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .a-stat:last-child { border-bottom: none; }
  .a-related-grid { grid-template-columns: 1fr; }
  .a-hero-mascot {
    right: -20px;
    bottom: -20px;
    width: 84px;
    height: 84px;
  }
}
