/* ============================================================
   ranking/ 用スタイル
   ・カテゴリページ (/css/list.css) と同じ Magazine デザイン言語
   ・2 カラム（左サイドバー = ランキング種別、右メイン = カード一覧）
   ・モバイルではサイドバーをハンバーガードロワー化
   ・カード共通：左に順位、右端に指標バッジ
   ・レビューランキング → 中央にレビューカード
   ・ユーザーランキング → 中央にユーザーカード
   ============================================================ */
.rk-wrap {}

/* ===========================
   ブロック見出し（TAG + タイトル + 横線）
   list.css の .list-block-head と同じ
   =========================== */
.rk-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.rk-block-head.rk-block-head-next {
  margin-top: 26px;
}
.rk-block-tag {
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 3px 8px;
  background: transparent;
  flex-shrink: 0;
}
.rk-block-title {
  font-size: var(--fs-base);
  font-weight: 900;
  letter-spacing: .04em;
  margin: 0;
  color: var(--text);
}
.rk-block-line {
  flex: 1;
  height: 1.5px;
  background: var(--text);
  opacity: .85;
}

/* ===========================
   ページヘッダー（ダーク帯）— list.css の .list-page-head と同型
   =========================== */
.rk-page-head {
  background: #191c22;
  border-bottom: 1.5px solid #252930;
  padding: 22px 0;
  position: relative;
}
.rk-page-head-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.rk-page-head h1 {
  font-size: var(--fs-xl);
  font-weight: 900;
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e4e6ed;
  margin: 0;
  flex-wrap: wrap;
}
@media (min-width: 901px) {
  .rk-page-head h1 { font-size: var(--fs-2xl); }
}

/* H1 内のサブテキスト */
.rk-head-sub {
  font-size: var(--fs-base);
  font-weight: 700;
  color: #b6bac4;
  letter-spacing: .04em;
}

/* ===========================
   モバイル用ハンバーガー（list.css の .list-hamburger と同型 = 左下固定）
   =========================== */
.rk-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 52px;
  height: 52px;
  padding: 10px;
  background: var(--accent);
  border: 1.5px solid var(--text);
  border-radius: 0;
  cursor: pointer;
  position: fixed;
  bottom: 20px;
  left: 16px;
  z-index: 210;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  transition: left .28s ease;
}
.rk-hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 0;
  transition: transform .25s ease, opacity .2s ease;
}
.rk-hamburger.active { left: calc(280px + 16px); }
.rk-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.rk-hamburger.active span:nth-child(2) { opacity: 0; }
.rk-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.rk-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 199;
}
.rk-overlay.show { display: block; }

/* ===========================
   2 カラム本体（list.css に合わせて main を左、sidebar を右に配置）
   =========================== */
.rk-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 28px 60px;
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-areas: "main sidebar";
  gap: 28px;
  align-items: start;
}
.rk-sidebar { grid-area: sidebar; }
.rk-main    { grid-area: main; min-width: 0; }

@media (max-width: 900px) {
  .rk-body {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
    padding: 22px 14px 80px; /* 下にハンバーガー余白 */
  }
  .rk-hamburger { display: flex; }
  /* サイドバーをドロワー化（list.css の挙動を踏襲） */
  .rk-sidebar {
    grid-area: auto;
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100dvh;
    overflow-y: auto;
    z-index: 200;
    background: var(--bg2);
    border-right: 1.5px solid var(--text);
    transition: left .28s ease;
    padding: 14px 14px 80px;
    box-sizing: border-box;
  }
  .rk-sidebar.open { left: 0; }
}

/* ===========================
   左：サイドバー内のリンク
   =========================== */
.rk-sidebar-inner {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
@media (max-width: 900px) {
  .rk-sidebar-inner {
    position: static;
    top: auto;
  }
}

.rk-side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1.5px solid var(--text);
  border-top: none;
  text-decoration: none;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .02em;
  transition: .15s;
}
/* 直前のブロック見出しの直後だけ上線を引く */
.rk-block-head + .rk-side-link {
  border-top: 1.5px solid var(--text);
}
.rk-side-link:hover {
  background: var(--bg);
  color: var(--accent);
  border-color: var(--accent);
}
.rk-side-link.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===========================
   セクション切替タブ（大カテゴリ：レビュー / ユーザー）
   メイン領域の最上部に置く 2 タブ。
   サイドバーが小カテゴリ（期間／メトリック）の細かい切替で、
   こちらは大カテゴリの動線。
   =========================== */
