/*
Theme Name: Eromanga Ranking
Theme URI: https://eromanga-ranking.net/
Author: Codex
Description: 同人作品のAPI取り込み、レビュー、年度別ランキングに対応した紹介サイト用テーマ。
Version: 0.4.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: eromanga-ranking
*/

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef2f5;
  --text: #171717;
  --muted: #5f6670;
  --line: #d8dee6;
  --accent: #d3263a;
  --accent-dark: #9d1828;
  --gold: #e7aa24;
  --teal: #2e7d75;
  --ink: #20242a;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(36, 33, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
}

body.age-locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

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

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.notice-strip {
  background: var(--ink);
  color: #fff;
  font-size: 13px;
}

.notice-strip__inner,
.site-header__inner,
.site-main,
.site-footer__inner {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.notice-strip__inner {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 7px 0;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  min-height: 72px;
}

.site-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
}

.site-brand__name {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.site-brand__tagline {
  color: var(--muted);
  font-size: 12px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
  background: var(--surface-soft);
  color: var(--text);
}

.site-search {
  display: flex;
  align-items: center;
}

.site-search input {
  width: 190px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px 0 0 6px;
  padding: 0 10px;
  background: var(--surface);
}

.site-search button {
  min-height: 38px;
  border: 0;
  border-radius: 0 6px 6px 0;
  padding: 0 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.site-main {
  flex: 1;
  padding: 28px 0 48px;
}

.section {
  margin: 0 0 34px;
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.section__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
}

.section__link {
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}

.front-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 22px;
  align-items: start;
}

.hero-panel {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.hero-panel h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.35;
}

.hero-panel p {
  margin: 0 0 18px;
  color: #e7e1d8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.wp-block-button__link,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.button:hover,
.wp-block-button__link:hover {
  background: var(--accent-dark);
  color: #fff;
}

.button--ghost {
  background: #fff;
  color: var(--ink);
}

.button--ghost:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.button--wide {
  width: 100%;
}

.button--border {
  border: 1px solid var(--line);
}

.mini-ledger {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.mini-ledger h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.metric-row:last-child {
  border-bottom: 0;
}

.metric-row strong {
  color: var(--accent);
}

.quick-finder .metric-row {
  color: var(--text);
}

.quick-finder .metric-row:hover {
  color: var(--accent);
}

.mission-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mission-item {
  display: grid;
  gap: 6px;
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

a.mission-item:hover {
  color: var(--text);
  border-color: rgba(211, 38, 58, 0.36);
}

.mission-item strong {
  color: var(--accent-dark);
  font-size: 16px;
}

.mission-item span {
  color: var(--muted);
  font-size: 14px;
}

.front-lead {
  padding-top: 22px;
}

.front-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 18px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.work-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.work-card__thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--surface-soft);
  overflow: hidden;
}

.work-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-card__cover-title {
  display: none;
}

.cover-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 260px;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(211, 38, 58, 0.12), rgba(46, 125, 117, 0.16)),
    var(--surface-soft);
  color: var(--ink);
  text-align: center;
}

.cover-placeholder strong {
  max-width: 14em;
  font-size: 18px;
  line-height: 1.45;
}

