/* 同人作品紹介サイト（静的生成）— 値は docs/参照サイト構造仕様.md §5 のトークン。
   config.colors はビルド時にこのファイルの末尾へ :root として追記される。
   メディアクエリ内では var() を使えないため幅は数値で直書き（§5-2）。 */

:root {
  --color-bg-page: #fafafa;
  --color-bg-surface: #fff;
  --color-text: #333;
  --color-text-sub: #555;
  --color-text-strong: #111827;
  --color-text-muted: #6b7280;
  --color-text-meta: #4b5563;
  --color-link: #1967d2;
  --color-link-hover: #e53900;
  --color-title: #ef97e8;
  --color-header-text: #f47fd7;
  --color-header-stripe-a: #edf5f4;
  --color-header-stripe-b: #f6faf9;
  --color-mint: #95e5e2;
  --color-footer-bg: #c6eeee;
  --color-date: #b2e0df;
  --color-border-card: #e8e8e8;
  --color-border-3d-top: #e3e3e3;
  --color-border-3d-right: #cecece;
  --color-border-3d-bottom: #b4b4b4;
  --color-border-3d-left: #d6d6d6;
  --color-meta-divider: #f3f3f3;
  --color-hover-bg: #f5f8fa;
  --color-readmore-bg: #222;
  --color-readmore-border: #f6b7ca;
  --color-readmore-hover: #f48fb1;
  --color-pill-bg: #fff5f7;
  --color-pill-border: #ffd5e1;
  --color-accent-active: #f564a9;
  --color-current-bg: #eee;
  --color-dots-bg: #f5f6f7;
  --color-catlabel-bg: rgba(51, 51, 51, .7);
  --color-catlabel-eyecatch-bg: #7fbfff;
  --color-catlabel-border: #eee;
  --color-cta-from: #ff5b5b;
  --color-cta-to: #c8102e;
  --color-notice-bg: #f8fbff;
  --color-notice-border: #60a5fa;
  --color-keyword-underline: #55bde8;
  --color-chip-bg: #f4f4f4;
  --color-chip-text: #374151;
  --color-thumb-placeholder: #f5f5f5;
  --color-breadcrumb: #999;
  --color-h3-border: #ddd;
  --color-h3-accent: #888;

  --font-family-base: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --font-size-base: 16px;
  --font-weight-base: 500;
  --line-height-base: 1.8;
  --font-size-site-name: 28px;
  --font-size-card-title: 22px;
  --line-height-card-title: 1.45;
  --font-size-entry-title: 34px;

  --radius-basic: 4px;
  --radius-pill: 20px;
  --radius-full: 50px;
  --radius-full-chip: 999px;
  --radius-panel: 16px;
  --radius-thumb: 12px;
  --radius-cta: 14px;
  --radius-notice: 10px;
  --radius-readmore: 8px;
  --radius-gotop: 5px;

  --shadow-wrap-hover: 0 10px 20px -5px rgba(0, 0, 0, .2);
  --shadow-card-hover: 0 12px 28px rgba(0, 0, 0, .12);
  --shadow-panel: 0 10px 28px rgba(15, 23, 42, .12);
  --shadow-related: 0 10px 24px rgba(15, 23, 42, .12);
  --shadow-related-hover: 0 16px 30px rgba(15, 23, 42, .16);
  --shadow-cta: 0 10px 28px rgba(200, 16, 46, .28), inset 0 1px 0 rgba(255, 255, 255, .2);
  --shadow-cta-hover: 0 16px 36px rgba(200, 16, 46, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  --shadow-mobile-bar: 0 0 5px darkgrey;
  --shadow-post-nav: 0 8px 24px rgba(0, 0, 0, .08);

  --layout-wrap: 1256px;
  --space-main-pad: 36px 29px;
  --space-content-top: 24px;
  --card-gap-col: .5%;
  --card-gap-row: 16px;
  --card-thumb-ratio: 16 / 11;
}

/* ---------- 基本 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--color-bg-page);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-base);
  line-height: var(--line-height-base);
  overflow-wrap: anywhere;
  /* 本文が短いページでもフッターを画面の下端以下に置く（.site → .site-content を伸ばす）。固定要素は流れの外なので影響しない */
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.site { flex: 1 0 auto; display: flex; flex-direction: column; }
.site-content { flex: 1 0 auto; }
body.is-locked { overflow: hidden; }
img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--color-link); }
a:hover { color: var(--color-link-hover); }
button { font: inherit; color: inherit; }
figure { margin: 0; }
h1, h2, h3 { margin: 0; }
.icon { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; flex: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100001;
  padding: 8px 12px; background: var(--color-bg-surface); color: var(--color-text); border-radius: var(--radius-basic);
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- ヘッダー ---------- */
.site-header__band {
  background: repeating-linear-gradient(90deg, var(--color-header-stripe-a) 0 10px, var(--color-header-stripe-b) 10px 20px);
  color: var(--color-header-text);
}
.site-header__inner {
  max-width: var(--layout-wrap);
  min-height: 90px;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.site-header__logo {
  margin: 0;
  padding: 20px 0 30px;
  text-align: center;
  font-size: var(--font-size-site-name);
  font-weight: 400;
  line-height: 1.8;
}
.site-header__link { color: var(--color-text); text-decoration: none; padding: 0 1em; }
.site-header__link:hover { color: var(--color-header-text); }
.site-header__name { color: var(--color-header-text); }
.site-header__logo-img { display: block; margin: 0 auto; height: 72px; width: auto; max-width: min(90vw, 560px); }
.site-header__link:has(.site-header__logo-img) { display: inline-block; padding: 0; }

/* ---------- R18 の常設表示（config.r18_notice・参照には無い部品） ---------- */
.r18-notice {
  background: var(--color-pill-bg); border-bottom: 1px solid var(--color-pill-border);
  color: var(--color-text-sub); font-size: 12px; line-height: 1.6; text-align: center; padding: 4px 12px;
}
.r18-notice__text { margin: 0; }
.r18-notice__sentence { display: inline-block; } /* 文の途中では折り返さず、句点の後でだけ折り返す */

/* ---------- 本体 ---------- */
.site-content { margin-top: var(--space-content-top); }
.site-content__inner { max-width: var(--layout-wrap); margin: 0 auto; }
.site-main {
  background: var(--color-bg-surface);
  padding: var(--space-main-pad);
  border: 1px solid transparent;
  border-radius: var(--radius-basic);
  width: 100%;
}

/* ---------- 一覧見出し・パンくず ---------- */
.list-heading {
  display: flex; align-items: center; gap: .3em;
  font-size: 26px; font-weight: 700; line-height: 1.3;
  color: var(--color-mint);
  margin: 16px 0;
}
.list-heading__icon { display: inline-flex; }
.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center;
  font-size: 13px; color: var(--color-breadcrumb);
  margin: 13px 5.2px;
}
.breadcrumbs__item { display: inline-flex; align-items: center; gap: .3em; }
.breadcrumbs__item a { text-decoration: none; }
.breadcrumbs__label { color: var(--color-title); }
.breadcrumbs__item a:hover .breadcrumbs__label { text-decoration: underline; }
.breadcrumbs__sep { display: inline-flex; margin: 0 10px; }

/* ---------- カード一覧 ---------- */
.card-list {
  display: grid;
  grid-template-columns: repeat(3, 33%);
  column-gap: var(--card-gap-col);
  row-gap: var(--card-gap-row);
  margin: 0 0 48px;
}
.work-card {
  display: block;
  padding: 7px;
  border: 1px solid;
  border-color: var(--color-border-3d-top) var(--color-border-3d-right) var(--color-border-3d-bottom) var(--color-border-3d-left);
  border-radius: 0;
  color: var(--color-text);
  text-decoration: none;
  transition: all .3s ease-in-out;
  min-width: 0;
}
.work-card:hover { color: var(--color-text); background: var(--color-hover-bg); transform: translateY(-4px); box-shadow: var(--shadow-wrap-hover); }
.work-card__inner {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--color-border-card);
  background: var(--color-bg-surface);
  transition: all .25s ease;
}
.work-card:hover .work-card__inner { transform: translateY(-6px); box-shadow: var(--shadow-card-hover); }
.work-card__thumb {
  position: relative; width: 100%; aspect-ratio: var(--card-thumb-ratio); overflow: hidden; margin: 0;
  background: var(--color-thumb-placeholder);
}
.work-card__image { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; display: block; }
.work-card:hover .work-card__image { transform: scale(1.04); }
.work-card__label {
  position: absolute; top: .3em; left: .3em;
  max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; line-height: 1.6; padding: 1px 5px;
  background: var(--color-catlabel-bg); color: #fff;
  border: 1px solid var(--color-catlabel-border); border-radius: var(--radius-full);
}
.work-card__content { display: flex; flex-direction: column; flex: 1 1 auto; padding: 14px 16px 0; }
.work-card__title {
  font-size: var(--font-size-card-title); font-weight: 700;
  line-height: var(--line-height-card-title); height: 2.9em;
  margin: 0 0 8px; color: var(--color-title);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.work-card__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 9px; }
