/* fudousan-news.com — 手書きの正本（生成物ではない）
   正典: docs/DESIGN.md v2。この CSS が正典と食い違ったら正典が勝つ。
   規則: アクセントは1色 / 影ゼロ / グラデーションゼロ / 角丸は10pxとピルの2種 / 書体は欧文1＋和文1 */

:root {
  color-scheme: light;

  /* Colors — DESIGN.md §2 */
  --bg: #FCFAF5;
  --surface-1: #FFFFFF;
  --surface-2: #F2EEE6;
  --surface-3: #E6E0D4;
  --line: rgba(42, 38, 33, .10);
  --line-strong: rgba(42, 38, 33, .18);
  --ink: #2A2621;
  --ink-2: #3F3A32;
  --ink-3: #5C554A;
  --ink-4: #A29A8C;
  --accent: #4A6B2A;
  --accent-wash: #EAF0DF;
  --live: #BF231A;
  --player-bg: #000000;

  /* Typography — DESIGN.md §3 */
  --font-latin: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --text-caption: 12px;
  --text-label: 13px;
  --text-body-sm: 14px;
  --text-body: 15px;
  --text-body-lg: 17px;
  --text-title-sm: 20px;
  --text-title: 24px;
  --text-headline: 32px;
  --text-page: 40px;

  /* Spacing & shapes — DESIGN.md §4 */
  --gap-xs: 4px; --gap-sm: 8px; --gap: 12px; --gap-md: 16px; --gap-lg: 24px; --gap-xl: 32px;
  --section: 48px;
  --w-page: 1280px;
  --w-read: 680px;
  --h-header: 56px;
  --r: 10px;
  --r-pill: 9999px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-ja);
  font-size: var(--text-body);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
/* ⚠ body に overflow-x: hidden を書かない（横はみ出しの検査が無効になる・LSN-0262） */
h1, h2, h3 { font-weight: 700; color: var(--ink); line-height: 1.35; margin: 0; }
/* keep-all は「明示的な <br> を置いた見出し」だけに掛ける。全体に掛けると長い和文の題名が
   折り返せず、SP で画面そのものが広がる（390px の実測で innerWidth が 496 になった） */
.keep-all { word-break: keep-all; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }
.num { font-family: var(--font-latin); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* 「本文へ」はフォーカスしたら見えなければ意味がない */
a.sr:focus { position: fixed; top: 8px; left: 8px; z-index: 60; width: auto; height: auto; clip: auto;
  background: var(--surface-1); color: var(--ink); padding: 10px 16px; border-radius: var(--r);
  border: 1px solid var(--accent); }

/* ── Header ─────────────────────────────────────────── */
.site-header {
  height: var(--h-header);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 30;
}
.site-header .inner {
  max-width: var(--w-page); margin: 0 auto; height: 100%;
  padding: 0 var(--gap-md);
  display: flex; align-items: center; gap: var(--gap-md);
}
.wordmark {
  font-family: var(--font-latin); font-weight: 700; font-size: 18px;
  color: var(--ink); text-decoration: none; letter-spacing: .01em; white-space: nowrap;
}
.site-nav { margin-left: auto; display: flex; gap: var(--gap-md); min-width: 0; }
.site-nav a { font-size: var(--text-body-sm); color: var(--ink-2); text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; min-height: 44px; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }

/* ── Layout ─────────────────────────────────────────── */
.wrap { max-width: var(--w-page); margin: 0 auto; padding: var(--gap-lg) var(--gap-md) var(--section); }
.screen-head { margin-bottom: var(--gap-md); }
.screen-head h1 { font-size: var(--text-title-sm); }
.screen-head p { font-size: var(--text-body-sm); color: var(--ink-3); margin: var(--gap-xs) 0 0; }
.two-col {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap-lg);
  align-items: start;
}
.two-col > * { min-width: 0; }

/* ── Player stage ───────────────────────────────────── */
.player-frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: var(--player-bg); border-radius: var(--r); overflow: hidden;
}
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* 幕: 押されるまで再生しない。動画要素は隠さない（LSN-0239） */
.player-frame[data-armed="0"]::after {
  content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .35);
}
.play-btn {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-ja); font-size: var(--text-body); padding: 0;
}
.play-btn .badge {
  display: inline-flex; align-items: center; gap: var(--gap-sm);
  background: rgba(0, 0, 0, .62); border-radius: var(--r-pill); padding: 10px 18px;
}
.player-frame[data-armed="1"] .play-btn { display: none; }

