/* ============================================================
   松本人志の放送室データベース — base stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
  --bg: #f0e5c5;
  --bg-elevated: #ffffff;
  --bg-sidebar: #f7efd8;
  --text: #2b2823;
  --text-muted: #706a5e;
  --text-faint: #9c9585;
  --border: #e4ddcf;
  --accent: #b5542c;
  --accent-strong: #9a4423;
  --accent-soft: #f3e2d4;
  --link: #8a5a2e;
  --shadow: 0 1px 3px rgba(43, 40, 35, 0.08), 0 1px 2px rgba(43, 40, 35, 0.06);
  --shadow-lg: 0 8px 24px rgba(43, 40, 35, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font-jp: "Noto Sans JP", "Yu Gothic", "游ゴシック", "Hiragino Kaku Gothic ProN", sans-serif;
  --header-h: 64px;
  --sidebar-w: 260px;
}

:root[data-theme="dark"] {
  --bg: #17140f;
  --bg-elevated: #221e17;
  --bg-sidebar: #1c1811;
  --text: #ece6da;
  --text-muted: #b3aa98;
  --text-faint: #7d7566;
  --border: #38312450;
  --accent: #e08a54;
  --accent-strong: #f0a06e;
  --accent-soft: #3a2a1d;
  --link: #e0a870;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f;
    --bg-elevated: #221e17;
    --bg-sidebar: #1c1811;
    --text: #ece6da;
    --text-muted: #b3aa98;
    --text-faint: #7d7566;
    --border: #38312450;
    --accent: #e08a54;
    --accent-strong: #f0a06e;
    --accent-soft: #3a2a1d;
    --link: #e0a870;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-jp);
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.site-header .icon-btn { width: 34px; height: 34px; font-size: 1.05rem; flex-shrink: 0; }
.site-header .hamburger { grid-column: 1; justify-self: start; }
.site-header .brand { grid-column: 2; justify-self: center; }
.site-header .header-spacer { display: none; }
.site-header [data-theme-toggle] { grid-column: 3; justify-self: end; }

@media (min-width: 480px) {
  .site-header { gap: 12px; padding: 10px 16px; }
  .site-header .icon-btn { width: 40px; height: 40px; font-size: 1.2rem; }
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 0;
  justify-content: center;
}
.brand:hover { text-decoration: none; }
.brand-title {
  font-weight: 900;
  font-size: clamp(1rem, 4.8vw, 1.15rem);
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.3;
  text-align: center;
}
@media (min-width: 1024px) {
  .brand-title { font-size: 1.35rem; }
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
}
.icon-btn:hover { background: var(--accent-soft); }

.hamburger { display: inline-flex; }
@media (min-width: 1024px) {
  .hamburger { display: none; }
}

/* ---------- Layout ---------- */

.layout {
  display: flex;
  align-items: flex-start;
  max-width: 1180px;
  margin: 0 auto;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--header-h));
  padding: 24px 16px 40px;
  display: none;
}
@media (min-width: 1024px) {
  .sidebar { display: block; position: sticky; top: var(--header-h); }
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 20px 60px;
}

.nav-section { margin-bottom: 28px; }
.nav-heading {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 0 0 8px 4px;
  font-weight: 700;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 2px 0; }
.nav-list a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.92rem;
}
.nav-list a:hover, .nav-list a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-decoration: none;
}
.nav-years { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-years a {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text);
}
.nav-years a:hover { background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; }

/* Mobile drawer */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 60;
}
.drawer-overlay.open { display: block; }

@media (max-width: 1023px) {
  .sidebar.drawer {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    padding-top: calc(var(--header-h) + 16px);
  }
  .sidebar.drawer.open { transform: translateX(0); }
}

/* ---------- Typography blocks ---------- */

h1, h2, h3, h4 { font-family: var(--font-jp); line-height: 1.5; }
.page-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 0 0 6px;
}
.page-lead {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 0.95rem;
}

.prose p { margin: 0 0 1em; }

/* ---------- Cards ---------- */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.intro-card { margin-bottom: 24px; }
.intro-card p { margin: 0 0 0.9em; color: var(--text); }
.intro-card p:last-child { margin-bottom: 0; }

.personality-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
@media (min-width: 640px) {
  .personality-grid { grid-template-columns: 1fr 1fr; }
}
.personality-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.personality-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--accent-strong);
}
.personality-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 36px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.section-title:first-child { margin-top: 0; }