.work-card__score {
  position: absolute;
  left: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(23, 23, 23, 0.86);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.work-card__badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.work-card__sample-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.work-card__body {
  padding: 12px;
}

.work-card__title {
  display: -webkit-box;
  min-height: 48px;
  margin: 0 0 8px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 15px;
  line-height: 1.6;
}

.work-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.work-card__category {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  align-items: center;
  margin: 0 0 8px;
  border: 1px solid rgba(46, 125, 117, 0.24);
  border-radius: 6px;
  padding: 0 8px;
  background: rgba(46, 125, 117, 0.08);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.work-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.work-card__cta:hover {
  background: var(--accent);
  color: #fff;
}

.front-work-grid .work-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.front-work-grid .work-card__thumb::after {
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(15, 17, 21, 0.84));
  content: "";
  pointer-events: none;
}

.front-work-grid .work-card__cover-title {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: -webkit-box;
  max-height: 4.7em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.55;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.front-work-grid .work-card__title {
  min-height: 70px;
  -webkit-line-clamp: 3;
}

.front-work-grid .work-card__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chip--hot {
  border-color: rgba(211, 38, 58, 0.22);
  background: rgba(211, 38, 58, 0.08);
  color: var(--accent-dark);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.finder-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.finder-panel .filter-tabs,
.finder-panel .taxonomy-strip,
.finder-panel .json-search {
  margin-bottom: 0;
}

.finder-shortcuts,
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finder-shortcuts a,
.active-filters span,
.active-filters a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.finder-shortcuts a {
  background: var(--ink);
  color: #fff;
}

.finder-shortcuts a:hover {
  background: var(--accent);
  color: #fff;
}

.active-filters span {
  border: 1px solid rgba(211, 38, 58, 0.22);
  background: rgba(211, 38, 58, 0.08);
  color: var(--accent-dark);
}

.active-filters a {
  border: 1px solid var(--line);
  color: var(--muted);
}

.meme-board__head {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.meme-board__head h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.2;
}

.meme-board__head p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-weight: 700;
}

.meme-board__kicker {
  color: var(--accent-dark) !important;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.meme-thread-list {
  display: grid;
  gap: 22px;
}

.meme-thread {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.meme-thread__title {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 8px;
}

.meme-thread__title span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
}

.meme-thread__title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.meme-thread__post {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.meme-thread__terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.meme-thread__terms a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.meme-thread__terms a:hover {
  border-color: rgba(211, 38, 58, 0.42);
  color: var(--accent-dark);
}

.meme-topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.meme-topic {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.meme-topic:hover {
  border-color: rgba(211, 38, 58, 0.34);
}

.meme-topic img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-soft);
}

.meme-topic span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
}

.meme-topic h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}

.meme-topic p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.selection-hero,
.selection-article__head {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin-bottom: 18px;
}

.selection-hero p,
.selection-article__head p {
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.selection-hero h1,
.selection-article__head h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.15;
}

.selection-hero span,
.selection-article__head span {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.75;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.selection-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.selection-card:hover {
  border-color: rgba(211, 38, 58, 0.34);
}

.selection-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-soft);
}

.selection-card span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
}

.selection-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}

.selection-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.selection-list {
  display: grid;
  gap: 16px;
  max-width: 980px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.selection-work {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.selection-work:hover {
  border-color: rgba(211, 38, 58, 0.34);
}

.selection-work img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-soft);
}

.selection-work span {
  display: grid;
  gap: 8px;
}

.selection-work small {
  color: var(--accent-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
}

.selection-work strong {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.45;
}

.selection-work em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.selection-work b {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.75;
}

.selection-closing {
  max-width: 860px;
  margin-top: 22px;
  border-left: 4px solid var(--accent);
  padding: 14px 16px;
  background: var(--surface-soft);
}

.selection-closing p {
  margin: 0;
  font-weight: 800;
  line-height: 1.8;
}

.thread-log {
  display: grid;
  gap: 14px;
  max-width: 900px;
}

.thread-res {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}

.thread-res--question {
  border-color: rgba(46, 125, 117, 0.32);
  background: rgba(46, 125, 117, 0.07);
}

.thread-res__meta {
  margin-bottom: 8px;
  color: #15803d;
  font-size: 13px;
  font-weight: 900;
}

.thread-res p {
  margin: 0;
  line-height: 1.75;
}

.thread-res p + p {
  margin-top: 8px;
}

.thread-res__note {
  color: var(--muted);
  font-size: 14px;
}

.thread-res--reaction {
  margin-left: 28px;
  background: #fffdf7;
}

.thread-res--memo {
  background: var(--surface-soft);
}

.meme-featured-work {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  max-width: 620px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-soft);
}