.now-playing {
  display: flex; align-items: center; gap: var(--gap-sm);
  min-height: 56px; padding: var(--gap-sm) 0; border-bottom: 1px solid var(--line);
  font-size: var(--text-body-sm);
}
.now-playing .avatar { width: 24px; height: 24px; font-size: var(--text-caption); }
.now-playing .state { font-size: var(--text-caption); color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.now-playing .state::before { flex: none; }
.now-playing .state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.now-playing[data-live="1"] .state { color: var(--live); }
.now-playing[data-live="1"] .state::before { background: var(--live); }
.now-playing .np-name { font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing .np-open { margin-left: auto; white-space: nowrap; font-size: var(--text-caption); }

.channel-info { padding: var(--gap-md) 0; display: flex; gap: var(--gap); align-items: flex-start; }
.channel-info .avatar { width: 48px; height: 48px; flex: none; }
.channel-info > div { min-width: 0; }
.channel-info h2 { font-size: var(--text-title-sm); }
.channel-info .meta { font-size: var(--text-caption); color: var(--ink-3); margin-top: 2px; }
.channel-info .why { font-size: var(--text-body-sm); color: var(--ink-2); margin: var(--gap-sm) 0 0; }
.channel-info .caution { font-size: var(--text-caption); color: var(--ink-3); margin: var(--gap-xs) 0 0; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--surface-2); object-fit: cover;
  display: grid; place-items: center;
  font-family: var(--font-ja); font-size: var(--text-body-sm); color: var(--ink-3);
}

/* ── Panel（一覧） ──────────────────────────────────── */
.panel {
  background: var(--surface-1); border-radius: var(--r); padding: var(--gap-md);
  border: 1px solid var(--line);
}
.panel .search { width: 100%; height: 44px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--ink);
  font-family: var(--font-ja); font-size: var(--text-body-sm); }
.panel .search::placeholder { color: var(--ink-3); }
.pill-label { font-size: var(--text-caption); color: var(--ink-3); margin: var(--gap-md) 0 var(--gap-sm); }
.pills { display: flex; flex-wrap: wrap; gap: var(--gap-sm) var(--gap-sm); margin: 0; padding: 5px 0; list-style: none; }
.pill {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px;
  position: relative;
  border-radius: var(--r-pill); border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink-2);
  font-family: var(--font-ja); font-size: var(--text-label); line-height: 1;
  text-decoration: none; cursor: pointer; transition: background 150ms ease;
  white-space: nowrap;   /* 横スクロールの列で「部屋を見る」が縦に折れた（390px 実測） */
}
.pill:hover { background: var(--surface-3); }
.pill[aria-pressed="true"], .pill[aria-current="page"] { background: var(--accent); color: #fff; }
.pills--mode .pill[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent); }
.pill[aria-disabled="true"] { color: var(--ink-4); pointer-events: none; }
/* 見た目は 34px、指の当たり判定は 44px（DESIGN.md §8）。列の間隔を詰めすぎない */
.pill::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
.pill .count { font-family: var(--font-latin); font-variant-numeric: tabular-nums; margin-left: 6px; opacity: .75; }

.panel-note { font-size: var(--text-caption); color: var(--ink-3); margin: var(--gap-md) 0 0; }
.list-head {
  display: flex; align-items: baseline; gap: var(--gap-sm);
  margin: var(--gap-md) 0 var(--gap-sm); padding-top: var(--gap-md); border-top: 1px solid var(--line);
}
.list-head h2 { font-size: var(--text-body-lg); }
.list-head .count, .list-head .order { font-size: var(--text-caption); color: var(--ink-3); }
.list-head .order { margin-left: auto; }

