/* ================================================================
   R&R SIGNAL
   ニュースアプリ型のレイアウト。白地・不透明度でつくる文字階層・
   青のシステムカラー・カテゴリごとの原色チップ。
   参照: SmartNews の配色と情報密度
   ================================================================ */

:root {
  /* 面 */
  --ground: #ffffff;
  --surface: #f5f6f7;
  --surface-2: #eceef0;
  --line: rgba(0, 0, 0, .10);
  --line-strong: rgba(0, 0, 0, .18);

  /* 文字（濃さは色ではなく不透明度で刻む） */
  --ink: rgba(0, 0, 0, .87);
  --ink-2: rgba(0, 0, 0, .60);
  --ink-3: rgba(0, 0, 0, .40);
  --ink-inv: rgba(255, 255, 255, .95);

  /* システムカラー */
  --brand: #0099eb;
  --brand-deep: #0077bd;
  --brand-wash: rgba(0, 153, 235, .08);

  /* カテゴリ */
  --cat-ai: #0099eb;
  --cat-pqc: #fb9200;
  --cat-sec: #fd4749;

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Hiragino Kaku Gothic ProN',
          'Noto Sans JP', 'Yu Gothic UI', Meiryo, sans-serif;

  --feed-w: 960px;
  --read-w: 700px;
  --header-h: 52px;
  --tabs-h: 46px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #15181c;
    --surface: #1d2126;
    --surface-2: #262b31;
    --line: rgba(255, 255, 255, .12);
    --line-strong: rgba(255, 255, 255, .22);
    --ink: rgba(255, 255, 255, .92);
    --ink-2: rgba(255, 255, 255, .64);
    --ink-3: rgba(255, 255, 255, .44);
    --brand: #4db8f5;
    --brand-deep: #7cc9f8;
    --brand-wash: rgba(77, 184, 245, .12);
  }
}
:root[data-theme="dark"] {
  --ground: #15181c; --surface: #1d2126; --surface-2: #262b31;
  --line: rgba(255,255,255,.12); --line-strong: rgba(255,255,255,.22);
  --ink: rgba(255,255,255,.92); --ink-2: rgba(255,255,255,.64); --ink-3: rgba(255,255,255,.44);
  --brand: #4db8f5; --brand-deep: #7cc9f8; --brand-wash: rgba(77,184,245,.12);
}
:root[data-theme="light"] {
  --ground: #ffffff; --surface: #f5f6f7; --surface-2: #eceef0;
  --line: rgba(0,0,0,.10); --line-strong: rgba(0,0,0,.18);
  --ink: rgba(0,0,0,.87); --ink-2: rgba(0,0,0,.60); --ink-3: rgba(0,0,0,.40);
  --brand: #0099eb; --brand-deep: #0077bd; --brand-wash: rgba(0,153,235,.08);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--ground);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.wrap { max-width: var(--feed-w); margin: 0 auto; padding: 0 16px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: var(--header-h);
}
.brand { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.brand-mark {
  font-size: 1.12rem; font-weight: 800; letter-spacing: -.015em;
  color: var(--ink); white-space: nowrap;
}
.brand-mark .amp { color: var(--brand); }
.brand-sub {
  font-size: .68rem; color: var(--ink-3); letter-spacing: .02em; white-space: nowrap;
}
.header-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.header-actions a { font-size: .82rem; color: var(--ink-2); white-space: nowrap; }
.header-actions a:hover { color: var(--brand); }

/* ---------- チャンネルタブ ---------- */
.channels {
  position: sticky; top: var(--header-h); z-index: 55;
  background: var(--ground); border-bottom: 1px solid var(--line);
}
.channels ul {
  display: flex; gap: 0; max-width: var(--feed-w); margin: 0 auto; padding: 0 16px;
  overflow-x: auto; scrollbar-width: none;
}
.channels ul::-webkit-scrollbar { display: none; }
.channels a {
  display: flex; align-items: center; height: var(--tabs-h); padding: 0 15px;
  font-size: .89rem; font-weight: 700; color: var(--ink-3); white-space: nowrap;
  border-bottom: 3px solid transparent; transition: color .15s;
}
.channels a:hover { color: var(--ink-2); }
.channels a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ch, var(--brand)); }
.channels li:nth-child(2) a { --ch: var(--cat-ai); }
.channels li:nth-child(3) a { --ch: var(--cat-pqc); }
.channels li:nth-child(4) a { --ch: var(--cat-sec); }

