/* 作業単位11：TOPランキングショートコード用スタイル
   SWELL等テーマの影響を受けにくいよう、スコープを .kyu-vendor-ranking で限定しています。
*/

.kyu-vendor-ranking {
  margin: 2em 0;
}

.kyu-vendor-ranking__header {
  margin-bottom: 1em;
}

.kyu-vendor-ranking__title {
  margin: 0 0 0.3em;
  font-size: 1.5em;
}

.kyu-vendor-ranking__meta {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.kyu-vendor-card {
  position: relative;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 16px;
  margin: 0 0 18px;
  background: #fff;
}

.kyu-vendor-card__pr {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f5f7;
  color: #666;
}

.kyu-vendor-card__top {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.kyu-vendor-card__rank {
  /* 参考サイト寄せ：順位＋画像を左カラムにまとめる */
  min-width: 220px;
  text-align: center;
  border-right: 1px solid #eee;
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.kyu-vendor-card__rank-badge {
  width: 100%;
}

.kyu-vendor-card__rank-current {
  font-size: 1.4em;
  font-weight: 700;
}

.kyu-vendor-card__rank-prev {
  margin-top: 6px;
  font-size: 0.9em;
  color: #666;
}

.kyu-vendor-card__head {
  flex: 1;
  min-width: 0;
}

/*
  参考サイト寄せ：サムネは「固定比率の枠」に収めてトリミング。
  SWELL側の img {height:auto} 等に負けないよう、
  コンテナ（.kyu-vendor-card__thumb）にサイズを持たせて img を 100% でフィット。
*/
.kyu-vendor-card__thumb {
  width: 200px;
  height: 112px; /* 16:9 */
  flex: 0 0 200px;
}

.kyu-vendor-card .kyu-vendor-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  border: 1px solid #eee;
  display: block;
  max-width: none;
}

/* 作業単位27：未設定プレースホルダ（フロント） */
.kyu-vendor-card .kyu-media-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1px solid #eee;
  background: #f3f5f7;
  position: relative;
}

.kyu-vendor-card .kyu-media-placeholder::after {
  content: "画像未設定";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 12px;
}

.kyu-vendor-card .kyu-media-placeholder--logo::after {
  content: "LOGO";
}

.kyu-vendor-card__desc {
  margin-top: 10px;
  line-height: 1.6;
  color: #333;
}

.kyu-vendor-card__title-wrap {
  min-width: 0;
}

.kyu-vendor-card__title {
  margin: 0 0 8px;
  font-size: 1.15em;
  line-height: 1.35;
}

/* 作業単位27：ロゴ（正方形） */
.kyu-vendor-card__titleline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
}

.kyu-vendor-card__titleline .kyu-vendor-card__title {
  margin: 0;
}

.kyu-vendor-card__logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #eee;
  background: #f3f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kyu-vendor-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ロゴ枠内のプレースホルダは二重枠にならないように調整 */
.kyu-vendor-card__logo .kyu-media-placeholder {
  border: 0;
  border-radius: 0;
}

.kyu-vendor-card__title a {
  text-decoration: none;
}

.kyu-vendor-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
  font-size: 0.95em;
}

/* TOP10：評価表示を業者詳細準拠へ（スター + 総合評価/口コミ件数） */
.kyu-vendor-card__stats--rating-v2 {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.kyu-vendor-card__stats--rating-v2 .kyu-vendor-card__stars {
  margin-bottom: 2px;
}

.kyu-vendor-card__stats--rating-v2 .kyu-stars {
  position: relative;
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
}

.kyu-vendor-card__stats--rating-v2 .kyu-stars__base {
  color: #ccc;
}

.kyu-vendor-card__stats--rating-v2 .kyu-stars__fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: #f5b50a;
  white-space: nowrap;
}

.kyu-stat strong {
  font-weight: 700;
  margin-right: 4px;
}

.kyu-label {
  display: inline-block;
  font-size: 0.85em;
  color: #666;
  margin-right: 6px;
}

.kyu-vendor-card__highlights,
.kyu-vendor-card__tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.kyu-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3f5f7;
  font-size: 0.9em;
}

.kyu-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef6ff;
  font-size: 0.9em;
  text-decoration: none;
}

.kyu-vendor-card__cta {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.kyu-btn {
  display: inline-block;
  text-align: center;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid #ddd;
  font-weight: 700;
  font-size: 0.95em;
}

.kyu-btn--primary {
  background: #1e73be;
  color: #fff;
  border-color: #1e73be;
}

.kyu-btn--secondary {
  background: #fff;
  color: #1e73be;
  border-color: #1e73be;
}

.kyu-vendor-card__reviews {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eee;
}

.kyu-vendor-card__reviews-head {
  font-weight: 700;
  margin-bottom: 10px;
}

.kyu-review-mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.kyu-review-mini {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafafa;
}

.kyu-review-mini__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.9em;
  color: #555;
  margin-bottom: 6px;
}

.kyu-review-mini__name {
  font-weight: 700;
  color: #222;
}

.kyu-review-mini__score {
  font-weight: 700;
  color: #222;
}

.kyu-review-mini__title {
  font-weight: 700;
  margin: 0 0 6px;
}

.kyu-review-mini__title a {
  text-decoration: none;
}

.kyu-review-mini__excerpt {
  color: #333;
  font-size: 0.95em;
  line-height: 1.5;
}

.kyu-review-mini__more {
  margin-top: 6px;
  text-align: right;
  font-size: 0.9em;
}

.kyu-review-mini__more a {
  text-decoration: none;
}

/* Responsive */
@media (max-width: 900px) {
  .kyu-vendor-card__top {
    flex-direction: column;
  }
  .kyu-vendor-card__thumb {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 220px;
  }
  .kyu-vendor-card .kyu-vendor-card__thumb img {
    width: 100%;
    height: 100%;
  }
  .kyu-vendor-card__rank {
    border-right: none;
    padding-right: 0;
    min-width: auto;
    text-align: left;
    align-items: flex-start;
    gap: 8px;
  }

  .kyu-vendor-card__rank-badge {
    display: flex;
    gap: 10px;
    align-items: baseline;
  }
  .kyu-vendor-card__cta {
    min-width: auto;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .kyu-btn {
    flex: 1;
    min-width: 140px;
  }
}