.link-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 8px;
}
@media (min-width: 640px) {
  .link-grid { grid-template-columns: 1fr 1fr; }
}
.link-card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.link-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.link-card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--accent-strong); }
.link-card p { margin: 0; font-size: 0.88rem; color: var(--text-muted); }

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.year-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 700;
}
.year-chip:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }
.year-chip .count { font-weight: 400; font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Episode list (database.html) ---------- */

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  position: sticky;
  top: var(--header-h);
  background: var(--bg);
  padding: 12px 0;
  z-index: 10;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-jp);
  font-size: 0.98rem;
  outline: none;
}
.search-box input::placeholder { color: var(--text-faint); }
.result-count { font-size: 0.82rem; color: var(--text-muted); }

.filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: var(--font-jp);
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ep-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.ep-item-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ep-num {
  font-weight: 900;
  color: var(--accent-strong);
  font-size: 0.95rem;
  white-space: nowrap;
}
.ep-title { font-weight: 700; font-size: 1rem; }
.ep-date { font-size: 0.78rem; color: var(--text-faint); margin-left: auto; white-space: nowrap; }
.ep-excerpt { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.ep-song { margin-top: 8px; font-size: 0.82rem; color: var(--text-faint); }
.ep-song .note { color: var(--accent); }
.no-results { text-align: center; color: var(--text-muted); padding: 40px 0; display: none; }
.no-results.show { display: block; }

/* ---------- Year page episode blocks ---------- */

.year-nav-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}
.year-nav-strip a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-elevated);
}
.year-nav-strip a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.ep-jump-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
  max-height: 160px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ep-jump-list a {
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
}
.ep-jump-list a:hover { color: var(--accent-strong); border-color: var(--accent); text-decoration: none; }

.ep-block {
  scroll-margin-top: calc(var(--header-h) + 12px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.ep-block-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.ep-block-num {
  font-size: 0.8rem;
  font-weight: 900;
  color: #fff;
  background: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
}
.ep-block-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.ep-block-date { font-size: 0.78rem; color: var(--text-faint); margin-left: auto; }
.ep-block h4 {
  font-size: 0.95rem;
  margin: 16px 0 4px;
  color: var(--accent-strong);
}
.ep-block p { margin: 0 0 0.7em; font-size: 0.92rem; color: var(--text); }
.ep-song-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.ep-song-row .label { color: var(--accent); font-weight: 700; margin-right: 6px; }

/* ---------- Song list ---------- */

.song-table-wrap { overflow-x: auto; }
table.song-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}
table.song-table th, table.song-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.song-table th {
  background: var(--bg-sidebar);
  font-size: 0.78rem;
  color: var(--text-muted);
  position: sticky;
  top: 0;
}
table.song-table td.song-title-cell, table.song-table td.artist-cell { white-space: normal; }
table.song-table tbody tr:hover { background: var(--accent-soft); }
table.song-table td a { white-space: nowrap; }

/* ---------- Affiliate / Audible CTA ---------- */

.audible-cta {
  margin: 32px 0;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.audible-cta h3 { margin: 0 0 6px; font-size: 1.05rem; }
.audible-cta p { margin: 0 0 14px; color: var(--text-muted); font-size: 0.9rem; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}
.btn:hover { background: var(--accent-strong); color: #fff; text-decoration: none; }

.disk-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.disk-list a {
  display: block;
  text-align: center;
  padding: 8px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.disk-list a:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }

/* ---------- Ad slot ---------- */

.ad-slot {
  margin: 28px 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sidebar);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 0.78rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px 40px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
}
.site-footer a { color: var(--text-muted); }
.footer-links { margin: 0 0 10px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Static page prose ---------- */

.static-page h2 { font-size: 1.1rem; margin: 28px 0 10px; }
.static-page h3 { font-size: 0.98rem; margin: 20px 0 8px; color: var(--accent-strong); }
.static-page p, .static-page li { color: var(--text); font-size: 0.94rem; }
.static-page ul, .static-page ol { padding-left: 1.4em; }
.static-page p { margin: 0 0 1em; }

.article-content a { color: #1a73e8; }
.article-content a:hover { color: #0d47a1; }
:root[data-theme="dark"] .article-content a { color: #8ab4f8; }
:root[data-theme="dark"] .article-content a:hover { color: #aecbfa; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .article-content a { color: #8ab4f8; }
  :root:not([data-theme="light"]) .article-content a:hover { color: #aecbfa; }
}

.article-content h2 {
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0;
  margin: 40px 0 20px;
  font-size: 1.05rem;
}
.article-content h3 {
  position: relative;
  color: var(--accent-strong);
  padding: 2px 0 10px;
  margin: 26px 0 14px;
  font-size: 0.95rem;
}
.article-content h3::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}