/* ---------- ページ見出し ---------- */
.page-head { padding: 24px 0 4px; }
.page-head .tagline {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 7px;
}
.page-head h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.4; text-wrap: balance; }
.page-head .lead { margin-top: 8px; color: var(--ink-2); font-size: .87rem; max-width: 66ch; }

/* ---------- フィード ---------- */
main { min-height: 55vh; padding-bottom: 56px; }

.day-group { margin-top: 22px; }
.day-label {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; margin-bottom: 2px;
  font-size: .76rem; font-weight: 700; color: var(--ink-3); letter-spacing: .02em;
}
.day-label strong { color: var(--ink-2); font-size: .82rem; font-variant-numeric: tabular-nums; }
.day-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.card-grid { display: flex; flex-direction: column; }

.card {
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.card:first-child { border-top: 1px solid var(--line); }
.card:hover { background: var(--surface); }
.card-body { padding: 15px 4px 14px; display: flex; align-items: flex-start; gap: 14px; }
.card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.card-kicker { display: flex; align-items: center; gap: 8px; }

/* 図版は記事ごとにコードで生成したもの。装飾なので読み上げからは外す */
.card-thumb {
  width: 96px; height: 96px; flex-shrink: 0;
  border-radius: 6px; background: var(--surface-2);
}
.card h2 {
  font-size: 1.02rem; font-weight: 700; line-height: 1.5; letter-spacing: -.005em;
  color: var(--ink); text-wrap: pretty;
}
.card:hover h2 { color: var(--brand-deep); }
.card p {
  font-size: .84rem; color: var(--ink-2); line-height: 1.68;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; align-items: center; gap: 9px;
  font-size: .74rem; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.card-meta time::after { content: '·'; margin-left: 9px; color: var(--ink-3); }

/* カテゴリチップ */
.cat-tag {
  display: inline-block; flex-shrink: 0;
  font-size: .68rem; font-weight: 700; letter-spacing: .01em;
  padding: 2px 7px; border-radius: 3px; color: #fff; line-height: 1.55;
}
.cat-ai { background: var(--cat-ai); }
.cat-pqc { background: var(--cat-pqc); }
.cat-sec { background: var(--cat-sec); }

.sample-badge {
  display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .08em;
  padding: 2px 6px; border-radius: 3px;
  color: var(--cat-sec); background: rgba(253, 71, 73, .1); border: 1px solid rgba(253, 71, 73, .3);
}

/* ---------- 記事ページ ---------- */
.article-wrap { max-width: var(--read-w); margin: 0 auto; padding: 0 16px; }
.article-head { padding: 26px 0 18px; }
.article-head .kicker { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 13px; }
.article-head .date { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.article-head h1 {
  font-size: 1.62rem; font-weight: 800; line-height: 1.45; letter-spacing: -.015em;
  text-wrap: balance;
}
.article-hero {
  width: 100%; height: auto; aspect-ratio: 1200 / 420;
  border-radius: 8px; background: var(--surface-2); margin-bottom: 20px;
}
.article-dek {
  font-size: .96rem; line-height: 1.8; color: var(--ink-2);
  padding: 14px 16px; background: var(--surface); border-radius: 6px;
}

.article-body { padding: 8px 0 0; }
.article-body h2 {
  font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em;
  margin: 34px 0 13px; padding-left: 11px; border-left: 4px solid var(--brand);
}
.article-body h2:first-child { margin-top: 26px; }
.article-body p { margin-bottom: 1.3em; font-size: .95rem; line-height: 1.92; }
.article-body ul { margin: 0 0 1.3em; }
.article-body li { position: relative; padding-left: 1.05em; margin-bottom: .5em; font-size: .95rem; line-height: 1.85; }
.article-body li::before { content: ''; position: absolute; left: 0; top: .78em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.article-body strong { font-weight: 700; }
.article-body code {
  font-family: ui-monospace, Consolas, Monaco, monospace; font-size: .87em;
  background: var(--surface-2); padding: 2px 5px; border-radius: 3px;
}

/* R&Rの視点 */
.rr-take {
  background: var(--surface); border-radius: 8px;
  padding: 20px 20px 4px; margin: 32px 0;
}
/* 見出しそのものをラベルに仕立てる（読み上げにも残す） */
.rr-take h2 {
  display: inline-block;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  color: #fff; background: var(--ink);
  padding: 3px 10px; border-radius: 3px; border-left: 0;
  margin: 0 0 13px;
}
.rr-take p { font-size: .93rem; }

/* 実務アクション */
.actions { border: 2px solid var(--brand); border-radius: 8px; padding: 20px 20px 8px; margin: 32px 0; }
.actions h2 {
  font-size: 1rem; font-weight: 800; margin: 0 0 15px;
  padding: 0; border: 0; color: var(--brand-deep);
}
.actions ol { counter-reset: act; }
.actions li {
  counter-increment: act; position: relative; padding-left: 30px;
  margin-bottom: 12px; font-size: .92rem; line-height: 1.75;
}
.actions li::before {
  content: counter(act); position: absolute; left: 0; top: .18em;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.quote-block {
  margin: 22px 0; padding: 13px 16px; background: var(--surface); border-radius: 6px;
  font-size: .91rem; color: var(--ink-2); line-height: 1.8;
}
.quote-block cite { display: block; margin-top: 5px; font-size: .76rem; color: var(--ink-3); font-style: normal; }

.sources { margin: 34px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.sources h2 { font-size: .88rem; font-weight: 800; margin-bottom: 11px; color: var(--ink-2); }
.sources li { margin-bottom: 11px; font-size: .86rem; line-height: 1.6; }
.sources a { color: var(--brand); word-break: break-word; }
.sources a:hover { text-decoration: underline; }
.sources .src-name { color: var(--ink-3); font-size: .76rem; }

.tag-list { margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 7px; }
.tag-list span {
  font-size: .76rem; color: var(--ink-2); background: var(--surface);
  padding: 4px 10px; border-radius: 12px;
}

.ai-notice {
  margin: 26px 0 0; padding: 14px 16px; border-radius: 6px;
  background: var(--brand-wash); font-size: .79rem; line-height: 1.75; color: var(--ink-2);
}
.ai-notice strong { color: var(--ink); }
.ai-notice a { color: var(--brand); text-decoration: underline; }

.article-nav { display: flex; gap: 10px; margin: 30px 0 0; }
.article-nav a {
  flex: 1; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px;
  font-size: .84rem; line-height: 1.55; transition: border-color .15s;
}
.article-nav a:hover { border-color: var(--brand); }
.article-nav .dir { display: block; font-size: .7rem; color: var(--ink-3); margin-bottom: 4px; }
.article-nav .next { text-align: right; }

.related { max-width: var(--read-w); margin: 40px auto 0; padding: 0 16px; }
.related h2 { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }

/* ---------- 静的ページ ---------- */
.prose { max-width: var(--read-w); margin: 0 auto; padding: 0 16px; }
.prose h2 {
  font-size: 1.08rem; font-weight: 800; margin: 32px 0 12px;
  padding-left: 11px; border-left: 4px solid var(--brand);
}
.prose h3 { font-size: .96rem; font-weight: 700; margin: 22px 0 8px; }
.prose p { margin-bottom: 1.25em; font-size: .93rem; line-height: 1.9; }
.prose ul { margin: 0 0 1.25em; }
.prose li { position: relative; padding-left: 1.05em; margin-bottom: .45em; font-size: .93rem; line-height: 1.85; }
.prose li::before { content: ''; position: absolute; left: 0; top: .78em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.prose a { color: var(--brand); }
.prose a:hover { text-decoration: underline; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.3em; font-size: .86rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface); font-weight: 700; white-space: nowrap; }

/* ---------- ページャ ---------- */
.pager { display: flex; justify-content: center; gap: 7px; margin-top: 34px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 38px; text-align: center; padding: 8px 12px; border-radius: 6px;
  font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--ink-2);
  border: 1px solid var(--line);
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); font-size: .9rem; }

/* ---------- フッター ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 32px 0 26px; margin-top: 40px; }
.footer-top { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; padding-bottom: 24px; }
.footer-brand .brand-mark { font-size: 1rem; }
.footer-brand p { font-size: .8rem; color: var(--ink-2); margin-top: 8px; max-width: 320px; line-height: 1.75; }
.footer-brand a { color: var(--brand); }
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-links h3 { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.footer-links li { margin-bottom: 7px; font-size: .82rem; color: var(--ink-2); }
.footer-links a:hover { color: var(--brand); }
.footer-bottom {
  padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: .74rem; color: var(--ink-3);
}
.footer-bottom a:hover { color: var(--brand); }

/* ---------- レスポンシブ ---------- */
@media (max-width: 700px) {
  .brand-sub { display: none; }
  .page-head h1 { font-size: 1.24rem; }
  .article-head h1 { font-size: 1.32rem; }
  .card h2 { font-size: .97rem; }
  .card-thumb { width: 76px; height: 76px; }
  .card-body { gap: 11px; }
  .article-nav { flex-direction: column; }
  .article-nav .next { text-align: left; }
  .footer-links { gap: 26px; }
  .prose table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .site-header, .channels, .site-footer, .article-nav, .related, .pager { display: none; } }