.chip {
  font-size: 12px; line-height: 21.6px; padding: 3px 8px;
  background: var(--color-pill-bg); border: 1px solid var(--color-pill-border);
  border-radius: var(--radius-pill); color: var(--color-text-sub);
  max-width: 100%; overflow-wrap: anywhere;
}
.work-card__match, .work-card__excerpt {
  font-size: 12.8px; line-height: 1.55; color: var(--color-text-sub); margin: 0 0 10px;
}
.work-card__excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.work-card__match-heading { display: block; font-weight: 700; color: var(--color-text); margin-bottom: 4px; }
.work-card__match-list { list-style: none; margin: 0; padding: 0; }
.work-card__match-item {
  margin-top: 2px; line-height: 1.55;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.work-card__match-item::before { content: "・"; }
.work-card__readmore {
  display: block; width: calc(100% - 32px);
  margin: auto 16px 18px; padding: 11px 12px;
  background: var(--color-readmore-bg); color: #fff;
  border: 1px solid var(--color-readmore-border); border-radius: var(--radius-readmore);
  font-size: .92rem; font-weight: 700; line-height: 1.4; text-align: center;
  transition: background .2s, transform .2s;
}
.work-card:hover .work-card__readmore { background: var(--color-readmore-hover); border-color: var(--color-readmore-hover); transform: translateX(4px); }
.work-card__footer {
  display: flex; justify-content: flex-end;
  margin-top: 0; padding: 5px 0 6px; border-top: 1px solid var(--color-meta-divider);
}
.work-card__date { display: inline-flex; align-items: center; gap: .3em; font-size: 11.2px; color: var(--color-date); line-height: 1.6; }

/* ---------- ページ送り ---------- */
.pager { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 8px; width: 100%; margin: 24px 0; }
.pager__item {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; line-height: 46px; margin: 0 4px;
  font-size: 16px; color: var(--color-text); text-decoration: none;
  border: 1px solid;
  border-color: var(--color-border-3d-top) var(--color-border-3d-right) var(--color-border-3d-bottom) var(--color-border-3d-left);
  border-radius: var(--radius-basic);
}
a.pager__item:hover { background: var(--color-hover-bg); color: var(--color-text); border-bottom: 2px solid var(--color-accent-active); }
.pager__item--current { background: var(--color-current-bg); color: var(--color-accent-active); border-bottom: 2px solid var(--color-accent-active); }
.pager__item--dots { background: var(--color-dots-bg); opacity: .6; }
.pager__item--sp-dots { display: none; } /* 400px 以下でだけ表示（--far の代わり） */

/* ---------- ジャンル一覧ページ ---------- */
.genre-index__lead { color: var(--color-text-sub); font-size: 14px; margin: 0 0 16px; }
.genre-index {
  list-style: none; margin: 0 0 32px; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.genre-index__link {
  display: flex; align-items: center; gap: .5em;
  padding: 10px 12px; border: 1px solid var(--color-pill-border); background: var(--color-pill-bg);
  border-radius: var(--radius-readmore); color: var(--color-text); text-decoration: none; font-size: 14px;
}
.genre-index__link:hover { color: var(--color-text); background: var(--color-hover-bg); }
.genre-index__icon { color: var(--color-mint); }
.genre-index__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.genre-index__count, .drawer__count {
  font-size: 12px; color: var(--color-text-muted); background: var(--color-bg-surface);
  border-radius: var(--radius-full-chip); padding: 0 8px; line-height: 1.8;
}

/* ---------- 404 ---------- */
.notfound { margin: 0 0 32px; }
.notfound__text { margin: 0 0 12px; }
.notfound__link { font-weight: 700; }
.notfound__heading {
  font-size: 24px; line-height: 1.25; font-weight: 700;
  background: var(--color-dots-bg); padding: 20px 25px; border-left: 9px solid var(--color-mint);
  margin: 0 0 1.62em;
}

/* ---------- 詳細 ---------- */
.work__title {
  font-size: var(--font-size-entry-title); line-height: 1.34; font-weight: 700;
  color: var(--color-title); text-align: center; letter-spacing: -.03em;
  max-width: 900px; margin: 40px auto 25px; padding: 0 20px;
}
.work__eyecatch { display: flex; justify-content: center; margin-bottom: 50px; }
.work__eyecatch-figure { position: relative; width: 560px; max-width: 100%; }
.work__eyecatch-image { /* 枠は固定しない（参照と同じ height:auto）。到着前の高さは img の width=560 height=420 属性で確保 */
  display: block; width: 100%; height: auto;
  background: var(--color-thumb-placeholder);
}
.work__eyecatch-label {
  position: absolute; top: .4em; left: .4em;
  font-size: 14px; line-height: 1.6; padding: 2px 8px;
  background: var(--color-catlabel-eyecatch-bg); color: #fff;
  border: 1px solid var(--color-catlabel-border); border-radius: var(--radius-full); opacity: .9;
  max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.work__date { display: flex; align-items: center; justify-content: flex-end; gap: .3em; color: var(--color-date); line-height: .8; margin: 0 0 24px; font-size: 14px; }

.work-panel {
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--color-bg-surface); border-radius: var(--radius-panel);
  padding: 24px; box-shadow: var(--shadow-panel);
}
.work-panel__thumb { flex: 0 0 300px; max-width: 300px; }
.work-panel__image { /* 参照どおり height:auto（画像の縦横比のまま全体を表示。切り抜かない） */
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-thumb); background: var(--color-thumb-placeholder);
}
.work-panel__content { flex: 1 1 auto; min-width: 0; }
.work-panel__circle { font-size: 16px; color: var(--color-text-muted); margin-bottom: 10px; }
.work-panel__circle::before { content: "サークル："; font-weight: 600; }
.work-panel__genres {
  display: inline-block;
  font-size: 13px; line-height: 1.6; color: var(--color-text-meta); margin-bottom: 14px;
  background: var(--color-pill-bg); border: 1px solid var(--color-pill-border); border-radius: var(--radius-pill); padding: 3px 8px;
}
.work-panel__genres:empty { display: none; } /* ジャンル 0 件の作品で空の枠を出さない */
.work-panel__summary { font-size: 18px; line-height: 1.8; color: var(--color-text-strong); margin-bottom: 16px; }
.work-panel__excerpt { margin: 0; }
.audience__heading { font-size: 1.08em; font-weight: 800; line-height: 1.5; color: var(--color-text-strong); margin-bottom: 10px; }
.audience__list { margin: 0; padding-left: 1.35em; }
.audience__list li { margin-bottom: 8px; line-height: 1.85; }
.audience__keyword {
  text-decoration: underline; text-decoration-color: var(--color-keyword-underline);
  text-decoration-thickness: 2px; text-underline-offset: 5px;
}
.free-notice {
  margin: 18px 0 8px; padding: 16px 18px;
  border-left: 4px solid var(--color-notice-border); background: var(--color-notice-bg);
  border-radius: var(--radius-notice);
}
.free-notice__question { font-weight: 700; line-height: 1.6; margin-bottom: 8px; }
.free-notice__answer { line-height: 1.8; margin: 0 0 1.8em; }
.free-notice__action { margin: 0; }
.cta-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 260px; max-width: 100%; padding: 16px 34px; border-radius: var(--radius-cta);
  background: linear-gradient(135deg, var(--color-cta-from), var(--color-cta-to));
  color: #fff; font-size: 18px; font-weight: 700; letter-spacing: .04em; text-decoration: none;
  box-shadow: var(--shadow-cta); transition: transform .2s, box-shadow .2s, filter .2s;
}
.cta-button:hover { color: #fff; transform: translateY(-3px); filter: brightness(1.05); box-shadow: var(--shadow-cta-hover); }
.cta-button:active { transform: translateY(0); }
.cta-button__pr { display: inline-block; margin-right: 10px; padding: 0 6px; border: 1px solid rgba(255,255,255,.85); border-radius: 3px; font-size: 11px; line-height: 1.7; letter-spacing: .05em; }
.free-notice__pr { margin: 8px 0 0; font-size: 12px; color: var(--color-text-muted, #666); }
.ad-notice { background: #fff8e6; border-bottom: 1px solid #f3dca0; }
.ad-notice__text { max-width: var(--layout-wrap); margin: 0 auto; padding: 6px 16px; font-size: 12px; line-height: 1.6; text-align: center; color: #5c4a1a; }

/* 新着・関連グリッド（裁定 §7-3: 描画値を再現。崩れる値は README「参照との差分」） */
.work-grid { margin-top: 30px; }
.work-grid--related { margin-top: 40px; }
.work-grid__heading {
  font-size: 24px; line-height: 1.25; font-weight: 700;
  background: var(--color-dots-bg); padding: 25px; border-radius: 2px;
  margin: 0 0 1.62em;
}
.work-grid--new .work-grid__heading { border-left: 3px solid var(--color-text-strong); }
.work-grid--related .work-grid__heading { border-left: 9px solid var(--color-mint); border-radius: 0; }
.work-grid__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.work-grid--related .work-grid__list { gap: 12px; }
.work-grid__card { display: flex; flex-direction: column; color: var(--color-text); text-decoration: none; min-width: 0; }
.work-grid__card:hover { color: var(--color-text); }
.work-grid--new .work-grid__card {
  background: var(--color-bg-surface); border-radius: var(--radius-panel);
  box-shadow: var(--shadow-related); overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.work-grid--new .work-grid__card:hover { transform: translateY(-4px); box-shadow: var(--shadow-related-hover); }
.work-grid__thumb { overflow: hidden; background: var(--color-thumb-placeholder); }
.work-grid__image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .3s ease; }
.work-grid--new .work-grid__thumb { height: 220px; }
.work-grid--new .work-grid__card:hover .work-grid__image { transform: scale(1.03); }
.work-grid--related .work-grid__thumb { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-basic); }
.work-grid--related .work-grid__image { position: absolute; inset: 0; }
.work-grid__body { padding: 10px 12px 12px; }
.work-grid__title {
  font-weight: 700;
  border: 1px solid var(--color-h3-border); border-left: 7px solid var(--color-h3-accent);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  box-sizing: content-box;
}
.work-grid--new .work-grid__title {
  font-size: 15px; line-height: 1.45; min-height: 2.9em; max-height: 2.9em;
  padding: 12px 20px; margin: 0 0 7px;
}
.work-grid--related .work-grid__title {
  font-size: 22px; line-height: 1.25; height: 2.5em;
  padding: 12px 20px; margin: 10px 0 0;
}
.work-grid__circle {
  display: inline-block; max-width: 100%; overflow-wrap: anywhere;
  font-size: 12px; font-weight: 600; color: var(--color-chip-text); background: var(--color-chip-bg);
  border-radius: var(--radius-full-chip); padding: 3px 8px; margin: 0 0 4px; line-height: 1.6;
}
.work-grid__circle::before { content: "【"; }
.work-grid__circle::after { content: "】"; }

/* カテゴリ・サークルのリンク */
.terms { display: flex; flex-direction: column; gap: 8px; margin: 32px 0 24px; }
.terms__group { display: flex; flex-wrap: wrap; gap: 5px; }
.terms__link {
  display: inline-flex; align-items: center; gap: .3em;
  font-size: 12px; line-height: 1.6; text-decoration: none; border-radius: var(--radius-basic);
}
.terms__link--category { background: var(--color-text); color: #fff; padding: 2px 6px; border: 1px solid var(--color-text); }
.terms__link--category:hover { color: #fff; background: var(--color-link-hover); border-color: var(--color-link-hover); }
.terms__link--tag { color: var(--color-text); padding: 1px 5px; border: 1px solid var(--color-border-3d-right); }
.terms__link--tag:hover { color: var(--color-link-hover); border-color: var(--color-link-hover); }

/* 前後の作品 */
.post-nav { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.post-nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; background: var(--color-bg-surface); border-radius: 14px; box-shadow: var(--shadow-post-nav);
  color: var(--color-text); text-decoration: none; transition: transform .2s, box-shadow .2s;
}
.post-nav__link:hover { color: var(--color-text); transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.post-nav__link--next { flex-direction: row-reverse; text-align: right; }
.post-nav__arrow { display: inline-flex; color: var(--color-text-muted); }
.post-nav__thumb { flex: 0 0 120px; width: 120px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-basic); background: var(--color-thumb-placeholder); }
.post-nav__image { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-nav__title {
  flex: 1 1 auto; min-width: 0; font-size: 1rem; font-weight: 700; line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* ---------- 固定ページ（data/pages） ---------- */
.static-page { color: var(--color-text); line-height: var(--line-height-base); max-width: 900px; }
.static-page h2 { /* 記事内 h2（design-tokens「見出し h2」・404 の .notfound__heading と同じ系統） */
  font-size: 24px; line-height: 1.25; font-weight: 700;
  background: var(--color-dots-bg); padding: 25px; border-left: 9px solid var(--color-mint);
  margin: 40px 0 1.62em;
}
.static-page > h2:first-child { margin-top: 0; }
.static-page p, .static-page ul, .static-page ol { margin: 0 0 16px; }
.static-page ul, .static-page ol { padding-left: 1.5em; }

/* ---------- フッター ---------- */
.site-footer { background: var(--color-footer-bg); color: var(--color-text); padding: 8px; margin-top: 20px; }
.site-footer__inner {
  max-width: var(--layout-wrap); margin: 0 auto;
  padding: 8px 60px 8px 12px; /* 右 60px＝固定の「トップへ」ボタン（右 10px・幅 40px）とクレジットが重ならないように */
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-footer__logo { font-size: 18px; }
.site-footer__logo-img { display: block; height: 34px; width: auto; }
.site-footer__link { color: var(--color-text); text-decoration: none; }
.site-footer__link:hover { color: var(--color-header-text); }
.site-footer__body { text-align: right; font-size: 14px; }
.site-footer__nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; }
.site-footer__nav-link { color: var(--color-text); }
.site-footer__copyright { margin-top: 8px; }
.site-footer__credit { margin-top: 4px; font-size: 12px; }
.site-footer__credit a { color: var(--color-text); }

/* ---------- 下部バー・トップへ ---------- */
.mobile-bar { display: none; }
.to-top { position: fixed; right: 10px; bottom: 10px; z-index: 99999; display: none; }
.to-top.is-visible { display: block; }
.to-top__button {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--color-current-bg); color: var(--color-text); border: 0; border-radius: var(--radius-gotop);
  font-size: 22px; opacity: .5; cursor: pointer; transition: opacity .2s;
}
.to-top__button:hover { opacity: 1; }

/* ---------- 検索オーバーレイ ---------- */
.search-panel {
  position: fixed; inset: 0; z-index: 100000; background: rgba(0, 0, 0, .55);
  display: flex; justify-content: center; align-items: flex-start; padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
}
.search-panel__inner {
  width: 100%; max-width: 720px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  background: var(--color-bg-surface); border-radius: var(--radius-panel); box-shadow: var(--shadow-panel); overflow: hidden;
}
.search-panel__bar { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--color-border-card); }
.search-panel__input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--color-border-3d-right); border-radius: var(--radius-readmore);
}
.search-panel__close, .drawer__close {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--color-current-bg); border-radius: var(--radius-readmore); font-size: 20px; cursor: pointer;
}
.search-panel__status { margin: 8px 16px 0; font-size: 13px; color: var(--color-text-muted); }
.search-panel__results { list-style: none; margin: 0; padding: 4px 8px 12px; overflow-y: auto; }
.search-panel__result { display: block; padding: 10px 8px; border-bottom: 1px solid var(--color-meta-divider); text-decoration: none; color: var(--color-text); }
.search-panel__result:hover { background: var(--color-hover-bg); color: var(--color-text); }
.search-panel__result-title { display: block; font-weight: 700; color: var(--color-title); line-height: 1.5; }
.search-panel__result-meta { display: block; font-size: 12px; color: var(--color-text-muted); line-height: 1.6; }

/* ---------- ジャンル引き出し ---------- */
.drawer { position: fixed; inset: 0; z-index: 100000; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw);
  background: var(--color-bg-surface); box-shadow: -4px 0 20px rgba(0, 0, 0, .15);
  display: flex; flex-direction: column; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer__title { font-weight: 700; color: var(--color-mint); font-size: 18px; }
.drawer__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; }
.drawer__link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 6px; border-bottom: 1px solid var(--color-meta-divider); color: var(--color-text); text-decoration: none; font-size: 14px;
}
.drawer__link:hover { background: var(--color-hover-bg); color: var(--color-text); }
.drawer__count { background: var(--color-pill-bg); }
.drawer__all {
  display: block; margin-top: 10px; padding: 10px; text-align: center; font-weight: 700; text-decoration: none;
  background: var(--color-readmore-bg); color: #fff; border-radius: var(--radius-readmore);
}
.drawer__all:hover { color: #fff; background: var(--color-readmore-hover); }

/* ---------- 年齢確認 ---------- */
.age-gate {
  position: fixed; inset: 0; z-index: 100001; background: rgba(17, 24, 39, .82);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.age-gate__box {
  width: 100%; max-width: 440px; background: var(--color-bg-surface); border-radius: var(--radius-panel);
  padding: 28px 24px; text-align: center; box-shadow: var(--shadow-panel);
}
.age-gate__title { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: var(--color-title); }
.age-gate__text { margin: 0 0 8px; font-size: 14px; color: var(--color-text-sub); }
.age-gate__question { margin: 0 0 20px; font-size: 18px; font-weight: 700; }
.age-gate__actions { display: flex; flex-direction: column; gap: 10px; }
.age-gate__button { padding: 14px 16px; border-radius: var(--radius-cta); border: 0; font-weight: 700; cursor: pointer; font-size: 16px; }
.age-gate__button--yes { background: linear-gradient(135deg, var(--color-cta-from), var(--color-cta-to)); color: #fff; box-shadow: var(--shadow-cta); }
.age-gate__button--no { background: var(--color-current-bg); color: var(--color-text); }

/* ---------- ブレークポイント（§5-2） ---------- */
@media (max-width: 1255px) {
  .site-content__inner, .site-header__inner, .site-footer__inner { max-width: none; }
}
@media (max-width: 1023px) {
  body { padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
  .mobile-bar {
    display: flex; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
    min-height: 50px; margin: 0; padding: 0 0 env(safe-area-inset-bottom); list-style: none;
    background: var(--color-bg-surface); box-shadow: var(--shadow-mobile-bar);
  }
  .mobile-bar__item { width: 100%; }
  .mobile-bar__button {
    width: 100%; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--color-text); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer;
  }
  .mobile-bar__button:hover { color: var(--color-text); }
  .mobile-bar__icon { font-size: 19px; line-height: 1; display: inline-flex; }
  .mobile-bar__label { font-size: 9px; opacity: .8; line-height: 1.6; margin-top: 2px; }
  .to-top, .to-top.is-visible { display: none; }
  .site-footer__inner { flex-direction: column; justify-content: center; text-align: center; padding: 8px 12px; }
  .site-footer__body { text-align: center; }
  .site-footer__nav { justify-content: center; }
  .genre-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 834px) {
  .site-main { padding: 32px 16px; border: 0; }
  .card-list { grid-template-columns: repeat(2, 49%); justify-content: space-between; }
  .site-header__inner { min-height: 60px; }
  .site-header__logo { font-size: 22px; }
  .site-header__logo-img { height: 56px; }
  .site-content { margin-top: 10px; }
  .work-grid--new .work-grid__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-card__match, .work-card__excerpt { font-size: 14px; }
  .work-card__readmore { width: calc(100% - 26px); margin: auto 13px 15px; }
  .work__eyecatch-label { font-size: 10px; padding: 2px 4px; }
}
@media (max-width: 767px) {
  .work-panel { flex-direction: column; padding: 16px; }
  .work-panel__thumb { flex: none; width: 100%; max-width: 100%; }
  .work__title { font-size: 26px; line-height: 1.4; }
  .audience__list li { margin-bottom: 7px; line-height: 1.75; }
  .free-notice { padding: 14px 15px; }
  .work-grid--related .work-grid__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid--new .work-grid__title { font-size: 14px; }
  .genre-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta-button { min-width: 0; width: 100%; padding: 16px 20px; }
}
@media (max-width: 640px) {
  .pager__item { width: 36px; height: 36px; line-height: 36px; margin: 0 1px; } /* 481〜640px で 11 項目（最大 418px）が 1 行に入る */
}
@media (max-width: 480px) {
  .site-header__logo { font-size: 18px; }
  .site-header__logo-img { height: 44px; }
  .site-footer__logo-img { height: 28px; margin: 0 auto; }
  .pager__item { width: 30px; height: 30px; line-height: 30px; margin: 0 1px; } /* 間隔 2px。11 項目（前へ 1 … 3 4 5 6 7 … 25 次へ）でも 376px 以上で 1 行 */
  .work-card__match, .work-card__excerpt { display: none; }
  .work-card__content { padding: 12px 13px 0; }
  .work-card__label { font-size: 10px; padding: 1px 3px; }
  .chip { line-height: 15.6px; }
  .work-grid--new .work-grid__list { grid-template-columns: 1fr; }
  .work-grid__heading { font-size: 20px; padding: 12px 16px; }
  .work-grid--related .work-grid__title { font-size: 18px; padding: .6em; }
  .work-grid--new .work-grid__title { padding: .6em; }
  .notfound__heading, .static-page h2 { font-size: 20px; padding: 12px 16px; }
  .post-nav__thumb { flex-basis: 30%; width: 30%; }
}
@media (max-width: 400px) {
  .pager__item--far { display: none; } /* 現在±2 の番号を隠して 9 項目以内（320〜400px で 1 行。401px 以上は 11 項目でも 352px で入る） */
  .pager__item--sp-dots { display: inline-flex; } /* 隠した番号の代わりの …（他の項目と同じ inline-flex で揃える） */
}
@media (max-width: 356px) {
  .card-list { grid-template-columns: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