.rk-section-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 4px;
}
.rk-section-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg2);
  border: 1.5px solid var(--text);
  border-radius: 0;
  text-decoration: none;
  color: var(--text);
  letter-spacing: .04em;
  transition: .15s;
  position: relative;
}
/* 2 枚目を 1 枚目の右にぴったり重ねる（線が二重にならないように） */
.rk-section-tab + .rk-section-tab {
  border-left: none;
}
.rk-section-tab:hover {
  background: var(--bg);
  color: var(--accent);
  border-color: var(--accent);
  z-index: 1;
}
.rk-section-tab.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  z-index: 2;
}

/* 内側ラベル */
.rk-section-tab-tag {
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: .14em;
  border: 1.5px solid currentColor;
  padding: 2px 7px;
  line-height: 1;
  flex-shrink: 0;
}
.rk-section-tab-label {
  font-size: var(--fs-base);
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* モバイル：英語の小タグは非表示にしてラベルだけを残す */
@media (max-width: 480px) {
  .rk-section-tab {
    padding: 10px 8px;
    gap: 6px;
  }
  .rk-section-tab-tag {
    display: none;
  }
  .rk-section-tab-label {
    font-size: var(--fs-sm);
  }
}

/* ===========================
   小カテゴリ切替チップ（期間 / メトリック）
   list.css の .list-sort-chip と同型
   =========================== */
.rk-sub-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 4px;
}
.rk-sub-tab {
  padding: 6px 16px;
  border-radius: 0;
  font-size: var(--fs-sm);
  font-weight: 900;
  border: 1.5px solid var(--text);
  background: var(--bg2);
  color: var(--text);
  text-decoration: none;
  transition: .15s;
  white-space: nowrap;
  letter-spacing: .02em;
}
.rk-sub-tab:hover {
  background: var(--bg);
  color: var(--accent);
  border-color: var(--accent);
}
.rk-sub-tab.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===========================
   カード一覧（共通）
   =========================== */
.rk-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rk-card {
  display: flex;
  align-items: stretch;
  background: var(--bg2);
  border: 1.5px solid var(--text);
  border-radius: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: none;
  transition: .15s;
  min-height: 140px;
}
.rk-card:hover {
  border-color: var(--accent);
  background: var(--bg);
}
.rk-card:hover .rk-title,
.rk-card:hover .rk-user-name { color: var(--accent); }
.rk-card:hover .rk-thumb img { transform: scale(1.04); }

