/*
Theme Name: FANZA Affi Dark
Theme URI: https://siroto-douga.com/
Description: FANZA Auto Plugin専用に設計したアダルトアフィリエイト向け軽量ダークテーマ。1カラム・モバイルファースト・FANZA購買導線最優先。
Author: ando
Version: 1.0.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: fanza-affi-dark
*/

/* ---------- 変数 ---------- */
:root {
  --bg: #0e1014;
  --surface: #171a21;
  --surface-2: #1e2230;
  --border: #2a2f3d;
  --text: #e7e9ef;
  --text-sub: #9aa1b2;
  --accent: #ff4d6d;      /* CTA・強調 */
  --accent-dark: #d63a57;
  --link: #8ab4ff;
  --radius: 10px;
  --maxw: 780px;
}

/* ---------- リセット/ベース ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { opacity: .85; }
ul, ol { padding-left: 1.4em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 14px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14,16,20,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.site-title { font-size: 1.15rem; font-weight: 700; }
.site-title a { color: var(--text); }
.site-title a span { color: var(--accent); }
.header-search { margin-left: auto; }
.header-search form { display: flex; gap: 6px; }
.header-search input[type="search"] {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 6px 10px; width: 150px; font-size: .9rem;
}
.header-search button {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: .9rem;
}
.global-nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.global-nav ul { display: flex; gap: 4px; list-style: none; padding: 0 0 6px; white-space: nowrap; }
.global-nav a {
  display: block; padding: 4px 12px; font-size: .85rem; color: var(--text-sub);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.global-nav a:hover { color: var(--text); border-color: var(--accent); opacity: 1; }

/* ---------- パンくず ---------- */
.breadcrumb {
  font-size: .78rem; color: var(--text-sub); margin: 12px 0;
  overflow-x: auto; white-space: nowrap;
}
.breadcrumb a { color: var(--text-sub); }
.breadcrumb .sep { margin: 0 6px; opacity: .5; }

/* ---------- アーカイブヘッダー ---------- */
.archive-header { margin: 18px 0 14px; }
.archive-header h1 { font-size: 1.3rem; line-height: 1.4; }
.archive-header .archive-type { color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .06em; }
.archive-header .archive-desc { color: var(--text-sub); font-size: .9rem; margin-top: 6px; }
.archive-header .archive-count { color: var(--text-sub); font-size: .82rem; margin-top: 4px; }

