@charset "utf-8";

/* Forum 전용: 공용 애드온의 추출·캐시·설정을 변경하지 않고 내부 표현만 개선한다. */
.forum-best-card {
    min-width: 0;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-top: 3px solid #d62f35;
    border-radius: 3px;
    background: #fafafa;
}

.forum-best-card .forum-best-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 6px;
}

.forum-best-card .forum-best-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: #fbe8e9;
    color: #bd2530;
    font-size: 14px;
}

.forum-best-card .forum-best-heading h2 {
    margin: 0;
    color: #292d34;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
}

.forum-best-card .nav-tabs {
    display: flex;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 2px;
    border: 1px solid #e4e5e8;
    border-radius: 8px;
    background: #f0f1f3;
}

.forum-best-card .nav-tabs::before,
.forum-best-card .nav-tabs::after {
    display: none;
}

.forum-best-card .nav-tabs > li {
    display: block;
    flex: 1 1 0;
    float: none;
    min-width: 0;
    width: auto;
    margin: 0;
}

.forum-best-card .nav-tabs > li > a {
    display: block;
    margin: 0;
    padding: 4px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #555b66;
    font-size: 13px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    white-space: nowrap;
}

.forum-best-card .nav-tabs > li > a > span {
    margin-left: 3px;
    font-size: 11px;
    font-weight: 400;
}

.forum-best-card .nav-tabs > li > a:hover {
    border: 0;
    background: #fff;
    color: #b9202c;
}

.forum-best-card .nav-tabs > li.active > a,
.forum-best-card .nav-tabs > li.active > a:hover,
.forum-best-card .nav-tabs > li.active > a:focus {
    border: 0;
    background: #c82934;
    color: #fff;
    box-shadow: 0 2px 4px rgba(127, 26, 34, 0.12);
}

.forum-best-card a:focus-visible {
    outline: 2px solid #a81725;
    outline-offset: 2px;
}

.forum-best-card .tab-content {
    margin-top: 6px;
    padding: 2px 10px;
    border: 1px solid #e7e8eb;
    border-radius: 8px;
    background: #fff;
}

.forum-best-card .best-post-addon {
    margin: 0;
    padding: 0;
}

.forum-best-card .best-post-addon .row {
    margin-right: -12px;
    margin-left: -12px;
}

.forum-best-card .best-post-addon .col {
    padding-right: 12px;
    padding-left: 12px;
}

/* 추천글이 적어 한 열만 있으면 빈 오른쪽 칸 없이 전체 폭을 사용한다. */
.forum-best-card .best-post-addon .col:only-child {
    width: 100%;
}

.forum-best-card .best-post-addon li + li {
    border-top: 1px solid #f0f1f3;
}

.forum-best-card .best-post-addon li > a {
    min-height: 26px;
    padding: 3px 2px;
    color: #3c4149;
    font-size: 13px;
    line-height: 20px;
}

.forum-best-card .best-post-addon li > a:hover,
.forum-best-card .best-post-addon li > a:focus-visible {
    border-radius: 4px;
    background: #fff5f5;
    color: #b9202c;
    text-decoration: none;
}

.forum-best-card .best-post-addon .rank-icon {
    display: inline-block;
    width: 20px;
    height: 18px;
    margin: 1px 6px 0 0;
    padding: 0;
    border-radius: 4px;
    background: #eff0f3;
    color: #626976;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 18px;
    text-align: center;
    vertical-align: top;
}

/* 열마다 순위를 다시 강조하지 않도록 첫 열의 상위 세 항목에만 적용한다. */
.forum-best-card .best-post-addon .col:first-child li:nth-child(-n+3) .rank-icon {
    background: #fbe8e9;
    color: #b9202c;
}

.forum-best-card .best-post-addon .col:first-child li:first-child .rank-icon {
    background: #c82934;
    color: #fff;
}

.forum-best-card .best-post-addon .count {
    min-width: 22px;
    margin: 1px 0 0 6px;
    padding: 0 4px;
    border-radius: 5px;
    background: #f4f5f7;
    color: #69717e;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    line-height: 18px;
    text-align: center;
}

.forum-best-card .best-post-addon .count::before {
    content: "댓글 ";
    font-size: 10px;
}

.forum-best-card .best-post-addon > p {
    margin: 0;
    padding: 12px 4px;
}

.forum-best-card .btn-wset {
    margin: 4px 0 2px;
}

/* 넓은 화면은 제목과 기간 선택을 한 줄에 배치한다. 목록의 글 수는 유지한다. */
@media (min-width: 1200px) {
    .forum-best-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(240px, 1fr);
        align-items: center;
        gap: 6px 12px;
    }

    .forum-best-card .forum-best-heading {
        margin: 0;
    }

    .forum-best-card .forum-best-tabs {
        display: contents;
    }

    .forum-best-card .tab-content {
        grid-column: 1 / -1;
        margin-top: 0;
    }
}

@media (max-width: 767px) {
    .forum-best-card {
        padding: 8px 10px;
    }

    .forum-best-card .best-post-addon .col {
        float: none;
        width: 100%;
    }

    .forum-best-card .best-post-addon .col + .col > ul {
        border-top: 1px solid #f0f1f3;
    }

    .forum-best-card .best-post-addon li > a {
        min-height: 28px;
        padding-top: 4px;
        padding-bottom: 4px;
    }
}

@media (max-width: 479px) {
    .forum-best-card .nav-tabs > li > a > span {
        display: none;
    }

    .forum-best-card .tab-content {
        padding-right: 8px;
        padding-left: 8px;
    }
}