.meme-featured-work img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
}

.meme-featured-work span {
  display: grid;
  gap: 8px;
}

.meme-featured-work strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
}

.meme-featured-work em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.result-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.json-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0 0 16px;
}

.json-search input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--surface);
}

.price-sale {
  color: var(--accent);
  font-weight: 850;
}

.taxonomy-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.article,
.sidebar-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article {
  padding: 24px;
}

.article h1 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.42;
}

.article h2 {
  margin: 30px 0 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 22px;
}

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

.work-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 0.58fr);
  gap: 22px;
  align-items: start;
  margin: 0 0 24px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.work-hero__image {
  background: var(--surface-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.work-hero__image img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.work-hero__image .cover-placeholder {
  aspect-ratio: 3 / 4;
  min-height: 360px;
}

.score-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.score-panel__main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--surface-soft);
}

.score-value {
  color: var(--accent);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.stars {
  color: var(--gold);
  letter-spacing: 0;
  white-space: nowrap;
}

.score-list {
  margin: 0;
}

.score-list div {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.score-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--accent));
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
}

.detail-table th,
.detail-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.detail-table th {
  width: 120px;
  color: var(--muted);
  font-weight: 800;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}

.trust-strip div {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.trust-strip strong {
  color: var(--ink);
  font-size: 13px;
}

.trust-strip span {
  color: var(--accent-dark);
  font-weight: 900;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.content-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-soft);
  cursor: pointer;
}

.viewer-toolbar {
  position: sticky;
  top: 86px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
}

.viewer-toolbar button {
  cursor: pointer;
}

.content-viewer {
  margin: 0 auto;
}

.content-viewer--vertical {
  display: grid;
  width: min(100%, 920px);
  gap: 14px;
}

.content-viewer--swipe {
  display: grid;
  grid-auto-columns: min(86vw, 760px);
  grid-auto-flow: column;
  gap: 14px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.content-page {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  scroll-snap-align: center;
}

.content-page img {
  width: 100%;
  height: auto;
}

.after-viewer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 22px 0;
}

.related-section {
  margin-top: 28px;
}

