/*
Theme Name: Aff Review Theme
Theme URI:
Author: AUTO-POST
Author URI:
Description: アダルトアフィリエイト特化型レビューテーマ。fanza-colab-auto-post / fanza-rewrite プラグインが出力する fcap-* ブロックをそのまま活かす軽量・高速設計。外部CDN依存なし（Vanilla CSS / Vanilla JS）。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: aff-review-theme
*/

/* ==========================================================================
   0. 変数・リセット
   ========================================================================== */
:root {
	--arv-primary: #e11d48;
	--arv-primary-dark: #be123c;
	--arv-secondary: #1f2937;
	--arv-bg: #f6f6f8;
	--arv-card-bg: #ffffff;
	--arv-border: #e5e7eb;
	--arv-text: #1f2937;
	--arv-text-muted: #6b7280;
	--arv-radius: 10px;
	--arv-radius-sm: 6px;
	--arv-max-width: 1120px;
	--arv-header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--arv-bg);
	color: var(--arv-text);
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	padding-bottom: 0;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }
.arv-wrap { max-width: var(--arv-max-width); margin: 0 auto; padding: 0 16px; }

/* ==========================================================================
   1. 年齢確認モーダル
   ========================================================================== */
.arv-age-modal {
	position: fixed; inset: 0; z-index: 9999;
	display: flex; align-items: center; justify-content: center;
	background: rgba(17, 24, 39, .96);
	padding: 16px;
}
.arv-age-modal[hidden] { display: none; }
.arv-age-modal__box {
	background: #fff; border-radius: var(--arv-radius);
	max-width: 420px; width: 100%; padding: 32px 24px; text-align: center;
	box-shadow: 0 20px 40px rgba(0,0,0,.3);
}
.arv-age-modal__box h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 12px; color: var(--arv-secondary); }
.arv-age-modal__box p { font-size: .875rem; color: #4b5563; margin: 0 0 20px; }
.arv-age-modal__actions { display: flex; gap: 12px; }
.arv-age-modal__btn {
	flex: 1; padding: 13px 10px; border: none; border-radius: var(--arv-radius-sm);
	font-weight: 700; font-size: .95rem;
}
.arv-age-modal__btn--yes { background: var(--arv-primary); color: #fff; }
.arv-age-modal__btn--yes:hover { background: var(--arv-primary-dark); }
.arv-age-modal__btn--no { background: #e5e7eb; color: #374151; }
.arv-age-modal__note { font-size: .7rem; color: #9ca3af; margin: 16px 0 0; }

/* ==========================================================================
   2. ヘッダー・ナビ
   ========================================================================== */
.arv-header {
	position: sticky; top: 0; z-index: 500;
	background: #fff; border-bottom: 1px solid var(--arv-border);
}
.arv-header__inner {
	display: flex; align-items: center; justify-content: space-between;
	height: var(--arv-header-h);
}
.arv-logo { font-size: 1.15rem; font-weight: 700; color: var(--arv-secondary); display: flex; align-items: center; gap: 8px; }
.arv-logo span { color: var(--arv-primary); }
.arv-nav { display: none; }
.arv-nav ul { display: flex; gap: 24px; font-size: .875rem; font-weight: 600; }
.arv-nav a:hover { color: var(--arv-primary); }
.arv-menu-btn {
	display: block; background: none; border: none; font-size: 1.5rem; color: var(--arv-secondary);
	padding: 4px 8px;
}
.arv-mobile-menu {
	display: none; position: absolute; top: var(--arv-header-h); left: 0; right: 0;
	background: #fff; border-top: 1px solid var(--arv-border); box-shadow: 0 8px 16px rgba(0,0,0,.08);
	padding: 8px 16px 16px; z-index: 490;
}
.arv-mobile-menu.is-open { display: block; }
.arv-mobile-menu li { border-bottom: 1px solid #f3f4f6; }
.arv-mobile-menu a { display: block; padding: 12px 4px; font-size: .9rem; font-weight: 600; }

@media (min-width: 860px) {
	.arv-nav { display: block; }
	.arv-menu-btn { display: none; }
	.arv-mobile-menu { display: none !important; }
}

/* ==========================================================================
   3. レイアウト（メイン＋サイドバー）
   ========================================================================== */
.arv-layout { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 28px 0 48px; }
@media (min-width: 960px) {
	.arv-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
}
.arv-main { min-width: 0; }

/* ==========================================================================
   4. カード・グリッド（新着／アーカイブ一覧）
   ========================================================================== */
.arv-card-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 620px) {
	.arv-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.arv-card {
	background: var(--arv-card-bg); border: 1px solid var(--arv-border); border-radius: var(--arv-radius);
	overflow: hidden; display: flex; flex-direction: column;
	transition: box-shadow .2s ease, transform .2s ease;
}
.arv-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.arv-card__thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: linear-gradient(135deg,#f43f5e,#f59e0b); }
.arv-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.arv-card:hover .arv-card__thumb img { transform: scale(1.05); }
.arv-card__thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .05em; }
.arv-card__cat {
	position: absolute; top: 8px; left: 8px; z-index: 2;
	background: rgba(17,24,39,.78); color: #fff; font-size: .68rem; font-weight: 700;
	padding: 3px 8px; border-radius: 4px;
}
.arv-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex-grow: 1; }
.arv-card__meta { display: flex; align-items: center; gap: 8px; font-size: .72rem; color: var(--arv-text-muted); margin-bottom: 8px; }
.arv-card__title { font-size: .95rem; font-weight: 700; margin: 0 0 8px; line-height: 1.5; }
.arv-card__title a:hover { color: var(--arv-primary); }
.arv-card__excerpt { font-size: .82rem; color: #6b7280; margin: 0 0 12px; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.arv-card__more { font-size: .8rem; font-weight: 700; color: var(--arv-primary); margin-top: auto; }

/* ==========================================================================
   5. ランキング
   ========================================================================== */
.arv-ranking-section { margin-bottom: 32px; }
.arv-section-title {
	font-size: 1.2rem; font-weight: 700; color: var(--arv-secondary);
	display: flex; align-items: center; gap: 8px; margin: 0 0 16px;
	border-left: 4px solid var(--arv-primary); padding-left: 10px;
}
.arv-ranking-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .arv-ranking-list { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.arv-rank-item {
	display: flex; gap: 12px; align-items: center; background: var(--arv-card-bg);
	border: 1px solid var(--arv-border); border-radius: var(--arv-radius-sm); padding: 10px; position: relative;
}
.arv-rank-badge {
	position: absolute; top: 0; left: 0; width: 24px; height: 24px;
	display: flex; align-items: center; justify-content: center;
	background: #9ca3af; color: #fff; font-size: .72rem; font-weight: 800;
	border-radius: var(--arv-radius-sm) 0 8px 0;
}
.arv-rank-badge.is-1 { background: #f59e0b; }
.arv-rank-badge.is-2 { background: #94a3b8; }
.arv-rank-badge.is-3 { background: #b45309; }
.arv-rank-thumb { width: 64px; height: 64px; flex-shrink: 0; border-radius: 6px; overflow: hidden; }
.arv-rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.arv-rank-title { font-size: .8rem; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ==========================================================================
   6. サイドバー
   ========================================================================== */
.arv-widget { background: var(--arv-card-bg); border: 1px solid var(--arv-border); border-radius: var(--arv-radius); padding: 18px; margin-bottom: 20px; }
.arv-widget h3 { font-size: .95rem; font-weight: 700; margin: 0 0 14px; color: var(--arv-secondary); }
.arv-search-form { display: flex; gap: 8px; }
.arv-search-form input[type="search"] { flex: 1; border: 1px solid var(--arv-border); border-radius: var(--arv-radius-sm); padding: 9px 10px; }
.arv-search-form button { background: var(--arv-secondary); color: #fff; border: none; border-radius: var(--arv-radius-sm); padding: 0 14px; }
.arv-widget-list li { border-bottom: 1px dashed #f0f0f0; }
.arv-widget-list li:last-child { border-bottom: none; }
.arv-widget-list a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; font-size: .82rem; }
.arv-widget-list a:hover { color: var(--arv-primary); }
.arv-widget-list .count { color: #9ca3af; font-size: .72rem; }
.arv-tagcloud a { display: inline-block; margin: 0 6px 6px 0; padding: 4px 10px; background: #f3f4f6; border-radius: 999px; font-size: .75rem; }
.arv-tagcloud a:hover { background: #fde3e9; color: var(--arv-primary); }
.arv-ad-slot {
	text-align: center; padding: 16px; border: 2px dashed var(--arv-border); border-radius: var(--arv-radius-sm);
	color: #9ca3af; font-size: .72rem;
}
@media (min-width: 960px) { .arv-sidebar-sticky { position: sticky; top: calc(var(--arv-header-h) + 16px); } }

/* ==========================================================================
   7. パンくず・アーカイブヘッダー
   ========================================================================== */
.arv-breadcrumb { font-size: .74rem; color: var(--arv-text-muted); margin: 16px 0; }
.arv-breadcrumb a:hover { color: var(--arv-primary); }
.arv-breadcrumb .sep { margin: 0 6px; }
.arv-archive-header {
	background: var(--arv-card-bg); border: 1px solid var(--arv-border); border-top: 4px solid var(--arv-primary);
	border-radius: var(--arv-radius); padding: 20px 22px; margin-bottom: 24px;
}
.arv-archive-header h1 { font-size: 1.35rem; margin: 0 0 8px; color: var(--arv-secondary); }
.arv-archive-header .arv-term-desc { font-size: .85rem; color: #4b5563; }
.arv-archive-header .arv-term-desc p:last-child { margin-bottom: 0; }

/* ==========================================================================
   8. 記事詳細（entry-content タイポグラフィ）
   ========================================================================== */
.arv-article { background: var(--arv-card-bg); border: 1px solid var(--arv-border); border-radius: var(--arv-radius); overflow: hidden; margin-bottom: 24px; }
.arv-article__header { padding: 24px 22px 4px; }
.arv-article__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .74rem; color: var(--arv-text-muted); margin-bottom: 14px; }
.arv-article__meta .arv-cat-badge { background: #eff6ff; color: #2563eb; font-weight: 700; padding: 3px 9px; border-radius: 4px; }
.arv-article__meta .arv-pr-badge { background: #f3f4f6; color: #6b7280; border: 1px solid var(--arv-border); font-size: .65rem; padding: 2px 7px; border-radius: 4px; }
.arv-article__title { font-size: 1.5rem; line-height: 1.4; margin: 0 0 18px; color: var(--arv-secondary); }
.arv-article__thumb { aspect-ratio: 16/9; overflow: hidden; border-radius: var(--arv-radius-sm); margin-bottom: 6px; background: linear-gradient(135deg,#f43f5e,#f59e0b); }
.arv-article__thumb img { width: 100%; height: 100%; object-fit: cover; }

.entry-content { padding: 20px 22px 26px; color: var(--arv-text); }
.entry-content h2 {
	font-size: 1.35rem; font-weight: 700; margin: 2em 0 .8em; padding-bottom: .4em;
	border-bottom: 3px solid var(--arv-primary); color: var(--arv-secondary);
}
.entry-content h2:first-child { margin-top: 0; }
.entry-content h3 {
	font-size: 1.1rem; font-weight: 700; margin: 1.6em 0 .7em; padding-left: .6em;
	border-left: 4px solid var(--arv-secondary);
}
.entry-content p { margin: 0 0 1.4em; line-height: 1.85; }
.entry-content ul, .entry-content ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
	margin: 0 0 1.4em; padding: 14px 16px; background: #f9fafb; border-left: 4px solid var(--arv-border);
	color: #6b7280; font-style: italic; border-radius: var(--arv-radius-sm);
}
.entry-content img { border-radius: var(--arv-radius-sm); }

/* wp:table 対応（fcap-detail-table = 作品情報テーブル） */
.entry-content .wp-block-table,
.entry-content .fcap-detail-table { margin: 0 0 1.6em; overflow-x: auto; }
.entry-content table.has-fixed-layout { table-layout: auto; }
.entry-content .fcap-detail-table table,
.entry-content figure.fcap-detail-table table {
	width: 100%; border-collapse: collapse; font-size: .86rem;
}
.entry-content .fcap-detail-table th,
.entry-content .fcap-detail-table td {
	border: 1px solid var(--arv-border); padding: 9px 12px; text-align: left; vertical-align: top;
}
.entry-content .fcap-detail-table th {
	background: #f9fafb; width: 30%; white-space: nowrap; color: #4b5563; font-weight: 700;
}
.entry-content .fcap-detail-table tr:nth-child(even) td { background: #fcfcfd; }

/* fcap-* ブロック（プラグイン側でインライン装飾済み）の外側余白のみ調整 */
.entry-content .fcap-sample-video,
.entry-content .fcap-tachiyomi,
.entry-content .fcap-sample-gallery,
.entry-content .fcap-cta,
.entry-content .fcap-cta-2d,
.entry-content .fcap-cta-mini { max-width: 100%; }

.arv-article__footer { padding: 18px 22px 24px; border-top: 1px solid var(--arv-border); background: #fafafa; }
.arv-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .78rem; }
.arv-tags a { background: #f3f4f6; padding: 5px 11px; border-radius: 999px; }
.arv-tags a:hover { background: #fde3e9; color: var(--arv-primary); }

/* ==========================================================================
   9. 関連記事・前後記事ナビ
   ========================================================================== */
.arv-related { margin-bottom: 28px; }
.arv-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.arv-post-nav a {
	display: block; background: var(--arv-card-bg); border: 1px solid var(--arv-border); border-radius: var(--arv-radius-sm);
	padding: 12px 14px; font-size: .78rem;
}
.arv-post-nav a:hover { border-color: var(--arv-primary); }
.arv-post-nav .dir { display: block; color: var(--arv-text-muted); font-size: .68rem; margin-bottom: 4px; }
.arv-post-nav .next { text-align: right; }

/* ==========================================================================
   10. ページネーション
   ========================================================================== */
.arv-pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.arv-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px;
	border: 1px solid var(--arv-border); border-radius: var(--arv-radius-sm); font-size: .82rem; padding: 0 10px;
	background: var(--arv-card-bg);
}
.arv-pagination .page-numbers.current { background: var(--arv-primary); color: #fff; border-color: var(--arv-primary); }
.arv-pagination a.page-numbers:hover { border-color: var(--arv-primary); color: var(--arv-primary); }

/* ==========================================================================
   11. フッター
   ========================================================================== */
.arv-footer { background: var(--arv-secondary); color: #d1d5db; padding: 36px 0 100px; margin-top: 24px; }
.arv-footer__logo { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.arv-footer__notice { font-size: .8rem; max-width: 640px; margin: 0 auto 20px; text-align: center; }
.arv-footer__notice strong { color: var(--arv-primary); }
.arv-footer__nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; font-size: .78rem; margin-bottom: 20px; }
.arv-footer__copy { text-align: center; font-size: .7rem; color: #9ca3af; }
@media (min-width: 860px) { .arv-footer { padding-bottom: 36px; } }

/* ==========================================================================
   12. スティッキーCTA（クリック計測: assets/js/main.js 側で付与）
   ========================================================================== */
.arv-sticky-cta {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
	background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.96) 30%);
	transform: translateY(120%); transition: transform .25s ease;
}
.arv-sticky-cta.is-visible { transform: translateY(0); }
.arv-sticky-cta__btn {
	display: block; max-width: 480px; margin: 0 auto; text-align: center;
	background: linear-gradient(45deg, var(--arv-primary), #f59e0b);
	color: #fff; font-weight: 700; font-size: 1rem; padding: 14px 18px;
	border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
@media (min-width: 860px) { .arv-sticky-cta { display: none; } }

/* ==========================================================================
   13. 404・検索
   ========================================================================== */
.arv-404 { text-align: center; padding: 56px 20px; background: var(--arv-card-bg); border: 1px solid var(--arv-border); border-radius: var(--arv-radius); }
.arv-404 h1 { font-size: 1.4rem; margin: 0 0 12px; color: var(--arv-secondary); }
.arv-404 p { color: #6b7280; margin: 0 0 24px; }
.arv-404 .arv-search-form { max-width: 420px; margin: 0 auto 24px; }
.arv-btn { display: inline-block; background: var(--arv-secondary); color: #fff; font-weight: 700; padding: 12px 26px; border-radius: var(--arv-radius-sm); }
.arv-btn:hover { background: #111827; }

.arv-empty { padding: 32px; text-align: center; color: var(--arv-text-muted); background: var(--arv-card-bg); border: 1px dashed var(--arv-border); border-radius: var(--arv-radius); }
