/*
Theme Name: エロマンガDB
Author: you
Description: アダルト漫画カタログテーマ - 無料サンプル試し読み対応
Version: 2.0
*/

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

html { background: #0a0a0a !important; scroll-behavior: smooth; }

body {
  margin: 0;
  background: #0a0a0a !important;
  color: #e8e8e8;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; }


/* ============================================================
   ヘッダー
   ============================================================ */
.site-header {
  background: #0f0f0f;
  border-bottom: 2px solid #c0123c;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.site-title a {
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.site-title a .logo-main {
  color: #ff1a4f;
}

.site-title a .logo-sub {
  font-size: 12px;
  color: #888;
  font-weight: 400;
}

.header-search-mini {
  flex: 1;
  max-width: 420px;
  display: flex;
  gap: 6px;
}

.header-search-mini input {
  flex: 1;
  background: #1e1e1e;
  border: 1px solid #333;
  color: #fff;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 13px;
  outline: none;
}

.header-search-mini input:focus {
  border-color: #c0123c;
}

.header-search-mini button {
  background: #c0123c;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}

.header-nav {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.header-nav a {
  color: #ccc;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.15s;
}

.header-nav a:hover {
  background: #1e1e1e;
  color: #fff;
}

.legal-note {
  background: #111;
  text-align: center;
  font-size: 11px;
  color: #555;
  padding: 6px 16px;
  margin: 0;
}

.legal-note a { color: #666; }


/* ============================================================
   漫画グリッド
   ============================================================ */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0;
}

@media (min-width: 480px) {
  .manga-grid { grid-template-columns: repeat(3, 1fr); }
}

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

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

/* カード */
.manga-card {
  display: block;
  background: #141414;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #222;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
}

.manga-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(192, 18, 60, 0.25);
  border-color: #c0123c;
}

/* カバー画像エリア */
.manga-card__cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #1a1a1a;
}

.manga-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.manga-card:hover .manga-card__cover img {
  transform: scale(1.04);
}

/* バッジ */
.badge {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1;
  letter-spacing: 0.3px;
}

.badge--sample {
  bottom: 6px;
  left: 6px;
  background: #16a34a;
  color: #fff;
}

.badge--new {
  top: 6px;
  right: 6px;
  background: #c0123c;
  color: #fff;
}

.badge--doujin {
  top: 6px;
  left: 6px;
  background: #7c3aed;
  color: #fff;
}

/* カード本体テキスト */
.manga-card__body {
  padding: 9px 10px 10px;
}

.manga-card__title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #f0f0f0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
}

.manga-card__author {
  font-size: 11px;
  color: #ff8fb1;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manga-card__genre {
  display: inline-block;
  font-size: 10px;
  color: #999;
  background: #1f1f1f;
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid #2e2e2e;
}


/* ============================================================
   ページ共通ラッパー
   ============================================================ */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}


/* ============================================================
   セクションヘッダー
   ============================================================ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: #c0123c;
  border-radius: 2px;
}

.section-more {
  font-size: 13px;
  color: #888;
  transition: color 0.15s;
}

.section-more:hover { color: #ff1a4f; }

.top-section {
  margin-bottom: 40px;
}


/* ============================================================
   検索フォーム（トップ）
   ============================================================ */
.top-search {
  margin-bottom: 32px;
}

.top-search-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
}

