/*
 * 公開サイト(視聴者向け)。放送画面のPopテーマに似せる。
 * 配色: クリームの背景 + 濃紺の文字 + ピンクと青(一覧では交互)+ 黄。
 * 書体: 本文は Noto Sans JP の400、見出しは Zen Kaku Gothic New の700。
 * Why not 放送画面と同じ M PLUS Rounded 1c(500): 配信の大きな字幕ではよいが、公開サイトの小さい文字では、太く詰まって見えた。
 * 丸ゴシックの雰囲気は、角の丸い枠・吹き出し・ラベルで残している。
 * 構図: 角を丸め、枠は太い濃紺、面には色のついた影(放送画面の「画像と字幕に太い影付きの面」と同じ)。
 * ダークモードは持たない(放送画面がPop固定のため、サイトも明るい配色に固定する)。
 */
:root {
  --bg: #fff6e4;
  --panel: #ffffff;
  --ink: #1f1b3b;
  /* 枠と線の色。文字や塗りの --ink より少し薄くして、細い線や枠が強く出すぎないようにする */
  --line: #4a4575;
  --muted: #4d4872;
  --accent: #ff4f87;
  --accent-b: #2f7df6;
  --yellow: #ffd23f;
  --rule: rgba(31, 27, 59, 0.18);
  --main-bubble: #ffd9e6;
  --sub-bubble: #fff0b3;
  --radius: 20px;
  --font-head: "Zen Kaku Gothic New", "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", sans-serif;
  /* 本文は Noto Sans JP の400。丸ゴシック(M PLUS Rounded 1c)の500は、小さい文字で太く詰まって見えたため。 */
  --font-body: "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 400 16px/1.8 var(--font-body); letter-spacing: 0.02em; min-height: 100vh; display: flex; flex-direction: column; }
/* 本文が短いページでも、フッターを画面の下端に置く */
body > main { flex: 1 0 auto; width: 100%; }
body > .site-footer { flex-shrink: 0; }
a { color: var(--accent-b); }
.muted { color: var(--muted); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー: 濃紺の帯 */
.site-header { background: var(--ink); color: #fff; border-bottom: 5px solid var(--accent); }
.site-title { display: flex; align-items: baseline; gap: 10px; max-width: 880px; margin: 0 auto; padding: 14px 16px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: 0.08em; font-size: 20px; }

#app { padding-top: 24px; padding-bottom: 40px; }
h1 { font: 700 26px/1.4 var(--font-head); margin: 8px 0 6px; }
h2 { font: 700 18px/1.4 var(--font-head); margin: 32px 0 12px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.lead { color: var(--muted); margin: 4px 0 16px; font-size: 14px; }

/* 「いま放送中」の見出し: 脈打つ点つき */
.on-air { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.on-air::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.6); opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .on-air::before { animation: none; } }

/* 配信(YouTube)の埋め込み */
.player { aspect-ratio: 16 / 9; width: 100%; border: 6px solid var(--line); border-radius: var(--radius); box-shadow: 10px 10px 0 var(--accent); overflow: hidden; background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-note { margin: 14px 0 0; font-size: 13px; text-align: right; }

/* 日付の一覧: ピンクと青の影を交互に */
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.days a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background: var(--panel); border: 3px solid var(--line); border-radius: 16px; box-shadow: 5px 5px 0 var(--accent); color: var(--ink); text-decoration: none; font-weight: 700; transition: transform 0.12s, box-shadow 0.12s; }
.days li:nth-child(even) a { box-shadow: 5px 5px 0 var(--accent-b); }
.days a:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--accent); }
.days li:nth-child(even) a:hover { box-shadow: 7px 7px 0 var(--accent-b); }
.days .count { color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; }

/* 1日の一覧 */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 14px 0 18px; }
.daynav { display: flex; gap: 10px; }
.daynav a { font-size: 13px; font-weight: 700; color: var(--ink); background: var(--yellow); border: 3px solid var(--line); border-radius: 999px; padding: 3px 16px; text-decoration: none; }
.daynav .off { visibility: hidden; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }

/* 1日の一覧: 時間帯(放送を始めた「時」)ごとの区切り。左の縦の線に沿って、ラベルと放送が並ぶ。ラベルは時間帯の終わり(16時台なら 17:00) */
.timeline { margin-top: 8px; }
.hour-group { margin-left: 8px; padding: 8px 0 18px 22px; border-left: 4px solid var(--line); }
/* ラベル(文字)・丸・横線の縦の中心をそろえる。丸と線は、この見出しの箱の中心(50%)に置く。
   文字は、書体によって数字の見た目の中心が行の箱の中心から数px下にずれる(Zen Kaku Gothic New の20pxで約1px)ので、
   下の @supports で、行の上下の余白を数字の高さまで切り詰めて、見た目の中心を箱の中心に一致させる。 */
