/* 실시간 만화 랭킹 (가로 3열 다행 레이아웃) */
.new-ranking-section {
    margin-top: 50px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin-right: 20px;
}

.ranking-category-tabs {
    display: flex;
    gap: 8px;
    flex-grow: 1;
}

.rc-tab {
    background: #fff;
    border: none;
    font-size: 15px;
    font-weight: 400;
    color: #777;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.rc-tab:hover {
    color: #111;
    background: #f5f5f5;
}

.rc-tab.active {
    color: #fff;
    background: #111;
    font-weight: 600;
}

.view-all {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    background: #fff;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.view-all:hover {
    background: #f9f9f9;
}

/* 슬라이더 영역 */
.nr-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    
}

.nr-slider-container {
    width: 100%;
    overflow-x: auto;
    padding: 10px;
    border-radius: 16px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.nr-slider-container::-webkit-scrollbar {
    display: none;
}
.nr-item{
    background: white;
    border-radius: 10px;
}

.nr-grid {
    display: grid;
    /* 3개의 행 */
    grid-template-rows: repeat(3, 1fr);
    /* 열은 자동으로 늘어남 */
    grid-auto-flow: column;
    /* 각 열의 너비를 전체의 33.333%로 지정하여 3열(총 9개 중 한 화면에 3x3) 보이게 설정 */
    grid-auto-columns: calc((100% - 40px) / 3);
    gap: 20px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.nr-item a {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}



.nr-thumb {
    position: relative;
    width: 100px;
    height: 140px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f5f5f5;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
}

.nr-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.age-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #fff;
    color:var(--brand-text);
    font-size: 14px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--brand-action);
    z-index: 2;
}

.nr-num {
    font-size: 22px;
    font-weight: 800;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    color: #111;
}

.nr-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow: hidden;
}

.nr-info h4 {
    font-size: 16px;
    font-weight: 500;
    color: #111;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nr-author {
    font-size: 14px;
    color: #777;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nr-tags {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.nr-tags .tag {
    font-size: 14px;
    color: #666;
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

.nr-views {
    font-size: 14px;
    color: #888;
    margin: 4px 0 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 좌우 네비게이션 버튼 */
.nr-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    z-index: 10;
    transition: all 0.2s ease;
    color: #666;
}

.nr-nav-btn.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.nr-nav-btn:hover {
    background: #f8f8f8;
    color: #111;
}

.nr-nav-btn.prev {
    left: -20px;
}

.nr-nav-btn.next {
    right: 0;
}

/* 반응형 */
@media (max-width: 1024px) {
    .nr-grid {
        grid-auto-columns: calc((100% - 20px) / 2); /* 2열로 변경 */
    }
}

@media (max-width: 768px) {
    .new-ranking-section .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
        position: relative;
    }
    .new-ranking-section .section-header h2 {
        margin-right: 0;
    }
    .new-ranking-section .ranking-category-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .new-ranking-section .ranking-category-tabs::-webkit-scrollbar {
        display: none;
    }
    .new-ranking-section .rc-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .new-ranking-section .view-all {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
    }
    .section-header h2 {
        margin-right: 0;
    }
    .ranking-category-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: none; /* Firefox */
    }
    .ranking-category-tabs::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }
    .rc-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .view-all {
        position: absolute;
        top: 20px;
        right: 0;
    }
    .new-ranking-section {
        position: relative;
        padding: 0 10px;
    }
    .nr-slider-wrapper {
        padding: 0;
    }
    .nr-nav-btn {
        display: none; /* 모바일에서는 가로 스크롤로 대체하므로 버튼 숨김 */
    }
    .nr-slider-container {
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: none;
        padding-bottom: 10px;
    }
    .nr-slider-container::-webkit-scrollbar {
        display: none;
    }
    .nr-grid {
        grid-auto-columns: calc(100% - 20px); /* 모바일에서는 1열씩 3줄만 보이고 옆으로 스크롤 */
    }
}