.search-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: stretch;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap input[type="text"] {
  width: 100%;
  background: #1a1a1a;
  border: 1.5px solid #2a2a2a;
  color: #fff;
  padding: 11px 14px 11px 40px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input-wrap input:focus { border-color: #c0123c; }

.search-input-wrap .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  font-size: 16px;
  pointer-events: none;
}

.search-ac-wrap {
  position: relative;
  flex: 0 1 200px;
}

.search-ac-wrap input[type="text"] {
  width: 100%;
  background: #1a1a1a;
  border: 1.5px solid #2a2a2a;
  color: #fff;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-ac-wrap input:focus { border-color: #c0123c; }

.search-btn {
  background: linear-gradient(135deg, #c0123c, #e63060);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.15s;
}

.search-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* オートコンプリートドロップダウン */
.ac-list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  list-style: none;
  margin: 0;
}

.ac-list.open {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ac-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: #252525;
  border: 1px solid #333;
  border-radius: 999px;
  color: #eee;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s;
}

.ac-item:hover { background: #333; }

.ac-item .ac-count {
  color: #666;
  font-size: 11px;
}


/* ============================================================
   フィルタータグ行
   ============================================================ */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  color: #ccc;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s;
}

.filter-tag:hover, .filter-tag.active {
  background: #c0123c;
  border-color: #c0123c;
  color: #fff;
}


/* ============================================================
   ページタイトルヘッダー
   ============================================================ */
.archive-hero {
  background: linear-gradient(135deg, #140a0d, #1a0d12);
  border: 1px solid #2e1520;
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 24px;
}

.archive-hero h1 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
  color: #fff;
}

.archive-hero p {
  font-size: 13px;
  color: #999;
  margin: 0;
}

.archive-count {
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
}

.archive-count strong { color: #ff8fb1; }


/* ============================================================
   ペジネーション
   ============================================================ */
.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
}

.page-numbers li a,
.page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #ccc;
  font-size: 14px;
  transition: all 0.15s;
}

.page-numbers li a:hover {
  background: #c0123c;
  border-color: #c0123c;
  color: #fff;
}

.page-numbers li .current {
  background: #c0123c;
  border-color: #c0123c;
  color: #fff;
  font-weight: 700;
}


/* ============================================================
   作品詳細ページ
   ============================================================ */
.manga-single {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.manga-single__hero {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
}

@media (min-width: 640px) {
  .manga-single__hero {
    grid-template-columns: 260px 1fr;
    align-items: start;
  }
}

/* カバー画像 */
.manga-single__cover {
  position: relative;
}

.manga-single__cover img {
  width: 100%;
  border-radius: 12px;
  display: block;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.manga-single__cover-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

/* 右カラム */
.manga-single__info {}

.manga-single__title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 10px;
  color: #fff;
}

@media (max-width: 639px) {
  .manga-single__title { font-size: 18px; }
}

.manga-single__author {
  font-size: 15px;
  color: #ff8fb1;
  margin-bottom: 14px;
}

.manga-single__author a {
  color: #ff8fb1;
  text-decoration: underline;
}

/* メインCTAボタン */
.manga-cta {
  display: block;
  background: linear-gradient(135deg, #c0123c, #e63060);
  color: #fff;
  text-align: center;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 900;
  margin: 16px 0;
  box-shadow: 0 6px 20px rgba(192, 18, 60, 0.4);
  transition: all 0.2s;
  line-height: 1.4;
}

.manga-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(192, 18, 60, 0.55);
  filter: brightness(1.05);
}

.manga-cta .cta-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 3px;
}

/* サブCTA */
.manga-cta-sub {
  display: block;
  background: #1a1a1a;
  border: 1.5px solid #333;
  color: #ccc;
  text-align: center;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
  transition: border-color 0.15s, color 0.15s;
}

.manga-cta-sub:hover {
  border-color: #c0123c;
  color: #fff;
}

/* 情報テーブル */
.manga-info-table {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.manga-info-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: #ccc;
  line-height: 1.5;
}

.manga-info-row .label {
  color: #666;
  flex-shrink: 0;
  min-width: 70px;
}

/* タグチップ */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  background: #1e1e1e;
  border: 1px solid #2e2e2e;
  color: #ccc;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.15s;
}

.chip:hover {
  background: #c0123c;
  border-color: #c0123c;
  color: #fff;
}

.chip.chip--author {
  background: #1a0d12;
  border-color: #5c1a2e;
  color: #ff8fb1;
}

.chip.chip--author:hover {
  background: #c0123c;
  border-color: #c0123c;
  color: #fff;
}


/* ============================================================
   セクション（詳細ページ内）
   ============================================================ */
.manga-section {
  margin-top: 32px;
}

.manga-section__title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  gap: 8px;
}

.manga-section__title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: #c0123c;
  border-radius: 2px;
}


/* ============================================================
   サンプルページビューア
   ============================================================ */
.sample-viewer {
  background: #0f0f0f;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 16px;
}

.sample-viewer__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 640px) {
  .sample-viewer__grid { grid-template-columns: repeat(3, 1fr); }
}

.sample-viewer__grid img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  display: block;
}

.sample-viewer__grid img:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

/* ライトボックス */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
  opacity: 0.7;
}

