/*
Theme Name: 俺の性癖
Description: NTR専門 FANZAアフィリエイト用テーマ（FANZA API 自動取り込み付き）
Version: 1.4.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: ore-no-seiheki
*/

:root {
  --bg: #14101c;
  --surface: #1e1729;
  --surface-2: #2a2038;
  --line: #3a2d4d;
  --text: #ece6f5;
  --muted: #a597bb;
  --accent: #9b5cf6;
  --accent-2: #c084fc;
  --accent-deep: #6d28d9;
  --sale: #f43f5e;
  --radius: 10px;
}
html { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== 年齢確認 ===== */
#age-gate {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 6, 16, .96);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
#age-gate[hidden] { display: none; }
#age-gate .box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px 24px; max-width: 420px; width: 100%; text-align: center;
}
#age-gate h2 { margin: 0 0 8px; font-size: 20px; }
#age-gate p { color: var(--muted); margin: 0 0 24px; font-size: 13px; }
#age-gate .btns { display: flex; gap: 12px; }
#age-gate button { flex: 1; padding: 12px; border-radius: 8px; border: 0; cursor: pointer; font-size: 15px; font-weight: bold; }
.btn-yes { background: var(--accent); color: #fff; }
.btn-no { background: var(--surface-2); color: var(--muted); }

/* ===== ヘッダー ===== */
.site-header {
  background: linear-gradient(90deg, var(--accent-deep), #4c1d95 60%, #2e1065);
  border-bottom: 2px solid var(--accent-2);
}
.head-inner { display: flex; align-items: center; gap: 16px; padding: 14px 16px; flex-wrap: wrap; }
.logo { font-size: 26px; font-weight: 900; letter-spacing: .04em; white-space: nowrap; }
.logo small { display: block; font-size: 11px; font-weight: normal; color: #e9d5ff; letter-spacing: .1em; }
.search { flex: 1; min-width: 200px; display: flex; }
.search input {
  flex: 1; padding: 10px 12px; border: 0; border-radius: 8px 0 0 8px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 14px; min-width: 0;
}
.search input::placeholder { color: #d8c8f0; }
.search button { padding: 0 16px; border: 0; border-radius: 0 8px 8px 0; background: var(--accent-2); color: #2e1065; font-weight: bold; cursor: pointer; }
.x-link { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; background: #000; border-radius: 999px; font-weight: bold; font-size: 13px; white-space: nowrap; }

nav.genres { background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
nav.genres::-webkit-scrollbar { display: none; }
nav.genres ul { display: flex; gap: 4px; list-style: none; padding: 8px 16px; max-width: 1200px; margin: 0 auto; }
nav.genres a { display: block; padding: 6px 14px; border-radius: 999px; white-space: nowrap; color: var(--muted); }
nav.genres a.active, nav.genres .current-menu-item > a, nav.genres a:hover { background: var(--accent); color: #fff; }

.pr-note { font-size: 11px; color: var(--muted); padding: 8px 16px 0; max-width: 1200px; margin: 0 auto; }

/* ===== 自作品バナー ===== */
.promo {
  margin: 16px 0; padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(120deg, #7c3aed, #db2777);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.promo strong { font-size: 17px; display: block; }
.promo span { font-size: 12px; opacity: .9; }
.promo .cta { background: #fff; color: #6d28d9; font-weight: bold; padding: 10px 18px; border-radius: 999px; white-space: nowrap; opacity: 1; font-size: 13px; }

/* ===== レイアウト ===== */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding: 16px 0 40px; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.list-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 12px; gap: 8px; flex-wrap: wrap; }
.list-head h1 { font-size: 18px; margin: 0; border-left: 4px solid var(--accent); padding-left: 10px; }
.sort { display: flex; background: var(--surface); border-radius: 8px; padding: 3px; }
.sort a { color: var(--muted); padding: 6px 12px; border-radius: 6px; font-size: 13px; }
.sort a.on { background: var(--accent); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.thumb {
  position: relative; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4c1d95, #be185d); overflow: hidden;
}
/* FANZAのパッケージ画像は右半分が表面なので右寄せで切り抜く */
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.thumb .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.75); padding: 1px 6px; border-radius: 4px; font-size: 11px; color: #fff; }
.thumb .badge { position: absolute; left: 6px; top: 6px; }
.badge { background: var(--sale); color: #fff; font-size: 11px; font-weight: bold; padding: 1px 7px; border-radius: 4px; }
.thumb .play { position: relative; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; }
.card-body { padding: 8px 10px 10px; }
.card-title { font-size: 13px; font-weight: bold; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 6px; gap: 6px; }
.tags-mini { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.tags-mini span { font-size: 10px; background: var(--surface-2); color: var(--accent-2); padding: 1px 6px; border-radius: 4px; }

.pager { display: flex; justify-content: center; gap: 6px; margin: 24px 0 0; flex-wrap: wrap; }
.pager .page-numbers { min-width: 36px; text-align: center; padding: 7px 10px; background: var(--surface); border-radius: 6px; }
.pager .page-numbers.current { background: var(--accent); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* ===== 作品ページ ===== */
.single-title { font-size: 20px; line-height: 1.5; margin: 8px 0 14px; }
/* DMMのプレイヤーは720x480前提なので、それ以上に広げない */
.player { background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; max-width: 720px; margin: 0 auto; }
.player iframe, .player img { display: block; width: 100%; height: 100%; border: 0; object-fit: contain; }
.buy-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 16px 0; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(90deg, #e11d48, #db2777); color: #fff; font-size: 17px; font-weight: bold;
  box-shadow: 0 4px 18px rgba(219, 39, 119, .35);
}
.buy-btn:hover { filter: brightness(1.1); }
.buy-btn.sub { background: var(--surface-2); box-shadow: none; font-size: 15px; padding: 12px; margin-top: -6px; }

/* 漫画：縦長の表紙を切らずに表示し、余白はぼかした表紙で埋める */
.is-book .thumb img { object-fit: contain; object-position: center; }
.thumb-bg { position: absolute; inset: -10px; background-size: cover; background-position: center; filter: blur(12px) brightness(.5); }
.kind-badge { position: absolute; right: 6px; top: 6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: bold; padding: 1px 7px; border-radius: 4px; }
.player.is-book { aspect-ratio: 3 / 4; max-width: 420px; }
.buy-btn .badge { background: #fff; color: var(--sale); }
.info { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.info th, .info td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.info th { width: 100px; color: var(--muted); font-weight: normal; white-space: nowrap; }
.info td a { color: var(--accent-2); }
.info tr:last-child th, .info tr:last-child td { border-bottom: 0; }
.sub-head { font-size: 17px; margin: 28px 0 12px; border-left: 4px solid var(--accent); padding-left: 10px; }
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.samples img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }

/* ===== X投稿用（管理者のみ） ===== */
.share-box { background: #0b0b0f; border: 1px dashed var(--accent); border-radius: var(--radius); padding: 12px; margin: 0 0 16px; }
.share-head { font-weight: bold; margin-bottom: 8px; }
.share-head small { color: var(--muted); font-weight: normal; }
.share-box textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.share-btns button, .share-btns a { padding: 8px 14px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.share-btns a { background: #000; font-weight: bold; }

/* ===== 固定ページ・フォーム ===== */
.entry { background: var(--surface); border-radius: var(--radius); padding: 20px; line-height: 1.9; }
.entry h2 { font-size: 16px; margin: 24px 0 8px; border-left: 4px solid var(--accent); padding-left: 10px; }
.entry h2:first-child { margin-top: 0; }
.entry a { color: var(--accent-2); text-decoration: underline; }
.entry table { width: 100%; border-collapse: collapse; }
.entry th, .entry td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.entry th { width: 120px; color: var(--muted); font-weight: normal; }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--text); font: inherit;
}
.contact-form button { padding: 12px 32px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: bold; font-size: 15px; cursor: pointer; }
.contact-form .hp { position: absolute; left: -9999px; }
.form-msg { padding: 12px 14px; border-radius: 8px; margin: 12px 0; }
.form-msg.ok { background: #14532d; }
.form-msg.ng { background: #7f1d1d; }

/* ===== サイドバー ===== */
aside .widget { background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
aside h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
aside h3::before { content: ""; width: 4px; height: 16px; background: var(--accent); border-radius: 2px; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; }
.rank .no { width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 12px; }
.rank li:nth-child(1) .no { background: #eab308; color: #000; }
.rank li:nth-child(2) .no { background: #cbd5e1; color: #000; }
.rank li:nth-child(3) .no { background: #c2703d; color: #000; }
.rank .rlink { display: flex; gap: 10px; align-items: center; min-width: 0; }
.rank .rthumb { position: relative; width: 72px; aspect-ratio: 16/9; border-radius: 4px; flex: none; overflow: hidden; background: linear-gradient(135deg, #4c1d95, #be185d); }
.rank .rthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.rank .rtitle { font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank .rviews { display: block; font-size: 11px; color: var(--muted); }

.tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tagcloud a { background: var(--surface-2); padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.tagcloud a:hover { background: var(--accent); color: #fff; }
.tagcloud em { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 3px; }

.side-promo { display: block; text-align: center; padding: 18px 14px; border-radius: var(--radius); background: linear-gradient(160deg, #6d28d9, #a21caf); margin-bottom: 16px; }
.side-promo strong { display: block; font-size: 16px; margin-bottom: 4px; }
.side-promo span { font-size: 12px; opacity: .9; }

/* ===== フッター ===== */
.site-footer { background: #0c0912; border-top: 1px solid var(--line); padding: 24px 16px; color: var(--muted); font-size: 12px; text-align: center; }
.site-footer ul { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 10px; }
.site-footer a:hover { color: var(--accent-2); }
.site-footer .credit { margin-bottom: 10px; }
.site-footer .credit img { display: inline-block; vertical-align: middle; }