.hour { position: relative; display: flex; align-items: center; gap: 12px; margin: 6px 0 16px; font: 700 20px/1.2 var(--font-head); letter-spacing: 0.04em; }
/* 縦の線の上に、ラベルの位置を示す丸 */
.hour::before { content: ""; position: absolute; left: -33px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; background: var(--accent); border: 3px solid var(--line); }
/* 太さは、縦の線(4px)と同じ。偶数にして、箱の中心に置いたときに、半端な位置にならないようにする */
.hour::after { content: ""; flex: 1; max-width: 240px; height: 4px; border-radius: 2px; background: var(--line); }
/* 文字を span で包んで、その箱の上下を数字の高さに切り詰める。見出し(.hour)は flex なので、中の文字そのものは切り詰めの対象にならない。 */
@supports (text-box: trim-both cap alphabetic) {
  .hour-text { text-box: trim-both cap alphabetic; }
}
/* 切り詰めに対応していないブラウザ向け: 測った分(Zen Kaku Gothic New の20pxで、数字の中心が箱の中心より約1px下)だけ、文字を上に戻す */
@supports not (text-box: trim-both cap alphabetic) {
  .hour-text { position: relative; top: -1px; }
}

.item { display: grid; grid-template-columns: 128px 1fr; gap: 14px; padding: 12px; background: var(--panel); border: 3px solid var(--line); border-radius: 18px; box-shadow: 5px 5px 0 var(--accent); color: var(--ink); text-decoration: none; transition: transform 0.12s, box-shadow 0.12s; }
.items li:nth-child(even) .item { box-shadow: 5px 5px 0 var(--accent-b); }
.item:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--accent); }
.items li:nth-child(even) .item:hover { box-shadow: 7px 7px 0 var(--accent-b); }
.item .body { min-width: 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 700; }
.item .telop { font: 700 17px/1.5 var(--font-head); margin: 3px 0; overflow-wrap: anywhere; }
.item .src { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
/* トップの「いま放送中」は、少し大きく */
.items.featured .item { grid-template-columns: 200px 1fr; box-shadow: 8px 8px 0 var(--accent); }
.items.featured .item .telop { font-size: 21px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.7; padding: 0 10px; border-radius: 999px; color: #fff; background: var(--ink); letter-spacing: 0.04em; }
.badge.summary { background: var(--accent-b); }
.badge.corner { background: var(--yellow); color: var(--ink); }
.badge.live { background: var(--accent); }
.badge.partial { background: transparent; color: var(--ink); border: 2px solid var(--line); line-height: 1.5; }

/* サムネイル。画像が無い・読めないときは、枠だけ残して代わりの表示にする */
.thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--rule); border: 2px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.empty::after { content: "NO IMAGE"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }

/* 詳細 */
.card { background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--accent-b); padding: 18px; margin: 20px 0; }
.card .thumb { max-width: 480px; margin-bottom: 14px; }
.card .title { font: 700 18px/1.5 var(--font-head); margin: 0 0 4px; overflow-wrap: anywhere; }
.card .origin { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.summary h3 { font: 700 15px/1.5 var(--font-head); margin: 16px 0 4px; }
.summary p { margin: 8px 0; overflow-wrap: anywhere; }
.summary ul { margin: 4px 0 8px; padding-left: 1.4em; }
.summary li { margin: 3px 0; overflow-wrap: anywhere; }
.summary li::marker { color: var(--accent); }
.open { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 700; }

/* 文字起こし(吹き出し) */
.script { display: grid; gap: 16px; margin-top: 8px; }
/* メインもサブも、アイコンを左にそろえる(文章の始まりが縦にそろって読みやすい)。話者は、アイコンと吹き出しの色で見分ける */
.row { display: flex; align-items: flex-start; gap: 10px; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; border: 3px solid var(--line); background: var(--main-bubble); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink); }
.row.sub .avatar { background: var(--sub-bubble); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.msg { max-width: calc(100% - 68px); min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.bubble { display: inline-block; text-align: left; padding: 9px 16px; border: 3px solid var(--line); border-radius: 18px; line-height: 1.8; font-weight: 400; background: var(--main-bubble); overflow-wrap: anywhere; }
.row.sub .bubble { background: var(--sub-bubble); }
.topic { justify-self: start; font: 700 13px/1.6 var(--font-head); color: #fff; background: var(--accent-b); padding: 1px 14px; border-radius: 999px; margin-top: 8px; }

.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sources li { font-size: 14px; overflow-wrap: anywhere; }
.sources .domain { color: var(--muted); font-size: 12px; }

/* フッター */
.site-footer { background: var(--ink); color: #d9d6ee; font-size: 12px; padding: 14px 0 18px; border-top: 5px solid var(--accent); }
.site-footer p { margin: 5px 0; }
.site-footer a { color: #fff; }
.site-footer #copyright { color: #fff; font-weight: 700; }
.site-footer #owner:not(:empty) { margin-right: 1.5em; }

@media (max-width: 560px) {
  .hour-group { padding-left: 16px; }
  .hour::before { left: -27px; }
  .item, .items.featured .item { grid-template-columns: 96px 1fr; gap: 10px; padding: 10px; }
  .items.featured .item .telop { font-size: 18px; }
  .player { border-width: 4px; box-shadow: 6px 6px 0 var(--accent); }
  h1 { font-size: 22px; }
}
