/*
Theme Name: Ero Ranking Theme
Theme URI: https://ero-douga-ranking.com
Author: ERO-GYM運営部
Description: AV複合キーワードランキング特化テーマ
Version: 1.0
*/

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

:root {
  --red: #e8002d;
  --red-dark: #b8001f;
  --navy: #0f1520;
  --navy-light: #1a2035;
  --white: #ffffff;
  --gray-bg: #f4f4f6;
  --gray-border: #e0e0e8;
  --text-main: #1a1a2e;
  --text-sub: #666680;
  --gold: #f5a623;
  --silver: #a8a8b8;
  --bronze: #cd7f32;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--gray-bg);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ===== ヘッダー ===== */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.site-logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
}

.site-logo span { color: var(--red); }
.site-logo small {
  font-size: 11px;
  color: #aaa;
  font-weight: 400;
  margin-left: 6px;
}

.header-search {
  display: flex;
  gap: 0;
}

.header-search input {
  padding: 6px 12px;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 13px;
  width: 200px;
}

.header-search button {
  padding: 6px 14px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

/* ===== グローバルナビ ===== */
.global-nav {
  background: var(--navy-light);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  overflow-x: auto;
}

.global-nav ul {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  list-style: none;
  white-space: nowrap;
}

.global-nav ul li a {
  display: block;
  padding: 10px 16px;
  color: #ccc;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.global-nav ul li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

/* ===== メインレイアウト ===== */
.site-wrap {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

/* ===== セクションタイトル ===== */
.section-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--navy);
  border-left: 4px solid var(--red);
  padding: 6px 12px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 0 4px 4px 0;
}

/* ===== カードグリッド（一覧ページ） ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #111;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

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

.card-cat {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  color: #fff;
  background: var(--red);
}

.card-body {
  padding: 12px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.card-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: #f0f0f8;
  color: var(--navy);
  border-radius: 20px;
  font-weight: 500;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.card-meta {
  font-size: 11px;
  color: #999;
}

/* ===== ランキング記事（single.php） ===== */
.ranking-post {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ranking-post-title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.4;
  color: var(--navy);
  margin-bottom: 8px;
}

.ranking-post-meta {
  font-size: 12px;
  color: #999;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-border);
}

/* 導入文 */
.ranking-intro {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-main);
  margin-bottom: 32px;
  padding: 16px;
  background: #f8f8fc;
  border-radius: 6px;
  border-left: 4px solid var(--red);
}

/* ランキングアイテム */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.ranking-item {
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 80px 1fr;
  position: relative;
  background: #fff;
  transition: box-shadow 0.2s;
}

.ranking-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* 順位バッジ */
.rank-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  background: var(--navy);
  min-height: 100px;
  padding: 8px;
}

