/* =============================================================
   Xまとめサイト 共通スタイル v2
   デザイン仕様: docs/design.md(fable設計・確定)
   方針: 日本のまとめサイトの見た目の文法に準拠。
   禁止: 大余白 / 角丸>4px / 影 / グラデ / パステル / ピル形状
   ============================================================= */

:root {
  --c-bg: #f2f3f5;
  --c-panel: #ffffff;
  --c-ink: #333333;
  --c-muted: #767c85;
  --c-link: #0066cc;
  --c-red: #e60012;
  --c-blue-em: #0033bb;
  --c-marker: #ffff66;
  --c-header: #1a1a1a;
  --c-line: #dddddd;
  --c-surface: #f7f8f9;

  --cat-seiji: #3567b3;   /* 政治 */
  --cat-keizai: #3d8b41;  /* 経済 */
  --cat-kanryo: #6a51a3;  /* 官僚 */
  --cat-kigyo: #c7761d;   /* 企業 */
  --cat-net: #c4498f;     /* ネット */
  --cat-ai: #4f6bed;      /* AI */
  --cat-iran: #b33a3a;    /* イラン情勢 */

  --font-body: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--c-ink);
  background: var(--c-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--c-link); outline-offset: 2px; }

/* ---------- ヘッダー(黒ベタ) ---------- */
.site-header {
  background: var(--c-header);
  border-bottom: 3px solid var(--c-red);
}
.site-header__inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.site-logo {
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  padding: 12px 4px;
  letter-spacing: 0.02em;
}
.site-logo:hover { text-decoration: none; }
.site-logo__accent { color: var(--c-red); }
.site-nav { margin-left: auto; display: flex; overflow-x: auto; }
.site-nav a {
  color: #ccc;
  font-size: 13px;
  font-weight: 600;
  padding: 14px 10px;
  white-space: nowrap;
}
.site-nav a:hover { color: #fff; background: #333; text-decoration: none; }
.site-nav a[aria-current="page"] { color: #fff; border-bottom: 2px solid var(--c-red); }

/* ---------- レイアウト ---------- */
.layout {
  max-width: 1060px;
  margin: 0 auto;
  padding: 16px 0 48px;
}
@media (min-width: 1024px) {
  .layout--two-col {
    display: grid;
    grid-template-columns: minmax(0, 660px) 300px;
    gap: 24px;
    justify-content: center;
    padding: 16px 12px 48px;
  }
}
.main-col { min-width: 0; }
.panel {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  padding: 16px 12px;
  margin-bottom: 16px;
}
@media (min-width: 640px) { .panel { padding: 20px 24px; border-radius: 4px; } }

/* ---------- パンくず ---------- */
.breadcrumb { font-size: 12px; color: var(--c-muted); margin-bottom: 10px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: ">"; margin-right: 4px; color: var(--c-muted); }

/* ---------- 記事ヘッダー ---------- */
.article-title { font-size: 19px; line-height: 1.45; font-weight: 800; margin-bottom: 10px; }
@media (min-width: 640px) { .article-title { font-size: 21px; } }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--c-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 16px;
}
/* カテゴリラベル: ベタ塗り角丸2px。data-cat でカテゴリ色 */
.cat-label {
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--cat-seiji);
}
.cat-label[data-cat="seiji"]  { background: var(--cat-seiji); }
.cat-label[data-cat="keizai"] { background: var(--cat-keizai); }
.cat-label[data-cat="kanryo"] { background: var(--cat-kanryo); }
.cat-label[data-cat="kigyo"]  { background: var(--cat-kigyo); }
.cat-label[data-cat="net"]    { background: var(--cat-net); }
.cat-label[data-cat="ai"]     { background: var(--cat-ai); }
.cat-label[data-cat="iran"]   { background: var(--cat-iran); }
.cat-label:hover { text-decoration: none; color: #fff; opacity: 0.85; }
/* メタ行の要素は途中改行させない(モバイルで「ネッ/ト」に折れる事故防止) */
.cat-label, .post-count, .entry-list__new, .entry-list__date { white-space: nowrap; }
/* ポスト数カウンタ(シグネチャ): 赤太字テキスト */
.post-count { color: var(--c-red); font-weight: 800; font-size: 12.5px; }

/* ---------- サイト説明バー(レス番風・トップ1ページ目のみ) ---------- */
.site-intro {
  border: 1px solid var(--c-line);
  padding: 8px 12px 10px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.site-intro__res { font-size: 12px; color: var(--c-muted); font-weight: 700; margin: 0 0 2px; }
.site-intro__body { font-size: 13.5px; margin: 0; }
.site-intro b { color: var(--c-red); }

/* ---------- 本文・強調 ---------- */
.article-lead { margin-bottom: 20px; }
/* まとめ伝統の赤太字・青太字。1セクション1〜2箇所まで */
b.em-r, .em-r { color: var(--c-red); font-weight: 800; }
b.em-b, .em-b { color: var(--c-blue-em); font-weight: 800; }
mark { background: var(--c-marker); color: inherit; font-weight: 700; padding: 0 1px; }

.article-body, .article-lead { overflow-wrap: break-word; }
.article-body h2 {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
  border-left: 5px solid var(--c-red);
  border-bottom: 1px solid var(--c-line);
  padding: 2px 0 6px 10px;
  margin: 32px 0 14px;
}
.article-body p { margin-bottom: 18px; }

/* ---------- 目次 ---------- */
.toc {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
}
.toc__title { font-weight: 800; font-size: 12.5px; margin-bottom: 6px; }
.toc ol { padding-left: 20px; }
.toc li { padding: 2px 0; }

/* ---------- ワイのコールアウト(セクション補足)
   注意: 左ボーダー+太字は「見出し(h2)の文法」なので使わない — 2026-07-20
   見出しと視覚的に混ざらないよう、細い全周枠+通常ウェイト+「ワイ」チップで区別 ---------- */
.editor-note {
  margin: 16px 0;
  padding: 9px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 0;
  font-size: 14px;
  line-height: 1.7;
}
.editor-note p {
  margin: 0;
  font-weight: 400;
}
/* ラベルは「※」のみ(2026-07-20 ユーザー決定。チップ箱・ワイ表記は使わない) */
.editor-note p::before {
  content: "※ ";
  color: var(--c-red);
  font-weight: 800;
}

/* ---------- スレッドレール + ポスト引用カード ---------- */
.post-thread { position: relative; padding-left: 16px; margin: 16px 0; }
.post-thread__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--c-muted);
  margin: 0 0 8px -2px;
}
.post-thread::before {
  content: "";
  position: absolute;
  left: 2px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--c-line);
}
/* 公式embedの見た目に寄せた白カード(読者の既知言語) */
.post-card {
  background: var(--c-panel);
  border: 1px solid #cfd9de;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.7;
}
.post-card--fire { border: 2px solid var(--c-red); }
.post-card__fire {
  font-size: 12px;
  font-weight: 800;
  color: var(--c-red);
  margin-bottom: 6px;
}
.post-card__header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.post-card__avatar {
  width: 36px; height: 36px;
  border-radius: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  background: var(--cat-net);
}
.post-card__avatar[data-cat="seiji"] { background: var(--cat-seiji); }
.post-card__avatar[data-cat="keizai"] { background: var(--cat-keizai); }
.post-card__avatar[data-cat="kanryo"] { background: var(--cat-kanryo); }
.post-card__avatar[data-cat="kigyo"] { background: var(--cat-kigyo); }
.post-card__avatar[data-cat="net"] { background: var(--cat-net); }
.post-card__avatar[data-cat="ai"] { background: var(--cat-ai); }
.post-card__avatar[data-cat="iran"] { background: var(--cat-iran); }
.post-card__name { font-weight: 700; color: var(--c-ink); }
.post-card__handle, .post-card__date { color: var(--c-muted); }
.post-card__text {
  margin-bottom: 8px;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}
