/*
 * CinemaCheck Ranking – ranking.css
 * /wp-content/themes/cocoon-child/css/ranking.css に設置
 *
 * すべてのクラスに rk- プレフィックスを付けているので
 * Cocoon 本体のスタイルと競合しません。
 */

/* ==========================================
   ローディング / エラー
   ========================================== */
.rk-loading,
.rk-error,
.rk-empty {
  text-align: center;
  padding: 40px 16px;
  color: #888;
  font-size: 14px;
}
.rk-error { color: #c0392b; }

/* ==========================================
   フィルター
   ========================================== */
.rk-filters {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 14px 16px 10px;
  margin-bottom: 28px;
}

.rk-filter-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.rk-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 5px 0;
  white-space: nowrap;
  min-width: 36px;
}

.rk-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.rk-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  font-family: inherit;
  line-height: 1.5;
}
.rk-btn:hover {
  border-color: #f5c518;
  color: #333;
}
.rk-btn.is-active {
  background: #f5c518;
  border-color: #f5c518;
  color: #000;
  font-weight: 700;
}

.rk-filter-count-row {
  margin-bottom: 0;
  justify-content: flex-end;
}

.rk-count-label {
  font-size: 12px;
  color: #aaa;
}

/* ==========================================
   セクション
   ========================================== */
.rk-section {
  margin-bottom: 32px;
}

.rk-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rk-section-emoji {
  font-size: 20px;
  line-height: 1;
}

.rk-section-head > strong {
  font-size: 15px;
  font-weight: 800;
  color: #222;
}

.rk-section-sub {
  font-size: 12px;
  color: #999;
}

.rk-section-count {
  margin-left: auto;
  font-size: 11px;
  color: #bbb;
  background: #f0f0f0;
  padding: 2px 9px;
  border-radius: 10px;
}

/* ==========================================
   グリッド
   ========================================== */
.rk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

@media (max-width: 480px) {
  .rk-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================
   カード
   ========================================== */
.rk-card {
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 12px 12px 11px;
  text-decoration: none !important;
  color: inherit !important;
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.rk-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, .10);
  border-color: #f5c518;
  transform: translateY(-2px);
}

/* スコア帯ごとの左ボーダーアクセント */
[data-score="10"] .rk-card,
[data-score="9"]  .rk-card { border-left: 4px solid #f5c518; }
[data-score="8"]  .rk-card { border-left: 4px solid #4ecb71; }
[data-score="7"]  .rk-card { border-left: 4px solid #74b9ff; }
[data-score="6"]  .rk-card { border-left: 4px solid #a29bfe; }
[data-score="5"]  .rk-card { border-left: 4px solid #b2bec3; }
[data-score="4"]  .rk-card,
[data-score="3"]  .rk-card,
[data-score="2"]  .rk-card,
[data-score="1"]  .rk-card { border-left: 4px solid #dfe6e9; }

/* NEW バッジ */
.rk-new-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: .5px;
}

/* 種別バッジ */
.rk-card-top {
  margin-bottom: 7px;
}

.rk-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}
.rk-type--movie { background: #fff8dc; color: #9c7a00; }
.rk-type--drama { background: #eafaf1; color: #1e8449; }
.rk-type--anime { background: #fef0e6; color: #c0622a; }

/* タイトル */
.rk-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: #222;
  margin-bottom: 10px;
}

/* カード下部 */
.rk-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}

.rk-score-wrap {
  display: flex;
  align-items: baseline;
  gap: 1px;
  line-height: 1;
}

.rk-score {
  font-size: 24px;
  font-weight: 900;
  color: #f5c518;
}

/* スコアの色分け */
[data-score="10"] .rk-score,
[data-score="9"]  .rk-score { color: #f5c518; }
[data-score="8"]  .rk-score { color: #4ecb71; }
[data-score="7"]  .rk-score { color: #3498db; }
[data-score="6"]  .rk-score { color: #9b59b6; }
[data-score="5"]  .rk-score { color: #95a5a6; }
[data-score="4"]  .rk-score,
[data-score="3"]  .rk-score,
[data-score="2"]  .rk-score,
[data-score="1"]  .rk-score { color: #bdc3c7; }

.rk-score-denom {
  font-size: 11px;
  color: #bbb;
  font-weight: 400;
}

/* ジャンルタグ */
.rk-genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
}

.rk-genre-tag {
  font-size: 10px;
  color: #999;
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.rk-today-head {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
}
.rk-today-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 28px;
}

@media (max-width: 480px) {
  .rk-today-list {
    grid-template-columns: repeat(1, 1fr);
  }
}
.rk-today-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none !important;
  color: inherit !important;
  transition: box-shadow .15s, border-color .15s;
}
.rk-today-card:hover {
  border-color: #f5c518;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.rk-today-score {
  font-size: 22px;
  font-weight: 900;
  color: #f5c518;
  min-width: 48px;
  text-align: center;
  line-height: 1;
}
.rk-today-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rk-today-title {
  font-size: 13px;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
}
.rk-today-arrow {
  color: #aaa;
  font-size: 14px;
  flex-shrink: 0;
}