/*
Theme Name: Nukimakuri
Template: twentytwentyfive
Description: 同人作品アフィリエイトサイト用テーマ
*/

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

/* ===== リセット & ベース ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #f7f7f5;
  --color-surface: #ffffff;
  --color-border: #e8e8e4;
  --color-text: #111111;
  --color-muted: #888884;
  --color-accent: #e8734a;
  --color-tag-bg: #f0f0ec;
  --radius: 4px;
  --shadow: 0 1px 8px rgba(0,0,0,.06);
  --shadow-hover: 0 6px 24px rgba(0,0,0,.12);
  --font: 'Noto Sans JP', -apple-system, sans-serif;
  --max-w: 1280px;
  --header-h: 56px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }

/* ===== サイトヘッダー ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-text);
}

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--color-muted);
  transition: color .15s;
}

.site-nav a:hover { color: var(--color-text); }

/* ===== #page ラッパー (旧WP compat) ===== */
#page { display: flex; flex-direction: column; min-height: 100vh; }

/* ===== メインコンテナ ===== */
.site-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
  width: 100%;
  flex: 1;
}

/* ===== アーカイブページ ===== */
.work-archive-header {
  margin-bottom: 28px;
}

.work-archive-header h1 {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  letter-spacing: -.01em;
}

.work-archive-header p {
  color: var(--color-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ===== フィルターバー ===== */
.work-filter {
  margin-bottom: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.work-filter__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.work-filter__group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.work-filter__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-muted);
  letter-spacing: .06em;
  white-space: nowrap;
}

.work-filter__chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.work-filter__chip {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  color: var(--color-muted);
  background: var(--color-bg);
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}

.work-filter__chip:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.work-filter__chip.is-active {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #fff;
}

/* ===== 作品グリッド ===== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 540px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

@media (min-width: 800px) {
  .work-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

@media (min-width: 1100px) {
  .work-grid { grid-template-columns: repeat(5, 1fr); gap: 18px; }
}

/* ===== 作品カード ===== */
.work-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  display: block;
}

.work-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.work-card__thumb {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--color-border);
}

.work-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.work-card:hover .work-card__thumb img {
  transform: scale(1.04);
}

.work-card__body {
  padding: 10px 12px 12px;
}

.work-card__title {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  color: var(--color-text);
}

.work-card__circle {
  font-size: 10px;
  color: var(--color-muted);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.work-card__price {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
}

.work-card__price.free {
  color: var(--color-accent);
}

/* 星評価 */
.work-card__rating {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-muted);
  flex-shrink: 0;
}

.work-card__stars {
  display: inline-block;
  position: relative;
  font-size: 10px;
  line-height: 1;
}

.work-card__stars::before {
  content: '★★★★★';
  color: var(--color-border);
  letter-spacing: 0;
}

.work-card__stars::after {
  content: '★★★★★';
  position: absolute;
  top: 0;
  left: 0;
  color: #f5a623;
  overflow: hidden;
  width: var(--r, 0%);
  white-space: nowrap;
}

/* ===== ページネーション ===== */
.work-pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

.work-pagination ul.page-numbers {
  display: flex !important;
  list-style: none !important;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 !important;
  margin: 0 !important;
}

.work-pagination ul.page-numbers > li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.work-pagination ul.page-numbers > li > a,
.work-pagination ul.page-numbers > li > span {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--color-surface);
  transition: background .15s, border-color .15s, color .15s;
  color: var(--color-text);
  text-decoration: none;
}

.work-pagination ul.page-numbers > li > span.current {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #fff;
}

.work-pagination ul.page-numbers > li > a:hover {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #fff;
}

/* ===== 個別ページ ===== */
.work-single {
  max-width: 900px;
  margin: 0 auto;
}

/* パンくず */
.work-breadcrumb {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 24px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
}

.work-breadcrumb a {
  color: var(--color-muted);
  flex-shrink: 0;
}
.work-breadcrumb a:hover { color: var(--color-text); }
.work-breadcrumb span { opacity: .4; flex-shrink: 0; }
.work-breadcrumb span:last-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* レイアウト */
.work-single__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 680px) {
  .work-single__layout {
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
  }
}

/* カバー画像 */
.work-single__cover {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  aspect-ratio: 3/4;
  background: var(--color-border);
}

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

