/* anisong.jp — 番組表のように見やすいアニソン事典。
   CSP（style-src 'self'）で style 属性が使えないため、見た目はすべてここで付ける */

:root {
  --ink: #15171c;
  --ink-2: #3c4250;
  --muted: #5a6172;
  --line: #e3e5ea;
  --line-strong: #c5cbd6;
  --panel: #f4f5f7;
  --ground: #ffffff;
  --op: #2f4bd8;
  --ed: #b4400f;
  --in: #0e7468;
  --op-tint: #e9ecfb;
  --ed-tint: #f7ebe4;
  --ed-tint-2: #f0d9cc;
  --in-tint: #e3f1ef;
  --radius: 12px;
  --gutter: clamp(16px, 4vw, 24px);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', Meiryo, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--op);
}
a:hover {
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--op);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.35;
}
h1 {
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 800;
}
h2 {
  font-size: 22px;
  font-weight: 800;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.nowrap {
  white-space: nowrap;
}
.lead {
  font-size: 17px;
  margin: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ヘッダー・フッター */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--ground);
}
.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.logo-ground {
  fill: var(--ink);
}
.logo-op {
  fill: var(--op);
}
.logo-ed {
  fill: var(--ed);
}
.logo-text {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.logo-tld {
  color: var(--muted);
  font-weight: 600;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 22px;
  font-size: 15px;
  font-weight: 600;
}
.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}
@media (max-width: 480px) {
  .site-nav {
    gap: 0 14px;
    font-size: 14px;
  }
}
.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.site-footer {
  margin-top: 72px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px 48px;
  padding-top: 32px;
  padding-bottom: 40px;
}
.site-footer-about {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer-about p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}
.site-footer-about p.muted {
  color: var(--muted);
}
.site-footer-nav {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.site-footer-nav a {
  color: var(--ink);
  padding: 6px 0;
}

/* トップの見出し・検索 */
.hero {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: clamp(32px, 6vw, 64px);
  padding-bottom: clamp(32px, 5vw, 48px);
}
.eyebrow {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.hero-title {
  font-size: clamp(26px, 4.4vw, 46px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.search {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-label {
  font-size: 14px;
  font-weight: 700;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: var(--ground);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--muted);
}
.search-box:focus-within {
  outline: 3px solid var(--op);
  outline-offset: 2px;
}
.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
}
.search-input::-webkit-search-cancel-button {
  cursor: pointer;
}
.search-panel {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 8px 24px rgba(21, 23, 28, 0.08);
}
.search-panel[hidden] {
  display: none;
}
.search-group-label {
  margin: 8px 12px 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}
.search-item:hover,
.search-item:focus-visible {
  background: var(--panel);
  color: var(--ink);
}
.search-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.4;
}
.search-item-title {
  font-size: 16px;
  font-weight: 700;
}
.search-item-sub {
  font-size: 13px;
  color: var(--muted);
}
.search-empty {
  margin: 12px;
  font-size: 14px;
  color: var(--muted);
}
.search-more {
  display: block;
  margin: 4px 12px 8px;
  font-size: 14px;
  font-weight: 700;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin: 8px 0 0;
}
.stats dt {
  font-size: 13px;
  color: var(--muted);
}
.stats dd {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stats-compact {
  gap: 12px 28px;
  margin: 0;
}

/* 見出し付きの区画 */
.section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 52px;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}
.section-head h2 {
  font-size: 26px;
}
.section-head p {
  margin: 4px 0 0;
  font-size: 15px;
}
.section-head h2 a {
  color: var(--ink);
  text-decoration: none;
}
.section-head h2 a:hover {
  color: var(--op);
  text-decoration: underline;
}
.more {
  align-self: flex-start;
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.pills,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.pill[aria-current='page'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 700;
}
.pill-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pill[aria-current='page'] .pill-count {
  color: #fff;
}
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}
.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

/* OP / ED / 挿入歌の札 */
.tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.tag-op {
  color: var(--op);
  background: var(--op-tint);
}
.tag-ed {
  color: var(--ed);
  background: var(--ed-tint);
}
.tag-in {
  color: var(--in);
  background: var(--in-tint);
}
.tag-neutral {
  color: var(--ink-2);
  background: #eef0f3;
}
.tag-person {
  min-width: 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
}
.type-op {
  color: var(--op);
}
.type-ed {
  color: var(--ed);
}
.type-in {
  color: var(--in);
}

/* 作品カード */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 14px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.card-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: none;
}
.card-title:hover {
  text-decoration: underline;
}
.card-head .small {
  flex: none;
}
.theme-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.theme-line .tag {
  margin-top: 1px;
}
.theme-line-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.4;
}
.theme-line-song {
  font-size: 15px;
  font-weight: 600;
}
.theme-line-song a,
.row-title a,
.credit {
  color: inherit;
  text-decoration: none;
}
.theme-line-song a:hover,
.row-title a:hover,
.credit:hover {
  text-decoration: underline;
  color: var(--op);
}