.work-grid--related {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sticky-continue {
  position: fixed;
  right: max(16px, calc((100vw - 1160px) / 2));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 48px;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(211, 38, 58, 0.3);
}

.sticky-continue:hover {
  background: var(--accent-dark);
  color: #fff;
}

.sidebar-panel {
  padding: 16px;
  margin-bottom: 18px;
}

.sidebar-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.sidebar-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-list a {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.sidebar-list li:last-child a {
  border-bottom: 0;
  padding-bottom: 0;
}

.muted {
  color: var(--muted);
}

.site-footer {
  margin-top: auto;
  background: var(--ink);
  color: #fff;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 24px 0;
  font-size: 13px;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 18, 16, 0.86);
}

.age-gate.is-active {
  display: flex;
}

.age-gate__panel {
  width: min(460px, 100%);
  border-radius: var(--radius);
  background: #fff;
  padding: 24px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.age-gate__panel h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.age-gate__panel p {
  margin: 0 0 18px;
  color: var(--muted);
}

.age-gate__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 26px 0 0;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.page-numbers.current {
  background: var(--ink);
  color: #fff;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  color: var(--muted);
}

.sitemap-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.sitemap-list a {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  color: var(--text);
  font-weight: 700;
}

.sitemap-list a:hover {
  color: var(--accent);
}

.masterpiece-board {
  display: grid;
  gap: 22px;
}

.masterpiece-hero {
  display: grid;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.masterpiece-hero p {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

.masterpiece-hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}

.masterpiece-hero span,
.masterpiece-note {
  color: var(--muted);
  line-height: 1.8;
}

.tier-strip,
.year-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tier-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.tier-strip b {
  color: var(--text);
}

.year-masterpiece-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.year-masterpiece-card {
  display: grid;
  gap: 8px;
  min-height: 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.year-masterpiece-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}

.year-masterpiece-card span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.year-masterpiece-card strong {
  font-size: 22px;
}

.year-masterpiece-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.7;
}

.masterpiece-list {
  display: grid;
  gap: 10px;
}

.masterpiece-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.masterpiece-row__cover img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}

.masterpiece-row__body {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.masterpiece-row__top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.masterpiece-row__top span,
.masterpiece-row__top b {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.masterpiece-row__top span {
  background: var(--soft);
  color: var(--accent);
}

.masterpiece-row__top b {
  background: var(--text);
  color: #fff;
}

.masterpiece-row h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
}

.masterpiece-row h2 a {
  color: inherit;
  text-decoration: none;
}

.masterpiece-row p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.masterpiece-row p span {
  display: inline-flex;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

@media (max-width: 980px) {
  .site-header__inner,
  .front-grid,
  .content-layout,
  .work-hero,
  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .site-nav ul {
    justify-content: start;
  }

  .site-search input {
    width: 100%;
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mission-strip {
    grid-template-columns: 1fr;
  }

  .article.product-detail {
    padding-left: 0;
    padding-right: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .article.product-detail > h1,
  .article.product-detail > .breadcrumb,
  .article.product-detail > h2,
  .article.product-detail > p,
  .article.product-detail > .work-hero,
  .article.product-detail > .trust-strip,
  .article.product-detail > .detail-table,
  .article.product-detail > .viewer-toolbar,
  .article.product-detail > .after-viewer-cta,
  .article.product-detail > .related-section,
  .article.product-detail > .operator-memo {
    width: min(100% - 24px, 860px);
    margin-left: auto;
    margin-right: auto;
  }

  .content-viewer--vertical {
    width: 100%;
    gap: 8px;
  }

  .content-page {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .content-viewer--swipe {
    grid-auto-columns: min(92vw, 720px);
    padding-left: 12px;
    padding-right: 12px;
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-grid--related {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .year-masterpiece-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .selection-work {
    grid-template-columns: 150px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .notice-strip__inner {
    display: grid;
    gap: 4px;
  }

  .site-header {
    position: static;
  }

  .site-main {
    padding-top: 20px;
  }

  .hero-panel,
  .article {
    padding: 18px;
  }

  .hero-panel h1,
  .article h1 {
    font-size: 24px;
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .work-card__body {
    padding: 10px;
  }

  .work-card__title {
    min-height: 68px;
    font-size: 13px;
    line-height: 1.55;
    -webkit-line-clamp: 3;
  }

  .work-card__meta {
    font-size: 11px;
  }

  .front-work-grid .work-card__cover-title {
    left: 8px;
    right: 8px;
    bottom: 8px;
    font-size: 12px;
    line-height: 1.5;
  }

  .front-work-grid .work-card__title {
    min-height: 78px;
    font-size: 13px;
    -webkit-line-clamp: 4;
  }

  .score-list div {
    grid-template-columns: 92px 1fr auto;
  }

  .json-search {
    grid-template-columns: 1fr;
  }

  .finder-panel {
    margin-left: -2px;
    margin-right: -2px;
    padding: 12px;
  }

  .finder-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finder-shortcuts a {
    justify-content: center;
  }

  .meme-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .year-masterpiece-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .masterpiece-row {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
  }

  .masterpiece-row h2 {
    font-size: 14px;
  }

  .selection-work {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
  }

  .selection-work strong {
    font-size: 14px;
  }

  .selection-work b {
    font-size: 12px;
    line-height: 1.65;
  }

  .meme-featured-work {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .thread-res--reaction {
    margin-left: 10px;
  }

  .meme-featured-work strong {
    font-size: 14px;
  }

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .viewer-toolbar {
    top: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .sticky-continue {
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    min-width: 0;
    min-height: 52px;
  }

  .site-footer__inner {
    padding-bottom: 78px;
  }

  .sitemap-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  .year-masterpiece-grid {
    grid-template-columns: 1fr;
  }
}
