/* ============================================================
   AdaFi Theme - Main CSS
   ダークモード紫基調デザイン
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* --- デザイントークン --- */
:root {
  --bg-primary:      #0d0d0f;
  --bg-secondary:    #131317;
  --bg-card:         #1a1a22;
  --bg-card-hover:   #20202c;
  --bg-input:        #1e1e28;
  --purple-deep:     #4c1d95;
  --purple-main:     #7c3aed;
  --purple-light:    #a855f7;
  --purple-glow:     rgba(124, 58, 237, 0.25);
  --purple-border:   rgba(168, 85, 247, 0.3);
  --text-primary:    #f1f0f5;
  --text-secondary:  #c4b5e8;
  --text-muted:      #6b7280;
  --accent:          #c084fc;
  --accent-pink:     #e879f9;
  --success:         #10b981;
  --danger:          #ef4444;
  --border:          rgba(255, 255, 255, 0.07);
  --border-purple:   rgba(124, 58, 237, 0.4);
  --radius-sm:       6px;
  --radius-md:       12px;
  --radius-lg:       18px;
  --shadow-card:     0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow:     0 0 20px rgba(124, 58, 237, 0.35);
  --transition:      0.2s ease;
  --font-sans:       'Inter', 'Noto Sans JP', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--purple-light);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

/* --- レイアウト --- */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.content-area {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding: 32px 0;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}

@media (max-width: 1024px) {
  .content-area { grid-template-columns: 1fr; }
}

/* ============================================================
   ヘッダー
   ============================================================ */
.site-header {
  background: linear-gradient(180deg, #0a0a10 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border-purple);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-light), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.site-logo:hover { opacity: 0.85; }

/* ナビゲーション */
.site-nav ul {
  display: flex;
  gap: 8px;
  align-items: center;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.site-nav a:hover,
.site-nav .current-menu-item a {
  color: var(--text-primary);
  background: var(--purple-glow);
}

/* ハンバーガー（モバイル） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-purple);
    padding: 16px 20px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 4px; }
  .site-nav a { display: block; padding: 10px 14px; }
}

/* ============================================================
   広告バナー帯
   ============================================================ */
.ad-banner-wrap {
  text-align: center;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.ad-banner-wrap.ad-header  { border-bottom: 1px solid var(--border-purple); }
.ad-banner-wrap.ad-footer  { border-top: 1px solid var(--border); border-bottom: none; }

.ad-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* ============================================================
   記事カード
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--purple-border);
}

.article-card__thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  background: var(--bg-secondary);
}

.article-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .article-card__thumb img {
  transform: scale(1.05);
}

/* カテゴリバッジ */
.article-card__cat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--purple-main);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  z-index: 1;
}

/* ランキングバッジ */
.rank-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  z-index: 1;
}
.rank-badge.rank-1 { background: #FFD700; color: #000; }
.rank-badge.rank-2 { background: #C0C0C0; color: #000; }
.rank-badge.rank-3 { background: #CD7F32; color: #fff; }
.rank-badge.rank-n { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }

.article-card__body {
  padding: 14px 16px;
}

.article-card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.article-card__title a { color: inherit; }
.article-card__title a:hover { color: var(--accent); }

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.article-card__meta .pv-count::before { content: '👁 '; }
.article-card__meta .date::before    { content: '📅 '; }

/* インライン広告（グリッド内挿入） */
.ad-inline-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}

/* ページネーション */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  transition: all var(--transition);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--purple-main);
  border-color: var(--purple-main);
  color: #fff;
}

/* ============================================================
   個別記事（single.php）
   ============================================================ */
.single-article {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.single-article__hero {
  aspect-ratio: 16/9;
  overflow: hidden;
  max-height: 480px;
}

.single-article__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-article__header {
  padding: 28px 32px 0;
}

.single-article__cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cat-badge {
  background: var(--purple-deep);
  border: 1px solid var(--purple-border);
  color: var(--purple-light);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.single-article__title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.single-article__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.single-article__content {
  padding: 28px 32px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-secondary);
}

.single-article__content h2,
.single-article__content h3 {
  color: var(--text-primary);
  margin: 24px 0 12px;
}

.single-article__content p { margin-bottom: 16px; }

.single-article__content a {
  color: var(--purple-light);
  border-bottom: 1px solid var(--purple-border);
}

.single-article__footer {
  padding: 20px 32px 28px;
  border-top: 1px solid var(--border);
}

.tags-wrap { display: flex; gap: 8px; flex-wrap: wrap; }

.tag-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  transition: all var(--transition);
}
.tag-badge:hover {
  border-color: var(--purple-border);
  color: var(--purple-light);
}

/* X投稿ボタン */
.x-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--transition);
  margin-top: 16px;
}
.x-share-btn:hover { opacity: 0.8; color: #fff; }

/* ============================================================
   サイドバー
   ============================================================ */
.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple-light);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--purple-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ランキングウィジェット */
.ranking-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ranking-list li:last-child { border-bottom: none; }

.ranking-list .rank-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.ranking-list .rank-num.n1 { background: #FFD700; color: #000; }
.ranking-list .rank-num.n2 { background: #C0C0C0; color: #000; }
.ranking-list .rank-num.n3 { background: #CD7F32; color: #fff; }
.ranking-list .rank-num.other {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 12px;
  border: 1px solid var(--border);
}

.ranking-list .rank-thumb {
  width: 64px;
  height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-secondary);
}
.ranking-list .rank-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-list .rank-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ranking-list .rank-title a { color: inherit; }
.ranking-list .rank-title a:hover { color: var(--accent); }

.ranking-list .rank-pv {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ランキング期間タブ */
.period-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.period-tab {
  flex: 1;
  text-align: center;
  padding: 5px 0;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.period-tab.active,
.period-tab:hover {
  background: var(--purple-main);
  border-color: var(--purple-main);
  color: #fff;
}

/* ============================================================
   ランキングページ（page-ranking.php）
   ============================================================ */
.ranking-page-header {
  text-align: center;
  padding: 48px 20px 32px;
}

.ranking-page-title {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-light), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.ranking-page-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}
.ranking-page-tab {
  padding: 9px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.ranking-page-tab.active,
.ranking-page-tab:hover {
  background: var(--purple-main);
  border-color: var(--purple-main);
  color: #fff;
}

/* ============================================================
   フッター
   ============================================================ */
.site-footer {
  background: #080810;
  border-top: 1px solid var(--border-purple);
  padding: 40px 0 24px;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 32px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

.footer-logo {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-light), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.footer-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--purple-light); }

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-warning {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.6;
}

/* ============================================================
   ユーティリティ
   ============================================================ */
.text-gradient {
  background: linear-gradient(135deg, var(--purple-light), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--purple-main);
  color: #fff;
}
.btn-primary:hover {
  background: var(--purple-light);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  color: var(--purple-light);
  border: 1px solid var(--purple-border);
}
.btn-outline:hover {
  background: var(--purple-glow);
  border-color: var(--purple-light);
  color: var(--purple-light);
}

/* ページタイトル */
.page-title-bar {
  padding: 28px 0 0;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.page-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* スクロールバー */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--purple-main); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }

/* アニメーション */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease both;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px var(--purple-glow); }
  50%       { box-shadow: 0 0 20px var(--purple-glow); }
}

/* 成人向けコンテンツ警告バナー */
.age-warning {
  background: linear-gradient(135deg, var(--purple-deep), #1e0a3c);
  border: 1px solid var(--purple-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.age-warning strong { color: var(--accent); }
