/*
Theme Name: Manga Base Theme
Theme URI: https://chikubin.com/
Description: ジャンル特化型 成人向け漫画・同人レビューサイト網の共通親テーマ。中立的な骨格のみを提供し、サイト固有のデザインは子テーマで上書きする。
Author: manga-hub project
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 8.2
Text Domain: manga-base
*/

/* ===========================================================================
   デザイントークン（CSS変数）
   子テーマで上書きすることで、サイトごとのブランディングを実現する
   =========================================================================== */
:root {
  /* 背景 */
  --bg-base:        #0e0e10;
  --bg-surface:     #16161a;
  --bg-card:        #1c1c20;
  --bg-elevated:    #232328;

  /* テキスト */
  --text-primary:   #ececec;
  --text-secondary: #b8b8b8;
  --text-muted:     #767676;

  /* アクセント（子テーマで必ず上書きする想定） */
  --accent:         #c44569;
  --accent-glow:    #d96485;
  --accent-deep:    #8b2745;

  /* 機能色 */
  --price:          #d4a017;
  --sale:           #d63031;
  --rating:         #e8b923;

  /* タイポグラフィ */
  --font-serif:     "Noto Serif JP", serif;
  --font-sans:      "Noto Sans JP", -apple-system, "Segoe UI", sans-serif;
  --font-display:   var(--font-sans);

  /* レイアウト */
  --max-width:      1280px;
  --gutter:         32px;
  --gutter-mobile:  20px;
  --gap:            20px;
  --radius:         4px;

  /* z-index */
  --z-header:       100;
  --z-sticky-cta:   90;
  --z-modal:        10000;
}

/* ===========================================================================
   リセット
   =========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-glow); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ===========================================================================
   レイアウト基盤
   =========================================================================== */
.mb-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (max-width: 768px) {
  .mb-container { padding: 0 var(--gutter-mobile); }
}

/* ===========================================================================
   ヘッダー
   =========================================================================== */
.mb-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bg-elevated);
}
.mb-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  max-width: 1400px;
  margin: 0 auto;
}
.mb-brand { display: flex; align-items: baseline; gap: 12px; }
.mb-brand__logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}
.mb-brand__sub {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}
.mb-nav { display: flex; gap: 24px; font-size: 13px; }
.mb-nav a { color: var(--text-secondary); }
.mb-nav a:hover { color: var(--accent); }
@media (max-width: 768px) {
  .mb-nav { display: none; }
  .mb-header__inner { padding: 14px var(--gutter-mobile); }
}

/* ===========================================================================
   作品カード
   =========================================================================== */
.mb-work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
@media (max-width: 968px) { .mb-work-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .mb-work-grid { grid-template-columns: repeat(2, 1fr); } }

.mb-card { display: block; color: inherit; }
.mb-card__thumb {
  position: relative;
  aspect-ratio: 3/4;
  background: var(--bg-card);
  overflow: hidden;
  margin-bottom: 10px;
}
.mb-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.mb-card:hover .mb-card__thumb img { transform: scale(1.04); }
.mb-card__circle {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.mb-card__title {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 8px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mb-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.mb-card__price { color: var(--price); font-weight: 600; }
.mb-card__price--sale { color: var(--sale); }
.mb-card__price-strike {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 11px;
  margin-right: 4px;
  font-weight: 400;
}
.mb-card__rating { color: var(--rating); }
.mb-card__sale-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--sale);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  z-index: 2;
}

/* ===========================================================================
   作品ヒーロー
   =========================================================================== */
.mb-work-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 32px 0;
}
@media (max-width: 968px) { .mb-work-hero { grid-template-columns: 1fr; gap: 24px; } }

.mb-work-hero__image {
  aspect-ratio: 3/4;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}
.mb-work-hero__image img { width: 100%; height: 100%; object-fit: cover; }

.mb-work-hero__title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.4;
}
.mb-work-hero__circle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.mb-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 16px;
  margin: 20px 0;
  border-top: 1px solid var(--bg-elevated);
}
.mb-meta__row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-elevated);
  font-size: 13px;
}
.mb-meta__label { width: 80px; color: var(--text-muted); flex-shrink: 0; }
.mb-meta__value { color: var(--text-secondary); }
@media (max-width: 640px) { .mb-meta { grid-template-columns: 1fr; gap: 0; } }

.mb-price-box {
  background: var(--bg-elevated);
  padding: 20px 24px;
  margin: 20px 0;
}
.mb-price-box__price {
  font-size: 32px;
  font-weight: 700;
  color: var(--sale);
  line-height: 1;
}
.mb-price-box__original {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 12px;
}

.mb-cta {
  display: block;
  width: 100%;
  padding: 18px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  letter-spacing: 0.1em;
  transition: background .2s;
}
.mb-cta:hover { background: var(--accent-glow); color: #fff !important; }
.mb-cta--secondary {
  background: transparent;
  color: var(--text-primary) !important;
  border: 1px solid var(--bg-elevated);
  margin-top: 8px;
}
.mb-cta--secondary:hover { border-color: var(--accent); color: var(--accent) !important; }

/* ===========================================================================
   セクション
   =========================================================================== */
.mb-section { padding: 40px 0; }
.mb-section__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bg-elevated);
}

/* ===========================================================================
   サンプル画像ギャラリー
   =========================================================================== */
.mb-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 640px) { .mb-gallery { grid-template-columns: repeat(2, 1fr); } }
.mb-gallery__item {
  aspect-ratio: 3/4;
  background: var(--bg-card);
  overflow: hidden;
  cursor: pointer;
}
.mb-gallery__item img { width: 100%; height: 100%; object-fit: cover; }

/* ===========================================================================
   タグ
   =========================================================================== */
.mb-tag-group {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-elevated);
  align-items: center;
}
.mb-tag-group__label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.mb-tag-pill {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0 6px 6px 0;
  border-radius: var(--radius);
}
.mb-tag-pill:hover { background: var(--bg-elevated); color: var(--accent); }
@media (max-width: 640px) {
  .mb-tag-group { grid-template-columns: 1fr; gap: 8px; }
}

/* ===========================================================================
   フッター
   =========================================================================== */
.mb-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--bg-elevated);
  padding: 40px 0 20px;
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 12px;
}
.mb-footer__bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--bg-elevated);
  letter-spacing: 0.05em;
}

/* ===========================================================================
   年齢確認モーダル
   =========================================================================== */
.mb-age-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mb-age-modal[hidden] { display: none; }
.mb-age-modal__inner {
  max-width: 460px;
  text-align: center;
  padding: 40px 32px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
}
.mb-age-modal__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.5;
}
.mb-age-modal__copy {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.9;
  margin: 0 0 28px;
}
.mb-age-modal__buttons {
  display: flex;
  gap: 12px;
}
.mb-age-btn {
  flex: 1;
  padding: 14px;
  border: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all .2s;
}
.mb-age-btn--yes { background: var(--accent); color: #fff; }
.mb-age-btn--yes:hover { background: var(--accent-glow); }
.mb-age-btn--no {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--bg-elevated);
}
.mb-age-btn--no:hover { color: var(--text-primary); }

/* ===========================================================================
   スティッキー下部CTA（モバイル）
   =========================================================================== */
.mb-sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(14, 14, 16, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--bg-elevated);
  padding: 12px 16px;
  z-index: var(--z-sticky-cta);
  display: none;
  align-items: center;
  gap: 12px;
}
@media (max-width: 768px) { .mb-sticky-cta--mobile { display: flex; } }