/* 一覧の行 */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}
.row:last-child {
  border-bottom: 0;
}
.row:target {
  background: var(--op-tint);
}
.row-main {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.45;
}
.row-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
a.row-title {
  text-decoration: none;
}
a.row-title:hover {
  text-decoration: underline;
  color: var(--op);
}
.row-sub {
  font-size: 14px;
  color: var(--ink-2);
}
a.row-sub {
  color: var(--muted);
  text-decoration: none;
}
.variant {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* グラフ */
.chart-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.chart-box p {
  margin: 0;
}
.chart-title {
  font-size: 15px;
  margin-bottom: 6px;
}
.bar-chart {
  display: block;
  width: 100%;
  border-bottom: 1px solid var(--line-strong);
}
.bar-chart-160 {
  height: 160px;
}
.bar-chart-100 {
  height: 100px;
}
.bar {
  fill: var(--line-strong);
}
.bar-on {
  fill: var(--op);
}
a:hover .bar,
a:focus .bar {
  fill: var(--ink);
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 個別ページ */
.page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 20px;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
}
.crumbs [aria-current='page'] {
  color: var(--ink);
}
.title-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.title-block p {
  margin: 0;
}
.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
}
.meta-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
a.meta-pill:hover {
  background: var(--line);
}
.with-aside {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}
.with-aside-main {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.with-aside-side {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.with-aside-side p {
  margin: 0;
}
.block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.side-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.side-box h2 {
  font-size: 16px;
}
.facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
}
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.link-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
}

/* 話数ごとの主題歌 */
.matrix-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.matrix {
  border-collapse: separate;
  border-spacing: 4px;
  padding: 10px;
  min-width: 100%;
  table-layout: fixed;
}
.matrix-col-label {
  width: 3rem;
}
.matrix th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.matrix .matrix-corner {
  text-align: left;
  font-weight: 400;
}
.matrix .matrix-type {
  text-align: left;
  font-weight: 800;
}
.matrix-cell {
  border-radius: 6px;
  padding: 0;
  vertical-align: top;
}
.matrix-cell a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 6px 8px;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
}
.cell-op {
  background: var(--op-tint);
}
.cell-ed {
  background: var(--ed-tint);
}
.cell-ed.alt {
  background: var(--ed-tint-2);
}
.cell-in {
  background: var(--in-tint);
}
.matrix-slug {
  font-size: 11px;
  font-weight: 800;
}
.cell-op .matrix-slug {
  color: var(--op);
}
.cell-ed .matrix-slug {
  color: var(--ed);
}
.cell-in .matrix-slug {
  color: var(--in);
}
.matrix-song {
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.matrix-empty {
  background: repeating-linear-gradient(45deg, var(--panel), var(--panel) 4px, var(--ground) 4px, var(--ground) 8px);
  border-radius: 6px;
}

/* 配信サービスへのリンク */
.stream {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.stream-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.stream-link:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.stream-large .stream-link {
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

/* アーティスト */
.artist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.artist-name {
  display: flex;
  align-items: center;
  gap: 18px;
}
.artist-name p {
  margin: 4px 0 0;
}
.avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
}
.timeline {
  border-top: 1px solid var(--line);
}
.timeline-year {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}
.timeline-year h3 {
  flex: 0 0 72px;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
.timeline-year ul {
  flex: 1 1 420px;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.timeline-season {
  flex: none;
  width: 1.5em;
}
.artist-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 8px;
}
.artist-card {
  display: flex;
  flex-direction: column;
  min-height: 64px;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}
.artist-card:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.artist-card-name {
  font-weight: 700;
}

/* 年の一覧 */
.title-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2 320px;
  column-gap: 32px;
}
.title-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding: 6px 0;
  break-inside: avoid;
  border-bottom: 1px solid var(--line);
}
.title-list a {
  font-weight: 600;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 700;
}
.pager a {
  display: flex;
  align-items: center;
  min-height: 44px;
}

/* 文章ページ */
.prose {
  max-width: 760px;
}
.prose p,
.prose ul {
  margin: 0;
}
.prose li + li {
  margin-top: 6px;
}
.prose h2 {
  margin-top: 12px;
  scroll-margin-top: 16px;
}