.post-card__text.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.post-card__more {
  display: none;
  border: 0;
  background: none;
  color: var(--c-link);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0 8px;
}
.post-card__more.is-on { display: inline-block; }
.post-card__media { display: grid; gap: 2px; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.post-card__media[data-count="1"] { grid-template-columns: 1fr; }
.post-card__media[data-count="2"], .post-card__media[data-count="4"] { grid-template-columns: 1fr 1fr; }
.post-card__media[data-count="3"] { grid-template-columns: 1fr 1fr; }
.post-card__media[data-count="3"] img:first-child { grid-row: span 2; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__footer { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--c-muted); }
.post-card__link { margin-left: auto; font-weight: 700; }
.post-card--hydrated { background: none; border: none; padding: 0; }

/* ---------- 広告枠 ---------- */
/* 広告枠: 既定は非表示。クリエイティブが実際に入ったときだけ出現する
   (ad-slots.js がクリエイティブ検知で --filled を付与/除去。2026-07-19 ユーザー決定:
    空枠・プレースホルダは一切見せない。出現時のわずかなシフトは許容) */
.ad-slot { display: none; }
.ad-slot--filled {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 20px 0;
  padding: 8px 0 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  /* 全AdMax枠は300×250固定。二重注入等で何が積まれても縦に暴れないよう上限キャップ */
  max-height: 336px;
  overflow: hidden;
}
.ad-slot--filled::before { content: "スポンサーリンク"; color: #bbb; font-size: 10px; }
.ad-slot--side.ad-slot--filled { margin: 12px 0; }

/* ---------- タグ・シェア ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 18px 0; font-size: 13px; }
.tag-list a { min-height: 44px; display: inline-flex; align-items: center; }
.share-row { display: flex; gap: 8px; margin: 16px 0 24px; }
.share-btn {
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--c-line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.share-btn:hover { opacity: 0.85; text-decoration: none; }
.share-btn--x { background: #000; }
.share-btn--line { background: #06c755; }
.share-btn--hatena { background: #00a4de; }
.share-btn--copy { background: #fff; color: var(--c-ink); }
.share-prompt {
  font-size: 14px;
  font-weight: 800;
  margin: 20px 0 8px;
}
.share-row { flex-wrap: wrap; }
.share-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.2s, transform 0.2s;
}
.share-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.select-share-btn {
  position: absolute;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: #000;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid #fff;
}
.select-share-btn:hover { opacity: 0.9; text-decoration: none; }

/* 結び・結論カード・要点表 */
.closing {
  background: var(--c-surface);
  border-top: 3px solid var(--c-ink);
  padding: 16px 14px 20px;
  margin: 28px 0 12px;
}
.closing h2 {
  background: var(--c-ink);
  color: #fff;
  display: inline-block;
  padding: 4px 10px;
  font-size: 16px;
  margin: 0 0 12px;
}
/* 名言カード(.shime-card)系は 2026-07-20 ユーザー決定で廃止(復活させないこと) */
/* 要点サマリ: 2chの引用文スタイル(緑の＞行)。テーブル廃止 — 2026-07-20 ユーザー決定 */
.facts-box {
  background: var(--c-surface);
  border-left: 4px solid var(--c-line);
  padding: 8px 14px 10px;
  margin: 0 0 18px;
}
.facts-box__cap {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--c-muted);
  margin: 0 0 3px;
}
.facts-box__line {
  color: #5d7a14; /* 2ch引用緑(AAコントラスト確保のためやや濃いめ) */
  font-size: 14px;
  font-weight: 700;
  line-height: 1.9;
  margin: 0;
}
.series-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-muted);
}

