/* ==========================================================================
   ランキング表示 CSS  v1.10.0
   ========================================================================== */

.ranking-wrapper {
    width: 100%;
    overflow: hidden;
}

/* PC：3カラムグリッド */
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* カード共通 */
.ranking-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
    padding: 12px 14px;
}

.ranking-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

/* ランク別ボーダーカラー */
.ranking-card--rank1 { border-color: #f5a623; }
.ranking-card--rank2 { border-color: #b0b0b0; }
.ranking-card--rank3 { border-color: #c87f3a; }

/* ヘッダー（バッジ＋店舗名）：カードpadding分の横余白を削除 */
.ranking-card__header {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 0 0 10px;
}

/* バッジ右側のテキストまとめ（不要につき削除） */

/* 種別ラベル：カードpadding内に収まるため横paddingを調整 */
.ranking-card__type-label {
    display: block;
    width: 100px;
    padding: 4px 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
    text-align: center;
    border-radius: 4px;
}

.ranking-card__type-label--site   { background: #922326; }
.ranking-card__type-label--dealer { background: #233692; }

.ranking-card__badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* PNG バッジ画像 */
.ranking-card__badge-img {
    width: 48px;
    height: auto;
    display: block;
}

.ranking-card__name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 !important;
    color: #333;
}

/* ロゴ画像エリア：カードpadding分の横paddingを削除 */
.ranking-card__logo {
    width: 100%;
    height: 160px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-sizing: border-box;
}

.ranking-card__logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* 説明文：カードpadding分の横paddingを削除 */
.ranking-card__desc {
    flex: 1;
    font-size: 13px;
    line-height: 1.65;
    color: #2d2d2d;
    padding: 12px 0;
    margin: 0;
    margin-bottom: 0.5em !important;
}

/* 公式サイトボタン：カードpadding分の横marginを削除 */
.ranking-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 13px 16px;
    background: #ff9800;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.02em;
}

.ranking-card__btn:hover {
    background: #e68900;
    transform: translateY(-1px);
    color: #fff !important;
}

.ranking-card__btn-arrow {
    font-size: 18px;
    line-height: 1;
    margin-top: -1px;
}

/* ドットナビ（PCでは非表示） */
.ranking-dots {
    display: none;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.ranking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ranking-dot.is-active {
    background: #ff9800;
    transform: scale(1.25);
}

/* エラー表示 */
.ranking-error {
    color: #c00;
    font-size: 13px;
    padding: 8px;
    background: #fff0f0;
    border-left: 3px solid #c00;
}

/* ==========================================================================
   SP スライダー（max-width: 480px）
   ========================================================================== */
@media (max-width: 480px) {
    .ranking-wrapper {
        /* margin-left / margin-right 削除 */
        overflow: visible;
    }

    .ranking-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 16px 8px;
        gap: 12px;
    }

    .ranking-grid::-webkit-scrollbar {
        display: none;
    }

    /* 1枚＋次が少し見える：83%幅 */
    .ranking-card {
        flex: 0 0 83%;
        min-width: 0;
        scroll-snap-align: start;
    }

    .ranking-card__name {
        font-size: 16px;
    }

    .ranking-card__desc { font-size: 12px; }

    .ranking-dots { display: flex; }
}

/* ==========================================================================
   テーブル表示スタイル
   ========================================================================== */

.ranking-table-wrapper {
    width: 100%;
    margin: 16px 0;
}

/* SPで横スクロール */
.ranking-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    white-space: nowrap;   /* SP横スクロール時に崩れ防止 */
    min-width: 480px;
}

/* ヘッダー行 */
.ranking-table__th {
    background: #B36568 !important;
    padding: 10px 12px;
    text-align: center;
    font-weight: 700;
    color: #fff !important;
    border: 1px solid #ddd;
    white-space: normal;
    min-width: 72px;
}

.ranking-table__th--name {
    min-width: 120px;
}

/* データ行 */
.ranking-table__tr:nth-of-type(2n+1) {
background-color: #F5E9EA !important;
}

.ranking-table__tr:nth-child(even) {
    background: #fff8f8;
}

.ranking-table__td {
    padding: 12px;
    border: 1px solid #fff !important;
    text-align: center;
    vertical-align: middle;
    color: #333;
    white-space: normal;
    line-height: 1.5;
}

.ranking-table__td--name {
    vertical-align: middle;
    min-width: 120px;
}

/* ロゴ画像（セル上部） */
.ranking-table__logo {
    display: block;
    max-width: 120px;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto 6px !important;
}

/* サイト名リンク（ロゴ下） */
.ranking-table__link {
    display: block;
    text-align: center;
    font-size: 14px;
    color: #1a6eb5;
    text-decoration: underline;
    word-break: break-all;
}

.ranking-table__link:hover {
    color: #0d4a80;
}

@media (max-width: 480px) {
.ranking-table,
.ranking-table__th,
.ranking-table__td {
    font-size: 14px !important;
}
}
