/* =============================================================
   レビューセクション(loofen.jp / Letro widget 型 自前実装)
   --
   スクショから抽出した design tokens:
   - brand-gold:    #C9A363(ゴールド/ベージュ系の評価色、ドーナツ・バー・active 星)
   - card-bg:       #FAF5EC(レビューカード背景の淡ベージュ)
   - card-border:   #EFE2C9
   - text-default:  #333
   - text-muted:    #888
   - link-blue:     #1E88E5(絞り込みのリンク色)
   - star-inactive: #D9D9D9
   - body-bg:       #FFFFFF
   - 区切り線:        #ECECEC
   ============================================================== */

:root {
  --rh-brand:        #C9A363;
  --rh-brand-dim:    #E7D6B0;
  --rh-card-bg:      #FAF5EC;
  --rh-card-border:  #EFE2C9;
  --rh-text:         #333;
  --rh-text-muted:   #888;
  --rh-link:         #1E88E5;
  --rh-star-off:     #D9D9D9;
  --rh-divider:      #ECECEC;
  --rh-bg:           #FFFFFF;

  --rh-radius:       8px;
  --rh-radius-card:  10px;

  --rh-font:         -apple-system, BlinkMacSystemFont, "Hiragino Sans",
                     "ヒラギノ角ゴ ProN", "Noto Sans JP", "Yu Gothic UI",
                     "Meiryo", sans-serif;
}

/* セクション全体 */
.rh-reviews {
  background: var(--rh-bg);
  color: var(--rh-text);
  font-family: var(--rh-font);
  font-size: 14px;
  line-height: 1.6;
  padding: 32px 20px 24px;
  max-width: 480px;       /* スマホ・タブレット幅(本物 LP に統合時は親が制御) */
  margin: 0 auto;
  box-sizing: border-box;
}

/* ===== 1. サマリー ドーナツゲージ ===== */
.rh-summary {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.rh-donut {
  position: relative;
  width: 160px;
  height: 160px;
}
.rh-donut__bg {
  fill: none;
  stroke: #F0EAE0;
  stroke-width: 10;
}
.rh-donut__fg {
  fill: none;
  stroke: var(--rh-brand);
  stroke-width: 10;
  stroke-linecap: butt;
  stroke-dasharray: 314.159;  /* 2 * π * r (r=50) ≈ 314.16 */
  stroke-dashoffset: 314.159; /* JS で動的に減らす */
  transition: stroke-dashoffset 0.8s ease-out;
}
.rh-donut__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.rh-donut__caption {
  font-size: 12px;
  color: var(--rh-text);
  margin: 0;
}
.rh-donut__sub {
  font-size: 10px;
  color: var(--rh-text-muted);
  margin: 2px 0 4px;
}
.rh-donut__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--rh-text);
  margin: 0;
  line-height: 1;
}

/* ===== 2. 件数見出し ===== */
.rh-count {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--rh-text);
}

/* ===== 3. 星別分布 ===== */
.rh-distribution {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.rh-distribution li {
  display: grid;
  grid-template-columns: 40px 80px 1fr 40px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}
.rh-distribution__label {
  color: var(--rh-text);
}
.rh-distribution__bar {
  background: #F2F2F2;
  height: 8px;
  border-radius: 2px;
  overflow: hidden;
}
.rh-distribution__bar > span {
  display: block;
  height: 100%;
  background: var(--rh-brand);
  border-radius: 2px;
  transition: width 0.6s ease-out;
}
.rh-distribution__count {
  text-align: right;
  font-weight: 600;
  color: var(--rh-text);
}

/* ===== 共通: 星マーク(unicode + active 比率で width 制御) ===== */
.rh-stars {
  --rh-stars-fill: 100%;   /* JS or inline で上書き */
  display: inline-block;
  position: relative;
  font-size: 14px;
  letter-spacing: 1px;
  line-height: 1;
  color: var(--rh-star-off);  /* 背景 */
}
.rh-stars::before {
  content: "★★★★★";
}
.rh-stars__filled {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--rh-brand);
  width: var(--rh-stars-fill);
}
.rh-stars__filled::before {
  content: "★★★★★";
  letter-spacing: 1px;
}

/* ===== 4. 絞り込みボタン ===== */
.rh-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--rh-link);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 0;
  cursor: pointer;
  margin-bottom: 8px;
}
.rh-filter__icon {
  width: 16px;
  height: 16px;
  color: var(--rh-link);
}
.rh-filter:hover {
  text-decoration: underline;
}

/* ===== 5. レビューカード ===== */
.rh-cards {
  border-top: 1px solid var(--rh-divider);
  padding-top: 16px;
}
.rh-card {
  background: var(--rh-card-bg);
  border: 1px solid var(--rh-card-border);
  border-radius: var(--rh-radius-card);
  padding: 16px;
  margin-bottom: 16px;
}

.rh-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rh-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #BBB;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rh-avatar svg {
  width: 18px;
  height: 18px;
}
.rh-card__name {
  font-weight: 700;
  font-size: 15px;
}
.rh-card__attr {
  font-size: 12px;
  color: var(--rh-text-muted);
}

.rh-card__title {
  font-size: 15px;
  font-weight: 700;
  margin: 8px 0 6px;
}
.rh-card__body {
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 12px;
  white-space: pre-line;     /* 改行を尊重 */
}

/* 評価項目テーブル */
.rh-card__ratings {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 4px 12px;
  font-size: 12.5px;
  margin: 0 0 10px;
}
.rh-card__ratings dt {
  color: var(--rh-text-muted);
  font-weight: 400;
}
.rh-card__ratings dd {
  margin: 0;
  color: var(--rh-text);
}

.rh-card__date {
  display: block;
  font-size: 11px;
  color: var(--rh-text-muted);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* ===== 6. ページネーション ===== */
.rh-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--rh-divider);
  margin-top: 16px;
}
.rh-pagination button {
  background: transparent;
  border: none;
  color: var(--rh-link);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
}
.rh-pagination button:disabled {
  color: var(--rh-text-muted);
  cursor: not-allowed;
}
.rh-pagination button:hover:not(:disabled) {
  text-decoration: underline;
}

/* ===== 7. PR / 注釈 ===== */
.rh-pr {
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--rh-text);
  margin: 12px 0 4px;
}
.rh-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--rh-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ===== レスポンシブ(481px+ で 2 列カード等の余地、現状はモバイル一辺倒)===== */
@media (min-width: 768px) {
  .rh-reviews {
    max-width: 720px;
    padding: 48px 32px;
  }
  .rh-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .rh-card {
    margin-bottom: 0;
  }
}