.rank-badge.rank-1 { background: linear-gradient(135deg, #d4a800, #f5c518); color: #1a1a00; }
.rank-badge.rank-2 { background: linear-gradient(135deg, #888, #bbb); color: #111; }
.rank-badge.rank-3 { background: linear-gradient(135deg, #a0522d, #cd7f32); color: #fff; }

.rank-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 2px;
  opacity: 0.7;
}

/* アイテム本体 */
.ranking-item-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
}

.ranking-item-thumb {
  position: relative;
  overflow: hidden;
  background: #111;
}

.ranking-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ranking-item-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item-title {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
  color: var(--navy);
}

.ranking-item-actress {
  font-size: 12px;
  color: var(--text-sub);
}

.ranking-item-review {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ranking-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ranking-item-btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 4px;
  text-align: center;
  transition: background 0.2s;
  margin-top: auto;
  align-self: flex-start;
}

.ranking-item-btn:hover { background: var(--red-dark); }

/* まとめ文 */
.ranking-summary {
  background: #f8f8fc;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 32px;
  border-left: 4px solid var(--red);
}

.ranking-summary h2 {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--navy);
}

/* 最終CTAボタン */
.ranking-cta {
  text-align: center;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  border-radius: 10px;
  padding: 24px;
  margin-top: 32px;
}

.ranking-cta-btn {
  display: inline-block;
  background: #fff;
  color: var(--red);
  font-size: 16px;
  font-weight: 900;
  padding: 14px 40px;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.ranking-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.ranking-cta-note {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  margin-top: 10px;
}

/* ===== サイドバー ===== */
.sidebar-widget {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.widget-title {
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-left: 4px solid var(--red);
}

.widget-body { padding: 14px; }

.side-ranking-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-border);
}

.side-ranking-item:last-child { border-bottom: none; }

.side-rank-num {
  font-size: 18px;
  font-weight: 900;
  min-width: 28px;
  color: var(--navy);
}

.side-rank-num.top { color: var(--red); }

.side-rank-thumb {
  width: 70px;
  min-width: 70px;
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 4px;
  background: #111;
}

.side-rank-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-rank-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-list { list-style: none; }
.cat-list li { border-bottom: 1px solid var(--gray-border); }
.cat-list li:last-child { border-bottom: none; }

.cat-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--text-main);
  transition: color 0.2s;
}

.cat-list li a:hover { color: var(--red); }

.cat-count {
  font-size: 11px;
  color: #999;
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ===== フッター ===== */
.site-footer {
  background: var(--navy);
  color: #aaa;
  margin-top: 48px;
  padding: 40px 0 20px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-logo {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
}

.footer-logo span { color: var(--red); }

.footer-desc {
  font-size: 12px;
  line-height: 1.8;
  color: #888;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links li a {
  font-size: 12px;
  color: #888;
  transition: color 0.2s;
}
.footer-links li a:hover { color: #fff; }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
}

/* ===== ページネーション ===== */
.pagination {
  text-align: center;
  margin: 30px 0;
}

.pagination .page-numbers {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 2px;
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-main);
  background: #fff;
}

.pagination .page-numbers.current {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ===== レスポンシブ ===== */
@media (max-width: 900px) {
  .ranking-item-body {
    grid-template-columns: 140px 1fr;
  }
}

@media (max-width: 768px) {
  .site-wrap {
    grid-template-columns: 1fr;
    padding: 0 8px;
    margin: 12px auto;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .header-search input { width: 130px; }
  .ranking-post { padding: 12px; border-radius: 0; }
  .ranking-item {
    grid-template-columns: 56px 1fr;
  }
  .ranking-item-body {
    grid-template-columns: 1fr;
  }
  .ranking-item-thumb {
    aspect-ratio: 16/7;
  }
  .rank-badge {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
  .ranking-post-title { font-size: 18px; }
}

/* ===== 順位バッジ（一覧ページ） ===== */
.rank-num-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 4px;
  color: #fff;
  background: rgba(15,21,32,0.85);
}

.rank-badge-1 { background: linear-gradient(135deg, #d4a800, #f5c518); color: #1a1a00; }
.rank-badge-2 { background: linear-gradient(135deg, #888, #bbb); color: #111; }
.rank-badge-3 { background: linear-gradient(135deg, #a0522d, #cd7f32); color: #fff; }
.rank-badge-other { background: rgba(15,21,32,0.8); color: #fff; }

/* ===== カテゴリページ（ランキング一覧） ===== */
.ranking-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.rk-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.rk-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.rk-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #111;
}

.rk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
  display: block;
}

.rk-card:hover .rk-thumb img { transform: scale(1.04); }

.rk-no-img {
  width: 100%;
  height: 100%;
  background: #0f1520;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.rk-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 5px;
  background: rgba(15,21,32,0.85);
  color: #fff;
  min-width: 36px;
  text-align: center;
}

.rk-badge-top {
  font-size: 22px;
  padding: 2px 6px;
  background: transparent;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.rk-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rk-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rk-actress {
  font-size: 12px;
  color: var(--text-sub);
}

.rk-fanza-btn {
  display: block;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  transition: background 0.2s;
}

.rk-fanza-btn:hover { background: var(--red-dark); }

/* レスポンシブ */
@media (max-width: 768px) {
  .ranking-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .rk-title { font-size: 12px; }
  .rk-badge { font-size: 11px; }
}

@media (max-width: 400px) {
  .ranking-grid {
    grid-template-columns: 1fr;
  }
}