.ch-list { list-style: none; margin: 0; padding: 0; }
.ch-row {
  display: flex; text-decoration: none; align-items: center; gap: var(--gap-sm);
  width: 100%; min-height: 56px; padding: var(--gap-sm); padding-left: 10px;
  border: 0; border-left: 2px solid transparent; border-radius: var(--r);
  background: transparent; text-align: left; cursor: pointer;
  font-family: var(--font-ja); color: var(--ink-2);
  transition: background 150ms ease;
}
.ch-row:hover { background: var(--surface-2); }
.ch-row[aria-current="true"] { background: var(--surface-3); border-left-color: var(--accent); }
.ch-row .body { min-width: 0; flex: 1; }
.ch-row .name { display: block; font-size: var(--text-body); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-row .meta { display: block; font-size: var(--text-caption); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-row .tail { font-size: var(--text-caption); color: var(--ink-3); white-space: nowrap; margin-left: auto; padding-left: var(--gap-sm); }
.ch-row[data-live="1"] .tail { color: var(--live); }
.ch-row .ext { font-size: var(--text-caption); white-space: nowrap; }

.panel-more { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: var(--gap-md);
  padding-top: var(--gap-md); border-top: 1px solid var(--line); font-size: var(--text-body-sm); }

/* 「こんなとき」を押したときだけ出る棚 */
.mode-extra { margin: var(--gap-md) 0 0; padding: var(--gap-md); background: var(--surface-2); border-radius: var(--r); }
.mode-extra h2 { font-size: var(--text-body-lg); margin-bottom: var(--gap-sm); }
.mode-extra ul { list-style: none; margin: 0; padding: 0; }
.mode-extra li { font-size: var(--text-body-sm); padding: 3px 0; }
.mode-extra .note { font-size: var(--text-caption); color: var(--ink-3); margin-top: var(--gap-sm); }

/* ── 表（全チャンネル一覧・リンク集） ─────────────────── */
.table-wrap { overflow-x: auto; }
table.rows { width: 100%; border-collapse: collapse; font-size: var(--text-body-sm); }
table.rows th, table.rows td { text-align: left; padding: 10px var(--gap-sm); border-bottom: 1px solid var(--line); vertical-align: top; }
table.rows th { font-size: var(--text-caption); color: var(--ink-3); font-weight: 500; white-space: nowrap; }
table.rows td.name { color: var(--ink); }
table.rows td.num { white-space: nowrap; }
table.rows td.name .sub { display: none; font-size: var(--text-caption); color: var(--ink-3); }   /* 日付が「2026-08-\n25」と折れた（1440px 実測） */
table.rows tr.dormant td { color: var(--ink-3); }

.shelf { margin: var(--section) 0 0; }
.shelf h2 { font-size: var(--text-title-sm); }
.shelf .lead { font-size: var(--text-body-sm); color: var(--ink-3); margin: var(--gap-xs) 0 var(--gap); }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.link-list .name { font-size: var(--text-body); color: var(--ink); }
.link-list .why { font-size: var(--text-caption); color: var(--ink-3); }

/* ── 読みもの ───────────────────────────────────────── */
.read { max-width: var(--w-read); margin: 0 auto; padding: var(--gap-lg) var(--gap-md) var(--section); }
.read h1 { font-size: var(--text-page); margin-bottom: var(--gap-md); }
.read h2 { font-size: var(--text-title); margin: var(--section) 0 var(--gap); }
.read p, .read li { font-size: 16px; line-height: 1.9; }
.read .meta { font-size: var(--text-caption); color: var(--ink-3); }
.read blockquote { margin: var(--gap-lg) 0; padding: 0 0 0 var(--gap-md);
  border-left: 2px solid var(--accent); color: var(--ink-2); }
.read blockquote p { margin: 0; }
.read .readbox { margin: var(--section) 0 var(--gap-lg); padding: var(--gap-md);
  background: var(--surface-2); border-radius: 10px; font-size: var(--text-body-sm); line-height: 1.9; }
.read .readbox b { display: block; margin-bottom: var(--gap-sm); color: var(--ink); }
.read .note { font-size: var(--text-body-sm); color: var(--ink-3); }
.read .article-illust { margin: var(--gap-lg) 0 var(--section); }
.read .article-illust img { display: block; width: 100%; height: auto; border-radius: 10px; }

.page-head { margin-bottom: var(--gap-lg); }
.page-head h1 { font-size: var(--text-headline); }
.page-head p { font-size: var(--text-body); color: var(--ink-3); margin: var(--gap-sm) 0 0; }

/* ── Footer ─────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); margin-top: var(--section); }
.site-footer .inner { max-width: var(--w-page); margin: 0 auto; padding: var(--gap-lg) var(--gap-md); font-size: var(--text-caption); color: var(--ink-3); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--gap); margin-bottom: var(--gap-sm); }

/* ── スマートフォン ─────────────────────────────────── */
@media (max-width: 900px) {
  /* 1カラムになる幅から、ヘッダーは「チャンネル／読みもの」だけにする。
     実測: 768px でナビの右端が 886px まで出て、ページが横スクロールした（DESIGN.md §5） */
  .site-nav .sp-hide { display: none; }
  .two-col { display: block; }
  .stage { display: contents; }          /* sticky の親を一覧まで含める（LSN-0244） */
  .player-frame { border-radius: 0; }
  .wrap { padding: 0 0 var(--section); }
  .now-playing, .channel-info { padding-left: var(--gap-md); padding-right: var(--gap-md); }
  .panel { border: 0; border-radius: 0; }
  .pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .pills::-webkit-scrollbar { display: none; }
  .pill { flex: none; }
  .page-head, .shelf, .table-wrap { padding-left: var(--gap-md); padding-right: var(--gap-md); }
}
/* 縦長のときだけプレーヤーを貼り付ける。横向き（例 844×390）だと 16:9 だけで画面高を超える */
@media (max-width: 900px) and (max-aspect-ratio: 1 / 1) {
  .player-frame { position: sticky; top: var(--h-header); z-index: 20; }
}

@media (max-width: 560px) {
  :root { --h-header: 52px; }
  /* 40px の見出しは 390px の画面で1文字だけ次行に落ちる（「このサイトについ／て」） */
  .read h1 { font-size: var(--text-headline); }
  .page-head h1 { font-size: var(--text-title); }
  /* 全チャンネル一覧: SP では掲載理由の列を落として、表を横スクロールさせずに読めるようにする
     （掲載理由はチャンネルを選んだときにプレーヤーの下に出る） */
  table.rows th:nth-child(4), table.rows td:nth-child(4) { display: none; }
  table.rows th:nth-child(2), table.rows td.cat { display: none; }
  table.rows td.name .sub { display: block; }
  .site-nav { gap: var(--gap); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