/* 情報パネル */
.work-single__info {
  display: flex;
  flex-direction: column;
}

.work-single__source-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
  margin-bottom: 14px;
}

.work-single__title {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.01em;
  margin-bottom: 20px;
}

/* ===== 作品コンテンツ（本文エリア）===== */
.work-single__body {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

/* PR開示 — inline stylesをすべて上書き */
.work-single__body .ad-disclosure {
  font-size: 11px !important;
  color: var(--color-muted) !important;
  background: var(--color-tag-bg) !important;
  padding: 8px 12px !important;
  border-radius: var(--radius) !important;
  margin-bottom: 16px !important;
  display: block !important;
  line-height: 1.5 !important;
  border: none !important;
  border-left: none !important;
}

/* メタ情報の段落 (サークル/価格/評価、ジャンル行) */
.work-single__body p {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}

.work-single__body p strong {
  color: var(--color-text);
  font-weight: 600;
}

/* 作品説明 */
.work-single__body p:empty {
  display: none;
}

/* アフィリエイト CTA ボタン */
.work-single__body .affiliate-link,
.work-single__body p.affiliate-link {
  margin-top: 20px;
  margin-bottom: 0;
}

.work-single__body .btn-affiliate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-text);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 15px 24px;
  border-radius: var(--radius);
  width: 100%;
  transition: background .15s, transform .1s;
  text-decoration: none;
}

.work-single__body .btn-affiliate:hover {
  background: #2a2a2a;
  transform: translateY(-1px);
}

.work-single__body .btn-fanza {
  background: #ff5722;
}

.work-single__body .btn-fanza:hover {
  background: #e64a19;
}

/* セパレーター */
.work-single__body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 16px 0 12px;
}

/* 免責事項 */
.work-single__body small,
.work-single__body p:last-child small {
  font-size: 10px;
  color: var(--color-muted);
  line-height: 1.5;
}

.work-single__body p:last-child {
  font-size: 11px;
  color: var(--color-muted);
  margin-bottom: 0;
}

/* ===== 関連作品セクション ===== */
.related-section {
  max-width: 900px;
  margin: 48px auto 0;
}

.related-section__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

/* ===== フッター ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 20px 24px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
}

.footer-copy {
  font-size: 11px;
  color: var(--color-muted);
  letter-spacing: .04em;
}

.footer-copy a {
  color: var(--color-muted) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== トップページ ===== */

/* ヒーロー */
.home-hero {
  text-align: center;
  padding: 72px 24px 80px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 56px;
}

.home-hero__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 16px;
}

.home-hero__title {
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.home-hero__desc {
  font-size: 15px;
  color: var(--color-muted);
  margin-bottom: 36px;
}

.home-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-text);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 14px 28px;
  border-radius: var(--radius);
  transition: background .15s, transform .1s;
}

.home-hero__cta:hover {
  background: #2a2a2a;
  transform: translateY(-1px);
}

.home-hero__cta svg {
  width: 16px;
  height: 16px;
}

/* セクション */
.home-section {
  margin-bottom: 60px;
}

.home-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.home-section__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.home-section__more {
  font-size: 12px;
  color: var(--color-muted);
  transition: color .15s;
}

.home-section__more:hover { color: var(--color-text); }

.home-section__foot {
  margin-top: 32px;
  text-align: center;
}

.btn-all-works {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 12px 32px;
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
  letter-spacing: .02em;
}

.btn-all-works:hover {
  border-color: var(--color-text);
  background: var(--color-text);
  color: #fff;
}

/* ===== 固定ページ ===== */
.page-single {
  max-width: 760px;
  margin: 0 auto;
}

.page-single__title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.page-single__body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text);
}

.page-single__body h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.page-single__body h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--color-text);
}

.page-single__body p {
  margin-bottom: 12px;
  color: var(--color-text);
}

/* ===== SP 調整 ===== */
@media (max-width: 679px) {
  .site-main {
    padding: 24px 16px 60px;
  }

  .work-archive-header {
    margin-bottom: 20px;
  }

  .work-single__layout {
    gap: 20px;
  }

  .work-single__cover {
    aspect-ratio: 4/3;
    max-height: 300px;
  }
}
