/* =========================================================
   Anime Guide — design system
   Palette (spec §13): Dark #111827 · Primary Red #E60012 ·
   Accent Blue #2563EB · Light Gray #F3F4F6 · Text #111827
   Mobile-first, generous whitespace, low information density.
   ========================================================= */

:root {
  --dark: #111827;
  --dark-2: #1b2536;
  --primary: #E60012;
  --primary-d: #c4000f;
  --accent: #2563EB;
  --light-gray: #F3F4F6;
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e5e7eb;
  --white: #ffffff;
  --bg: #ffffff;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17,24,39,.06), 0 1px 3px rgba(17,24,39,.08);
  --shadow: 0 6px 20px rgba(17,24,39,.10);
  --shadow-lg: 0 18px 48px rgba(17,24,39,.16);
  --container: 1200px;

  --font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--text);
  background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.01em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: .18s ease;
  white-space: nowrap;
}
.btn--sm { padding: 8px 14px; font-size: 13.5px; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-d); transform: translateY(-1px); }
.btn--ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--dark); }
.btn--dark { background: var(--dark); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn--outline:hover { background: var(--accent); color: #fff; }

/* ---------------- header ---------------- */
.header { position: sticky; top: 0; z-index: 50; background: var(--dark); color: #fff; }
.header__inner { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.brand__anime { color: #fff; }
.brand__guide { color: var(--primary); }
.brand--footer { color: var(--dark); font-size: 20px; }
.brand--footer .brand__anime { color: var(--dark); }

.nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.nav__link {
  padding: 8px 12px; border-radius: 8px; font-size: 14.5px; color: #d1d5db; font-weight: 500;
  transition: .15s;
}
.nav__link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav__link.is-active { color: #fff; }
.nav__link.is-active::after { content: ""; display: block; height: 2px; background: var(--primary); border-radius: 2px; margin-top: 4px; }

.header__tools { display: flex; align-items: center; gap: 12px; }
.header__search { display: inline-flex; align-items: center; gap: 6px; color: #d1d5db; font-size: 14px; }
.header__search:hover { color: #fff; }
.selector { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.08);
  border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.selector__icon { opacity: .7; font-size: 12px; }
.selector select {
  background: transparent; border: 0; color: #fff; font: inherit; font-size: 13px; cursor: pointer; outline: none;
}
.selector select option { color: #111; }

.header__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.header__burger span { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: .2s; }
.header__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__burger.is-open span:nth-child(2) { opacity: 0; }
.header__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- hero ---------------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 75% -10%, rgba(37,99,235,.35), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(230,0,18,.28), transparent 55%),
    linear-gradient(160deg, #0b1120 0%, #111827 45%, #1e293b 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background:
    radial-gradient(2px 2px at 20% 30%, #fff, transparent),
    radial-gradient(2px 2px at 60% 20%, #cfe0ff, transparent),
    radial-gradient(1.5px 1.5px at 80% 60%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 35% 70%, #dbeafe, transparent),
    radial-gradient(1px 1px at 50% 45%, #fff, transparent);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; padding: 74px 20px 64px; max-width: var(--container); margin: 0 auto; }
.hero h1 { font-size: clamp(34px, 5.5vw, 56px); font-weight: 800; letter-spacing: -.03em; }
.hero p { font-size: clamp(15px, 2vw, 18px); color: #cbd5e1; max-width: 560px; margin: 18px 0 26px; }
.hero__search {
  display: flex; max-width: 560px; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.hero__search input { flex: 1; border: 0; padding: 15px 18px; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.hero__search button { border: 0; background: var(--primary); color: #fff; padding: 0 22px; font-size: 18px; cursor: pointer; }
.hero__search button:hover { background: var(--primary-d); }

/* ---------------- sections ---------------- */
.section { padding: 44px 0; }
.section--gray { background: var(--light-gray); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.section__head h2 { font-size: clamp(20px, 3vw, 26px); }
.section__more { color: var(--primary); font-weight: 600; font-size: 14px; white-space: nowrap; }
.section__more:hover { text-decoration: underline; }
.section__sub { color: var(--muted); margin: -6px 0 20px; }

/* ---------------- posters / cards ---------------- */
.poster {
  position: relative; aspect-ratio: var(--r, 2/3); border-radius: var(--radius-sm);
  overflow: hidden; display: grid; place-items: center; color: rgba(255,255,255,.9);
}
.poster__mark { font-size: clamp(24px, 6vw, 40px); font-weight: 800; letter-spacing: .04em; opacity: .85; }
.poster__glow { position: absolute; inset: 0; }

.card { display: block; background: #fff; border-radius: var(--radius); overflow: hidden; position: relative;
  transition: transform .18s ease, box-shadow .18s ease; }
.card--anime, .card--news, .card--event, .card--merch { box-shadow: var(--shadow-sm); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .poster { border-radius: 0; }
.card__body { padding: 12px 14px 16px; }
.card__title { font-size: 15.5px; }
.card__title--sm { font-size: 15px; font-weight: 600; }
.card__meta { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.card__date { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.card__region { color: var(--muted-2); font-size: 12.5px; margin: 4px 0 6px; }
.card__price { color: var(--primary); font-weight: 700; margin: 6px 0 2px; }
.card__ship { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.card--news .card__title, .card--event .card__title { margin-top: 6px; }
.card__thumb { position: relative; }

/* badges */
.badge { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 999px; letter-spacing: .02em; color: #fff; }
.badge--verified { background: rgba(37,99,235,.92); }
.badge--event { background: var(--primary); }
.badge--ended { background: #6b7280; left: auto; right: 10px; }
.badge--sold { background: #6b7280; }

/* service badge chip */
.svc-badge { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 700; color: #fff;
  background: var(--c, #333); padding: 4px 10px; border-radius: 8px; }

/* ---------------- grids / rails ---------------- */
.grid { display: grid; gap: 18px; }
.grid--posters { grid-template-columns: repeat(2, 1fr); }
.grid--news { grid-template-columns: 1fr; }
.grid--events { grid-template-columns: 1fr; }
.grid--merch { grid-template-columns: repeat(2, 1fr); }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr);
  gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.rail > * { scroll-snap-align: start; }
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 8px; }

/* where-to-watch service tiles (home) */
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.svc-tile { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--dark); color: #fff; border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.svc-tile__name { font-weight: 700; font-size: 15px; }
.svc-tile__all { font-size: 12px; color: #9ca3af; }
.svc-tile__dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------------- breadcrumb ---------------- */
.breadcrumb { font-size: 13px; color: var(--muted); padding: 14px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { color: var(--muted-2); }

/* ---------------- page title band ---------------- */
.pagehead { background: var(--light-gray); padding: 26px 0 30px; }
.pagehead h1 { font-size: clamp(26px, 4vw, 36px); }
.pagehead p { color: var(--muted); margin: 8px 0 0; max-width: 640px; }

/* ---------------- filters ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 15px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--muted); transition: .15s; }
.chip:hover { border-color: var(--dark); color: var(--text); }
.chip.is-active { background: var(--dark); color: #fff; border-color: var(--dark); }
.searchbar { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; background: #fff; max-width: 420px; margin-bottom: 20px; }
.searchbar input { border: 0; outline: none; font: inherit; flex: 1; }

/* ---------------- anime detail ---------------- */
.detail-hero { display: grid; grid-template-columns: 1fr; gap: 22px; padding: 22px 0 8px; }
.detail-hero__art { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.detail-hero__art .poster { border-radius: 0; aspect-ratio: 16/10; }
.detail-hero__title { font-size: clamp(26px, 4vw, 34px); }
.detail-hero__ja { color: var(--muted); font-size: 16px; margin: 6px 0 12px; }
.detail-hero__meta { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.detail-hero__meta b { color: var(--text); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 26px 0 22px; overflow-x: auto; }
.tab { padding: 12px 14px; font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tabpanel { display: none; }
.tabpanel.is-active { display: block; }

.facts { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; margin: 18px 0; font-size: 14.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts a { color: var(--accent); }

/* where-to-watch table */
.watch-panel { background: var(--light-gray); border-radius: var(--radius); padding: 18px; margin-top: 8px; }
.watch-panel__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; flex-wrap: wrap; gap: 6px; }
.watch-panel__head h3 { font-size: 16px; }
.watch-panel__updated { font-size: 12px; color: var(--muted); }
.watch-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.watch-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.watch-table tr:last-child td { border-bottom: 0; }
.watch-table .wt-svc { font-weight: 700; }
.watch-table .wt-type { color: var(--muted); }
.watch-table .wt-lang { color: var(--muted); font-size: 13px; }
.watch-note { font-size: 12.5px; color: var(--muted); margin: 12px 2px 0; }

/* ---------------- article ---------------- */
.article { max-width: 760px; margin: 0 auto; padding: 8px 0 20px; }
.article__meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 10px 0 18px; }
.article__body p { margin: 0 0 16px; }
.sourcebox { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--light-gray);
  border-radius: 8px; padding: 14px 16px; font-size: 13.5px; color: var(--muted); margin: 22px 0; }
.sourcebox b { color: var(--text); }

/* ---------------- info / legal page ---------------- */
.prose { max-width: 780px; margin: 0 auto; }
.prose h2 { font-size: 22px; margin: 34px 0 10px; scroll-margin-top: 80px; }
.prose h3 { font-size: 17px; margin: 20px 0 6px; }
.prose p, .prose li { color: #374151; }
.prose ul { padding-left: 20px; }
.callout { background: var(--light-gray); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; font-size: 14px; color: var(--muted); }

/* ---------------- feature strip (home bottom) ---------------- */
.features { display: grid; grid-template-columns: 1fr; gap: 16px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature__icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--light-gray); font-size: 20px; }
.feature h4 { font-size: 15px; }
.feature p { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }

/* ---------------- misc ---------------- */
.notice { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px;
  padding: 12px 16px; font-size: 13px; margin: 16px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------------- responsive ---------------- */
@media (min-width: 560px) {
  .grid--posters { grid-template-columns: repeat(3, 1fr); }
  .grid--news { grid-template-columns: repeat(2, 1fr); }
  .grid--events { grid-template-columns: repeat(2, 1fr); }
  .grid--merch { grid-template-columns: repeat(3, 1fr); }
  .svc-grid { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .grid--posters { grid-template-columns: repeat(4, 1fr); }
  .grid--news { grid-template-columns: repeat(3, 1fr); }
  .grid--events { grid-template-columns: repeat(3, 1fr); }
  .grid--merch { grid-template-columns: repeat(4, 1fr); }
  .svc-grid { grid-template-columns: repeat(6, 1fr); }
  .features { grid-template-columns: repeat(3, 1fr); }
  .detail-hero { grid-template-columns: 420px 1fr; align-items: start; padding-top: 28px; }
  .detail-hero__art .poster { aspect-ratio: 16/11; }
  .facts { grid-template-columns: 150px 1fr; }
}
@media (min-width: 1040px) {
  .grid--posters { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 900px) {
  .header__burger { display: flex; order: 3; margin-left: auto; }
  .header__tools .header__search span { display: none; }
  .nav {
    position: absolute; top: 62px; left: 0; right: 0; background: var(--dark);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08); display: none; margin: 0;
  }
  .nav.is-open { display: flex; }
  .nav__link { padding: 12px; border-radius: 8px; }
  .nav__link.is-active::after { display: none; }
  .nav__link.is-active { background: rgba(255,255,255,.08); }
  .header__inner { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .header__tools { gap: 6px; }
  .selector { padding: 4px 6px; }
}

/* ---------------- WordPress additions ---------------- */
.poster__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
a.is-external::after { content: " ↗"; font-size: .85em; }
.btn.is-external::after { content: ""; }
.nav .selector select { max-width: 90px; }

/* pagination */
.pagination, .nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.nav-links .page-numbers {
  display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 600; padding: 0 10px;
}
.nav-links .page-numbers.current { background: var(--dark); color: #fff; border-color: var(--dark); }
.nav-links .page-numbers:hover:not(.current) { border-color: var(--dark); }

/* screen-reader text (WP a11y — §13 アクセシビリティ) */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); clip-path: inset(50%); word-wrap: normal;
}

/* ---------------- footer ---------------- */
.footer { background: #fff; border-top: 1px solid var(--line); margin-top: 48px; }
.footer__inner {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px;
  padding-top: 40px; padding-bottom: 28px;
}
.footer__tag { color: var(--gray-3); font-size: 14px; line-height: 1.7; max-width: 380px; margin-top: 10px; }
.footer__cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.footer__cols h4 {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gray-2); margin-bottom: 12px;
}
.footer__cols a {
  display: block; color: var(--gray-3); text-decoration: none;
  font-size: 14px; padding: 4px 0;
}
.footer__cols a:hover { color: var(--dark); }
.footer__bar {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 20px;
  color: var(--gray-2); font-size: 13px;
}
@media (max-width: 720px) {
  .footer__inner { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------------- text-only mode（承認画像なし時 — §15 準拠） ---------------- */
.card--text { border: 1px solid var(--line); box-shadow: none; }
.card--text:hover { border-color: var(--dark); transform: translateY(-2px); }
.card--text .card__body { padding: 18px 16px; }
.card--anime.card--text .card__body { min-height: 148px; display: flex; flex-direction: column; }
.card--anime.card--text .card__meta { margin-top: auto; padding-top: 8px; }
.card__kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 6px;
}
.card__ja { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card__excerpt { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 6px; }
.chipline { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.badge--inline { position: static; display: inline-block; }
.detail-hero--noart { grid-template-columns: 1fr !important; }

/* テキストのみ時はポスターグリッドをリスト状に詰める */
.grid--posters .card--text { border-radius: 12px; }
