/* ========================================
   基本
======================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans JP",
        sans-serif;
    color: #222;
    background: #f5f6f8;
    line-height: 1.7;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}


/* ========================================
   ヘッダー
======================================== */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 18px 20px;
}

.site-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.site-title a {
    text-decoration: none;
}


/* ========================================
   メイン
======================================== */

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 35px 20px 60px;
}


/* ========================================
   ランキングヘッダー
======================================== */

.ranking-header {
    margin-bottom: 25px;
}

.ranking-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.4;
}

.ranking-description {
    margin: 0 0 5px;
    color: #666;
}

.updated-at {
    margin: 0;
    color: #888;
    font-size: 14px;
}


/* ========================================
   ランキング一覧
======================================== */

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


/* ========================================
   商品カード
======================================== */

.ranking-card {
    position: relative;
    display: grid;
    grid-template-columns: 80px 150px 1fr;
    gap: 22px;
    align-items: center;

    background: #ffffff;
    border: 1px solid #e4e6e8;
    border-radius: 10px;

    padding: 22px;
}


/* ========================================
   順位
======================================== */

.rank {
    text-align: center;
}

.rank-number {
    font-size: 18px;
    font-weight: 700;
    color: #555;
}

.rank-number strong {
    display: block;
    font-size: 32px;
    line-height: 1.1;
}


/* 1〜3位 */

.rank-1 {
    border-left: 6px solid #d4a017;
}

.rank-2 {
    border-left: 6px solid #a8adb3;
}

.rank-3 {
    border-left: 6px solid #a66a3f;
}

.rank-1 .rank-number {
    color: #b48700;
}

.rank-2 .rank-number {
    color: #777d84;
}

.rank-3 .rank-number {
    color: #966039;
}


/* ========================================
   商品画像
======================================== */

.product-image {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 140px;
}

.product-image img {
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
}


/* ========================================
   商品情報
======================================== */

.product-info {
    min-width: 0;
}

.product-title {
    margin: 0 0 12px;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 600;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ========================================
   レビュー数
======================================== */

.review-area {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px 16px;

    margin: 10px 0 8px;
}

.review-main {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.review-label {
    margin-right: 4px;

    color: #777;
    font-size: 13px;
    font-weight: 600;
}

.review-number {
    font-size: 29px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.review-unit {
    font-size: 14px;
    font-weight: 700;
}

.rating {
    margin-bottom: 2px;

    color: #666;
    font-size: 14px;
}

/* ========================================
   価格
======================================== */

.price {
    margin: 8px 0 12px;

    font-size: 18px;
    font-weight: 700;
}

/* ========================================
   Amazonボタン
======================================== */

.amazon-button {
    display: inline-block;

    padding: 9px 18px;

    background: #ff9900;
    color: #111;

    border-radius: 6px;

    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.amazon-button:hover {
    opacity: 0.85;
}


/* ========================================
   トップページ
======================================== */

.page-title {
    margin-top: 0;
    margin-bottom: 8px;
}

.page-description {
    color: #666;
    margin-bottom: 30px;
}

.category-group {
    margin-bottom: 30px;
}

.category-group h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.category-list {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(220px, 1fr));

    gap: 12px;

    padding: 0;
    margin: 0;

    list-style: none;
}

.category-list a {
    display: block;

    background: #ffffff;
    border: 1px solid #e3e5e8;
    border-radius: 8px;

    padding: 16px 18px;

    text-decoration: none;
    font-weight: 600;
}

.category-list a:hover {
    background: #fafafa;
    border-color: #bbb;
}


/* ========================================
   フッター
======================================== */

.site-footer {
    border-top: 1px solid #e0e0e0;
    background: #ffffff;

    color: #777;
    font-size: 13px;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 25px 20px;
}


/* ========================================
   スマートフォン
======================================== */

@media (max-width: 700px) {

    .container {
        padding: 25px 14px 45px;
    }

    .ranking-header h1 {
        font-size: 23px;
    }

    .ranking-card {
        grid-template-columns: 55px 100px 1fr;
        gap: 12px;

        padding: 16px 12px;
    }

    .rank-number {
        font-size: 14px;
    }

    .rank-number strong {
        font-size: 25px;
    }

    .product-image {
        height: 100px;
    }

    .product-image img {
        max-width: 95px;
        max-height: 95px;
    }

    .product-title {
        font-size: 14px;
    }

    .review-count {
        font-size: 16px;
    }

    .price {
        font-size: 18px;
    }

    .amazon-button {
        padding: 8px 13px;
        font-size: 13px;
    }
}


@media (max-width: 500px) {

    .ranking-card {
        grid-template-columns: 45px 85px 1fr;
        gap: 9px;
    }

    .product-image {
        height: 85px;
    }

    .product-image img {
        max-width: 80px;
        max-height: 80px;
    }

}

.rank-1 .review-number {
    font-size: 34px;
}

.rank-2 .review-number {
    font-size: 32px;
}

.rank-3 .review-number {
    font-size: 31px;
}

.ranking-card {
    min-height: 210px;
}