/* ---------- カードグリッド ---------- */
.card-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  margin: 16px 0;
}
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .12s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card a.card-link { color: var(--text); display: flex; flex-direction: column; height: 100%; }
.card a.card-link:hover { opacity: 1; }
.card .thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .card-title {
  font-size: .82rem; font-weight: 600; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .card-meta { margin-top: auto; font-size: .72rem; color: var(--text-sub); display: flex; gap: 8px; flex-wrap: wrap; }
.card .card-meta .label { color: var(--accent); }
.card .card-meta .actress-name { width: 100%; font-weight: 600; }

/* ---------- 記事 ---------- */
.single-article { margin: 16px 0 40px; }
.single-article h1.entry-title { font-size: 1.25rem; line-height: 1.5; margin-bottom: 8px; }
.entry-meta { font-size: .8rem; color: var(--text-sub); margin-bottom: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.entry-content { font-size: .95rem; }
.entry-content > * + * { margin-top: 1em; }
.entry-content h2, .entry-content h3, .entry-content h4 {
  line-height: 1.5; margin-top: 1.8em; padding: 8px 12px;
  background: var(--surface); border-left: 4px solid var(--accent); border-radius: 4px;
  font-size: 1.05rem;
}
.entry-content img { border-radius: 6px; margin-left: auto; margin-right: auto; }
.entry-content figure { margin: 1.2em auto; }
.entry-content figcaption { font-size: .75rem; color: var(--text-sub); text-align: center; margin-top: 4px; }
.entry-content iframe, .entry-content video { max-width: 100%; border-radius: 6px; }
.entry-content blockquote {
  background: var(--surface); border-left: 4px solid var(--border);
  padding: 12px 14px; border-radius: 4px; font-size: .88rem; color: var(--text-sub);
}
.entry-content blockquote cite { font-size: .75rem; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.entry-content th { background: var(--surface); white-space: nowrap; }
.entry-content a { word-break: break-all; }

/* プラグイン出力のCTAボタン(インライン色はそのまま活かしつつ形を整える) */
.entry-content .wp-block-button__link {
  display: block; text-align: center; padding: 14px 18px; border-radius: 8px !important;
  font-weight: 700; font-size: 1rem; box-shadow: 0 4px 14px rgba(255,77,109,.25);
}
.entry-content .wp-block-buttons { margin: 1.4em 0; }

/* 旧SWELLテンプレート由来のボタン互換(テーマ切替後もボタンとして表示) */
.entry-content .swell-block-button { margin: 1.4em 0; text-align: center; }
.entry-content .swell-block-button__link {
  display: block; text-align: center; padding: 14px 18px; border-radius: 8px;
  font-weight: 700; font-size: 1rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 4px 14px rgba(255,77,109,.25);
}
.entry-content .swell-block-button__link:hover { opacity: .92; }

/* テンプレートから使える汎用CTAリンク */
.entry-content a.fanza-cta {
  display: block; text-align: center; padding: 14px 18px; border-radius: 8px;
  font-weight: 700; font-size: 1rem; color: #fff; margin: 1.4em 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 4px 14px rgba(255,77,109,.25);
}
.entry-content a.fanza-cta:hover { opacity: .92; }

/* 関連記事(プラグイン/テーマ共通) */
.related-posts-container {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 10px 0 20px;
}
@media (min-width: 640px) { .related-posts-container { grid-template-columns: repeat(3, 1fr); } }
.related-post { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.related-post img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.related-post-title { font-size: .78rem; padding: 6px 8px; line-height: 1.4; }
.related-post-title a { color: var(--text); }
.related-post-date { font-size: .7rem; color: var(--text-sub); padding: 0 8px 8px; }

/* PR表記 */
.fanza-pr-notice { font-size: .72rem; color: var(--text-sub); background: var(--surface); border-radius: 4px; padding: 4px 10px; display: inline-block; }

/* ---------- タグ/女優チップ ---------- */
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.chip {
  display: inline-block; padding: 3px 12px; font-size: .78rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-sub);
}
.chip:hover { border-color: var(--accent); color: var(--text); opacity: 1; }
.chip.actress { border-color: var(--accent-dark); color: var(--accent); }

/* ---------- ランキング ---------- */
.ranking-section { margin: 28px 0; }
.section-title {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 12px;
  padding-bottom: 6px; border-bottom: 2px solid var(--accent);
}
.ranking-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ranking-list li { counter-increment: rank; }
.ranking-item {
  display: flex; gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px;
  color: var(--text);
}
.ranking-item:hover { border-color: var(--accent); opacity: 1; }
.ranking-item .rank-no {
  flex: 0 0 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-sub); font-weight: 700; font-size: .8rem; border-radius: 6px;
}
.ranking-list li:nth-child(1) .rank-no { background: #c9a227; color: #111; }
.ranking-list li:nth-child(2) .rank-no { background: #aab4c4; color: #111; }
.ranking-list li:nth-child(3) .rank-no { background: #a9714b; color: #111; }
.ranking-item .rank-thumb { flex: 0 0 96px; }
.ranking-item .rank-thumb img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; }
.ranking-item .rank-title { font-size: .82rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 女優アーカイブ強化(v1.0.3) ---------- */
.archive-header .actress-alias { font-size: .82rem; color: var(--text-sub); margin-top: 8px; }
.archive-header .actress-labels { margin-top: 10px; font-size: .8rem; color: var(--text-sub); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.archive-header .actress-labels .chip { padding: 2px 10px; font-size: .75rem; }
.archive-cta { margin: 16px 0; }
.archive-cta a {
  display: block; text-align: center; padding: 13px 16px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; font-weight: 700; font-size: .95rem;
  box-shadow: 0 4px 14px rgba(255,77,109,.3);
}
.archive-cta a:hover { opacity: .92; }

/* 50音ナビ */
.kana-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 8px; }
.kana-nav a {
  display: inline-block; padding: 5px 14px; font-size: .82rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.kana-nav a:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.kana-section { margin: 22px 0; scroll-margin-top: 70px; }

/* ---------- 女優一覧 ---------- */
.actress-index { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; list-style: none; padding: 0; margin: 16px 0; }
@media (min-width: 640px) { .actress-index { grid-template-columns: repeat(3, 1fr); } }
.actress-index a {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: .85rem; color: var(--text);
}
.actress-index a:hover { border-color: var(--accent); opacity: 1; }
.actress-index .cnt { font-size: .72rem; color: var(--text-sub); }

/* ---------- ページネーション ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 26px 0; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-block; min-width: 38px; text-align: center; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: .85rem;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 固定CTAバー ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(14,16,20,.95); backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.sticky-cta a {
  display: block; max-width: var(--maxw); margin: 0 auto; text-align: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; font-weight: 700; font-size: .95rem;
  padding: 13px 16px; border-radius: 999px; box-shadow: 0 4px 16px rgba(255,77,109,.35);
}
.sticky-cta a:hover { opacity: .92; }
body.has-sticky-cta { padding-bottom: 76px; }

/* ---------- フッター ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 40px; padding: 24px 0 30px;
  font-size: .8rem; color: var(--text-sub);
}
.site-footer .footer-nav ul { display: flex; gap: 14px; flex-wrap: wrap; list-style: none; padding: 0; margin-bottom: 12px; }
.site-footer .footer-nav a { color: var(--text-sub); }
.site-footer .agenotice { margin-bottom: 8px; color: var(--accent); font-weight: 600; }

/* ---------- 汎用 ---------- */
.notfound { text-align: center; margin: 60px 0; }
.notfound h1 { font-size: 1.4rem; margin-bottom: 12px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