/* ---------- セクション見出し(パネル内リスト用) ---------- */
.section-title {
  font-size: 15px;
  font-weight: 800;
  background: var(--c-header);
  color: #fff;
  padding: 8px 12px;
  margin: 24px 0 0;
  border-radius: 2px 2px 0 0;
}
.section-title--red { background: var(--c-red); }

/* ---------- 記事リスト(罫線区切り・密度重視) ---------- */
.entry-list { list-style: none; border: 1px solid var(--c-line); border-top: none; }
.entry-list li { border-bottom: 1px solid var(--c-line); }
.entry-list li:last-child { border-bottom: none; }
.entry-list a {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  color: var(--c-ink);
}
.entry-list a:hover { background: var(--c-surface); text-decoration: none; }
.entry-list a:hover .entry-list__title { text-decoration: underline; color: var(--c-link); }
.entry-list__thumb {
  width: 100px;
  height: 66px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
}
.entry-list__title { font-size: 14px; line-height: 1.55; font-weight: 600; }
.entry-list__meta { font-size: 11.5px; color: var(--c-muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.entry-list__meta .post-count { font-size: 11.5px; }
.entry-list__new { color: var(--c-red); font-weight: 800; font-size: 11px; }

/* 注目ピック(トップ最上部) */
/* 注目ピック: 横組み(画像+テキスト)。タイトルの二重表示を避けるためサムネは文字なし画像を使う */
.pickup { border: 1px solid var(--c-line); border-left: 4px solid var(--c-red); }
.pickup a { display: flex; gap: 12px; padding: 12px; color: var(--c-ink); align-items: flex-start; }
.pickup a:hover { text-decoration: none; background: var(--c-surface); }
.pickup a:hover .pickup__title { color: var(--c-link); text-decoration: underline; }
.pickup__thumb {
  width: 38%;
  max-width: 300px;
  aspect-ratio: 300 / 198;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
}
.pickup__body { min-width: 0; }
.pickup__label { display: block; font-size: 11.5px; font-weight: 800; color: var(--c-red); margin-bottom: 4px; }
.pickup__title { display: block; font-size: 16px; line-height: 1.5; font-weight: 800; margin: 0 0 6px; }
@media (min-width: 640px) { .pickup__title { font-size: 19px; } }

/* ---------- ランキング ---------- */
.ranking { list-style: none; counter-reset: rank; border: 1px solid var(--c-line); border-top: none; }
.ranking li { counter-increment: rank; border-bottom: 1px solid var(--c-line); }
.ranking li:last-child { border-bottom: none; }
.ranking a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  color: var(--c-ink);
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 600;
}
.ranking a:hover { background: var(--c-surface); text-decoration: none; }
.ranking a::before {
  content: counter(rank);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border-radius: 2px;
  margin-top: 1px;
}
.ranking li:nth-child(n + 4) a::before { background: var(--c-muted); }

/* ---------- 前後記事 ---------- */
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 24px 0 0; }
.prev-next a {
  border: 1px solid var(--c-line);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-ink);
  font-weight: 600;
}
.prev-next a:hover { background: var(--c-surface); }
.prev-next__label { display: block; font-size: 11px; color: var(--c-muted); font-weight: 400; margin-bottom: 2px; }
.prev-next a[data-dir="next"] { text-align: right; }