/* ─ 順位（左端） ───────────────────────────── */
.rk-rank {
  flex-shrink: 0;
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-right: 1.5px solid var(--text);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
}
.rk-rank-num {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
/* TOP 3 配色 */
.rk-rank-1 { background: var(--accent);             color: #fff; }
.rk-rank-2 { background: #c0c4cd;                   color: #1a1c20; }
.rk-rank-3 { background: #b58a4a;                   color: #fff; }
.rk-rank-1 .rk-rank-num,
.rk-rank-2 .rk-rank-num,
.rk-rank-3 .rk-rank-num { color: inherit; }

/* ─ サムネイル（レビューカード） ─────────────────── */
.rk-thumb {
  position: relative;
  width: 220px;
  aspect-ratio: 1.618 / 1;
  flex-shrink: 0;
  background: var(--bg);
  overflow: hidden;
  align-self: center;
  border-right: 1.5px solid var(--text);
}
.rk-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.rk-nophoto {
  width: 100%;
  height: 100%;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: var(--text2);
  opacity: .4;
}
/* 星バッジ（サムネ右下） */
.rk-score {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(14, 16, 20, 0.78);
  color: var(--star);
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 0;
  pointer-events: none;
  letter-spacing: 1px;
}

/* ─ 本文 ─────────────────────────────────── */
.rk-body-col {
  flex: 1;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  align-self: stretch;
}

.rk-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 26px;
}
.rk-cat {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 900;
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 0;
  padding: 2px 8px;
  color: var(--accent);
  white-space: nowrap;
  line-height: 1.3;
  letter-spacing: .08em;
}
.rk-time {
  font-size: var(--fs-xs);
  color: var(--text2);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  opacity: .85;
}
.rk-product-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--bg);
  border: 1.5px solid var(--text);
  border-radius: 0;
  padding: 2px 8px;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.3;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-title {
  font-size: var(--fs-md);
  font-weight: 900;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -.01em;
  transition: color .15s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rk-snippet {
  font-size: var(--fs-sm);
  color: var(--text2);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rk-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1.5px solid rgba(0, 0, 0, .08);
  padding-top: 8px;
  font-size: var(--fs-xs);
  color: var(--text2);
}
.rk-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.rk-author span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rk-ava {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--text);
  flex-shrink: 0;
}
.rk-ava-def {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text2);
  font-size: 14px;
}
.rk-likes {
  color: var(--accent);
  font-weight: 900;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

/* ─ 指標バッジ（右端） ─────────────────────────── */
.rk-metric {
  flex-shrink: 0;
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-left: 1.5px solid var(--text);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  padding: 12px 8px;
  gap: 2px;
}
.rk-metric-num {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rk-metric-lbl {
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--text2);
  white-space: nowrap;
}

/* ===========================
   ユーザーランキング用カード
   .rk-card + .rk-card-user で適用
   =========================== */
.rk-user-ava-wrap {
  flex-shrink: 0;
  width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-right: 1.5px solid var(--text);
  padding: 16px;
  align-self: stretch;
}
.rk-user-ava {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--text);
  display: block;
  background: var(--bg2);
}
.rk-user-ava-def {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--text2);
}

.rk-user-name {
  font-size: var(--fs-lg);
  font-weight: 900;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -.01em;
  transition: color .15s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rk-user-stats {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1.5px solid rgba(0, 0, 0, .08);
  padding-top: 8px;
  font-size: var(--fs-sm);
  color: var(--text2);
}
.rk-user-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.rk-user-stat-lbl {
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--text2);
}
.rk-user-stat-num {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 900;
}
.rk-user-stat-sep {
  margin: 0 2px;
  color: var(--text3, var(--text2));
  opacity: .6;
  font-weight: 400;
}

/* ===========================
   空状態
   =========================== */
.rk-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
  background: var(--bg2);
  border: 1.5px dashed var(--text);
}
.rk-empty p {
  margin: 0;
  font-size: var(--fs-base);
}

/* ===========================
   モバイル：カード折り返し
   =========================== */
@media (max-width: 720px) {
  .rk-card {
    flex-wrap: wrap;
    min-height: 0;
  }
  .rk-rank { width: 48px; }
  .rk-rank-num { font-size: 1.5rem; }
  .rk-thumb { width: 140px; }
  .rk-body-col {
    padding: 10px 12px;
    flex: 1 1 calc(100% - 48px - 140px);
    min-width: 0;
  }
  .rk-metric {
    flex: 0 0 100%;
    width: 100%;
    flex-direction: row;
    gap: 8px;
    padding: 8px 14px;
    border-left: none;
    border-top: 1.5px solid var(--text);
  }
  .rk-metric-num { font-size: 1.25rem; }
  .rk-title { font-size: var(--fs-base); }

  /* ユーザーカード：アバター枠を縮小 */
  .rk-user-ava-wrap { width: 90px; padding: 10px; }
  .rk-user-ava      { width: 60px; height: 60px; }
  .rk-card-user .rk-body-col {
    flex: 1 1 calc(100% - 48px - 90px);
  }
  .rk-user-name { font-size: var(--fs-base); }
  .rk-user-stats { gap: 10px; font-size: var(--fs-xs); }
}

@media (max-width: 480px) {
  .rk-thumb { width: 110px; }
  .rk-body-col {
    flex: 1 1 calc(100% - 48px - 110px);
  }
}
