/**
 * Affiliate Ranking Front-end Styles
 */

/* Container styles */
.oripa-affiliate-ranking {
    margin: 30px 0;
    width: 100%;
    position: relative;
    
    /* コンテナ内の要素 */
    .ranking-container {
        display: flex;
        flex-wrap: nowrap;
        gap: 15px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        
        /* スクロールバーのスタイリング */
        &::-webkit-scrollbar {
            height: 8px;
        }
        
        &::-webkit-scrollbar-track {
            background: #e0f3ff;
            border-radius: 4px;
        }
        
        &::-webkit-scrollbar-thumb {
            background: linear-gradient(90deg, #0394df 0%, #2db9ff 100%);
            border-radius: 4px;
            
            &:hover {
                background: #0470a7;
            }
        }
        
        /* ランキングアイテム */
        .ranking-item {
            flex: 0 0 auto;
            width: 300px;
            margin-bottom: 10px;
            border: 1px solid #0394df;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            background-color: rgba(27, 27, 27, 0.4);
            display: flex;
            flex-direction: column;
            scroll-snap-align: start;
            padding: 8px 8px;
            height: fit-content;
            @media screen and (max-width 767px) {
                width: 250px;
            }
            
            /* ヘッダー部分 */
            .ranking-header {
                padding: 0px;
                text-align: center;
                
                .ranking-position {
                    margin: 4px 0 5px;
                    padding-left: 0;
                    font-size: 16px;
                    font-weight: bold;
                    color: #fff;
                    border: none;
                    font-weight: 900;
                    font-style: italic;
                    text-shadow: 0 0 10px #0394df, 0 0 10px #0394df, 0 0 10px #0394df;
                    position: relative;
                    &:before,&:after {
                        content: "";
                        position: absolute;
                        width: 20%;
                        height: 1px;
                        background: #0394df;
                        top: 0;
                        bottom: 0;
                        margin: auto;
                    }
                    &::before {
                        left: 0;
                    }
                    &::after {
                        right: 0;
                    }
                }
            }
            
            /* サムネイル画像スタイル */
            .ranking-thumbnail {
                width: 100%;
                height: 40px;
                overflow: hidden;
                position: relative;
                background-color: #fff;
                margin-bottom: 12px;
                
                img {
                    width: 100%;
                    height: 100%;
                    object-fit: contain;
                    display: block;
                }
            }
            
            .ranking-thumbnail2 {
                width: 100%;
                height: 160px;
                overflow: hidden;
                position: relative;
                background-color: #fff;
                margin-bottom: 12px;
                
                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    display: block;
                }
            }

            &:first-child .ranking-thumbnail{
                background: #191919;
            }
            
            /* タイトルスタイル */
            .ranking-title {
                padding-top: 0px;
                text-align: center;
                
                h4 {
                    margin: 8px 0 4px;
                    padding: 0;
                    border: none;
                    font-size: 14px;
                    font-weight: bold;
                    color: #fff;
                    line-height: 1.4;
                }
            }
            
            /* コンテンツ部分 */
            .ranking-content {
                padding: 0px;
                flex-grow: 1;
                
                .ranking-details {
                    width: 100%;
                    border-collapse: collapse;
                    margin-bottom: 8px;
                    
                    th, td {
                        padding: 8px 5px;
                        text-align: left;
                        vertical-align: top;
                        font-size: 11px;
                        line-height: 1.4;
                    }
                    
                    th {
                        width: 30%;
                        color: #fff;
                        font-weight: normal;
                        white-space: nowrap;
                        background-color: #00141f;
                    }
                    
                    td {
                        width: 70%;
                    }
                }
            }
            
            /* フッター部分 */
            .ranking-footer {
                text-align: center;
                
                .ranking-button {
                    a {
                        display: inline-block;
                        padding: 8px 8px;
                        background-image: url(/wp-content/themes/cocoon-child-master/images/cv-button-arrow.png), linear-gradient(93deg, rgba(222, 47, 47, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
                        background-repeat: no-repeat;
                        background-size: auto 100%;
                        background-position: center right;
                        border-bottom: .2em solid #b91212;
                        color: #fff !important;
                        text-decoration: none !important;
                        border-radius: 4px;
                        font-weight: bold;
                        transition: background-color 0.3s ease;
                        font-size: 10px;
                        width: 100%;
                        
                        &:hover {
                            color: unset;
                            opacity: unset;
                            filter: brightness(1.5);
                            box-shadow: 0 0 10px #ff7e61, 0 0 10px #ff7e61, 0 0 10px #ff7e61;
                        }
                    }
                    
                    img {
                        max-width: 100%;
                        height: auto;
                        display: inline-block;
                    }
                }
            }
        }
    }
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .oripa-affiliate-ranking .ranking-container .ranking-item {
        width: 220px;
    }
}

@media screen and (max-width: 480px) {
    .oripa-affiliate-ranking .ranking-container .ranking-item {
        width: 200px;
    }
}