/* ---------- サイドバー ---------- */
.side-col { display: none; }
@media (min-width: 1024px) {
  .side-col { display: block; }
  /* stickyは廃止(2026-07-19 ユーザー決定): サイドバーが画面より長く、
     貼り付くと下部ウィジェットに到達できない。ページと一緒にスクロールさせる */
  .side-col__sticky { position: static; }
}
.side-box { margin-bottom: 20px; }
.side-box .section-title { margin-top: 0; }
/* サイドバーの順位なしリスト(新着など。順位バッジは「人気記事」専用) */
.side-list { list-style: none; border: 1px solid var(--c-line); border-top: none; background: var(--c-panel); }
.side-list li { border-bottom: 1px solid var(--c-line); }
.side-list li:last-child { border-bottom: none; }
.side-list a {
  display: block;
  padding: 9px 12px;
  color: var(--c-ink);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}
.side-list a:hover { background: var(--c-surface); text-decoration: none; }
.side-box__plain {
  border: 1px solid var(--c-line);
  border-top: none;
  background: var(--c-panel);
  padding: 10px 12px;
  font-size: 13px;
}
.side-box__plain ul { list-style: none; }
.side-box__plain li { padding: 4px 0; }

/* ---------- 「次に読む」追従バー(モバイル) ---------- */
.next-read {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--c-header);
  color: #fff;
  padding: 10px 44px 12px 12px;
  font-size: 13px;
  line-height: 1.5;
  transform: translateY(110%);
  transition: transform 0.25s ease;
  z-index: 50;
}
.next-read.is-visible { transform: translateY(0); }
.next-read a { color: #fff; font-weight: 700; }
.next-read__label { display: block; font-size: 10.5px; color: #ff8a80; font-weight: 800; }
.next-read__x {
  color: #fff;
  font-weight: 800;
  padding: 0 8px;
  text-decoration: none;
}
.next-read__close {
  position: absolute;
  top: 6px; right: 6px;
  width: 36px; height: 36px;
  border: none;
  background: none;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
@media (min-width: 1024px) { .next-read { display: none; } }
@media (prefers-reduced-motion: reduce) { .next-read { transition: none; } }

/* ---------- ページネーション ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 20px 0; font-size: 14px; }
.pagination a, .pagination span {
  min-width: 40px; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line);
  background: var(--c-panel);
  padding: 0 8px;
}
.pagination span[aria-current="page"] { background: var(--c-header); color: #fff; border-color: var(--c-header); }

.cat-heading {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.35;
}
.cat-intro {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--c-ink);
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--c-surface);
  border-left: 3px solid var(--c-ink);
}
.cat-more {
  margin: 8px 0 20px;
  font-size: 14px;
  font-weight: 800;
}
.site-footer__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.site-footer__cats a { color: #ccc; font-weight: 700; font-size: 13px; }
.site-footer__cats a:hover { color: #fff; }

/* ---------- フッター(黒) ---------- */
.site-footer {
  background: var(--c-header);
  color: #aaa;
  margin-top: 32px;
  padding: 24px 12px 40px;
  font-size: 12.5px;
}
.site-footer__inner { max-width: 1060px; margin: 0 auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }
.site-footer a { color: #ccc; }
.site-footer__ai-note { font-size: 11.5px; line-height: 1.7; }