.lightbox__close:hover { opacity: 1; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.lightbox__nav:hover { opacity: 1; }
.lightbox__prev { left: 12px; }
.lightbox__next { right: 12px; }


/* ============================================================
   SEOテキスト（details/summary）
   ============================================================ */
.seo-block {
  margin-top: 40px;
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  padding: 18px 20px;
}

.seo-block summary {
  font-size: 14px;
  color: #666;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.seo-block summary::-webkit-details-marker { display: none; }

.seo-block summary::after {
  content: ' ▼';
  font-size: 11px;
}

.seo-block[open] summary::after { content: ' ▲'; }

.seo-body {
  margin-top: 16px;
  font-size: 13px;
  color: #888;
  line-height: 1.8;
}

.seo-body h1, .seo-body h2, .seo-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: #bbb;
  margin: 16px 0 8px;
}

.seo-body p { margin: 0 0 10px; }


/* ============================================================
   作者・ジャンルアーカイブページ
   ============================================================ */
.tax-hero {
  background: linear-gradient(135deg, #140a0d, #1a0d12);
  border: 1px solid #2e1520;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.tax-hero__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a1a22;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.tax-hero__body h1 {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
}

.tax-hero__body p {
  font-size: 13px;
  color: #999;
  margin: 0;
}

.tax-hero__count {
  font-size: 12px;
  color: #c0123c;
  margin-top: 4px;
}

/* 関連ジャンル/作者リスト */
.related-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}


/* ============================================================
   トップページ
   ============================================================ */
.top-hero {
  background: linear-gradient(135deg, #140008, #1a000f, #200018);
  border-radius: 14px;
  padding: 28px 24px;
  margin-bottom: 32px;
  text-align: center;
  border: 1px solid #2e0020;
}

.top-hero h1 {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
}

.top-hero h1 .accent { color: #ff1a4f; }

.top-hero p {
  font-size: 14px;
  color: #aaa;
  margin: 0 0 20px;
}

/* ジャンルクイックナビ */
.genre-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.genre-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #141414;
  border: 1px solid #2a2a2a;
  color: #ccc;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s;
}

.genre-nav-item:hover {
  background: #c0123c;
  border-color: #c0123c;
  color: #fff;
}

.genre-nav-item .count {
  font-size: 11px;
  color: #666;
}

.genre-nav-item:hover .count { color: rgba(255,255,255,0.7); }


/* ============================================================
   フッター
   ============================================================ */
.site-footer {
  background: #0a0a0a;
  border-top: 1px solid #1e1e1e;
  padding: 32px 16px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.footer-nav a {
  color: #666;
  font-size: 13px;
  transition: color 0.15s;
}

.footer-nav a:hover { color: #ccc; }

.footer-copy {
  font-size: 11px;
  color: #444;
}

.footer-legal {
  font-size: 11px;
  color: #444;
  line-height: 1.8;
  margin-top: 10px;
}

.footer-legal a { color: #555; }


/* ============================================================
   おすすめ作品（横スクロール）
   ============================================================ */
.recommend-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (min-width: 640px) {
  .recommend-list { grid-template-columns: repeat(4, 1fr); }
}

.recommend-item {
  display: block;
  text-decoration: none;
}

.recommend-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  border: 1px solid #2a2a2a;
  transition: transform 0.15s;
}

.recommend-item:hover img { transform: translateY(-3px); }

.recommend-item__title {
  font-size: 12px;
  color: #ccc;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}


/* ============================================================
   告知バナー（セール・新刊）
   ============================================================ */
.promo-banner {
  background: linear-gradient(135deg, #7c1a2e, #c0123c);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.promo-banner__text h2 {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
}

.promo-banner__text p {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin: 0;
}

.promo-banner__btn {
  background: #fff;
  color: #c0123c;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.promo-banner__btn:hover { opacity: 0.9; }


/* ============================================================
   スマホ対応
   ============================================================ */
@media (max-width: 639px) {
  .site-header-inner { gap: 8px; }
  .header-search-mini { display: none; }
  .search-form { flex-direction: column; }
  .search-ac-wrap { flex: unset; }
  .manga-single__title { font-size: 17px; }
  .top-hero h1 { font-size: 20px; }
  .tax-hero { flex-direction: column; }
}


/* ============================================================
   ユーティリティ
   ============================================================ */
.text-muted { color: #888; }
.text-accent { color: #ff1a4f; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none; }
