/* ========================================
   CURRENT CATEGORY
   ======================================== */

.c-sidebar__categories .current-cat > a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}


/* ========================================
   CATEGORY HEADER
   ======================================== */

.c-category {
    min-width: 0;
}

.c-category__title {
    margin: 0 0 12px;

    font-size: 32px;
    line-height: 44px;
    font-weight: 700;

    letter-spacing: -0.025em;
}

.c-category__description {
    margin: 0 0 34px;

    color: var(--color-text-tertiary);

    font-size: 15px;
    line-height: 24px;
}

.c-category__description:empty {
    display: none;
}


/* ========================================
   CATEGORY BROWSER

   콘텐츠 720px는 그대로 유지하고
   오른쪽 64px gutter를 indicator에 사용한다.
   ======================================== */

.c-category-browser {
    position: relative;

    width: calc(100% + 64px);
}


/* ========================================
   JS / NON-JS
   ======================================== */

.c-category-virtual,
.c-category-progress {
    display: none;
}

.c-category-browser.is-enhanced .c-category-virtual {
    display: block;

    width: calc(100% - 64px);
}

.c-category-browser.is-enhanced .c-category-progress {
    display: flex;
}

.c-category-browser.is-enhanced .c-category-fallback {
    display: none;
}


/* ========================================
   VIRTUAL SCROLL
   ======================================== */

.c-category-virtual {
    min-width: 0;
}

.c-category-virtual__spacer {
    width: 100%;
    height: 0;
}

.c-category-virtual__sentinel {
    width: 100%;
    height: 1px;

    pointer-events: none;
}

.c-category-virtual__list {
    width: 100%;
}

.c-category-page {
    width: 100%;
}

.c-category-post {
    padding: 0 0 34px;
    margin: 0 0 34px;

    border-bottom: 1px solid var(--color-border-subtle);
}

.c-category-post:last-child {
    margin-bottom: 34px;
}

.c-category-post__title {
    margin: 0 0 16px;

    font-size: 28px;
    line-height: 36px;
    font-weight: 700;

    letter-spacing: -0.02em;
}

.c-category-post__title a {
    color: var(--color-text-primary);

    text-decoration: none;
}

.c-category-post__title a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.c-category-post__excerpt {
    margin: 0 0 16px;

    font-size: 17px;
    line-height: 29px;
}

.c-category-post__excerpt > :first-child {
    margin-top: 0;
}

.c-category-post__excerpt > :last-child {
    margin-bottom: 0;
}

.c-category-post__date {
    margin: 0;

    color: var(--color-text-tertiary);

    font-size: 13px;
    line-height: 18px;
}


/* ========================================
   RIGHT VERTICAL INDICATOR
   ======================================== */

.c-category-progress {
    position: sticky;

    top: 64px;

    float: right;

    flex-direction: column;
    align-items: center;

    width: 40px;

    margin-top: 0;
    margin-right: 0;

    color: var(--color-text-tertiary);

    user-select: none;
}

.c-category-progress__total {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 2px;

    margin-bottom: 12px;

    font-size: 10px;
    line-height: 14px;

    letter-spacing: 0.04em;
}

.c-category-progress__total span:first-child {
    color: var(--color-text-primary);

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

.c-category-progress__track {
    position: relative;

    width: 2px;
    height: 220px;

    background: var(--color-border-subtle);
}

.c-category-progress__thumb {
    position: absolute;

    top: 0;
    left: -2px;

    width: 6px;
    height: 34px;

    border-radius: 999px;

    background: var(--color-text-primary);

    transform: translateY(0);
    will-change: transform;
}

.c-category-progress__position {
    display: flex;

    gap: 3px;

    margin-top: 12px;

    color: var(--color-text-primary);

    font-size: 11px;
    line-height: 15px;
    font-variant-numeric: tabular-nums;
}

.c-category-progress__active {
    margin-top: 4px;

    font-size: 9px;
    line-height: 13px;

    white-space: nowrap;
}


/* ========================================
   FALLBACK PAGINATION
   ======================================== */

.c-category-fallback__pagination {
    margin-top: 30px;

    font-size: 13px;
    line-height: 20px;
}


/* ========================================
   TABLET
   ======================================== */

@media (max-width: 959px) {
    .c-category-browser {
        width: 100%;
    }

    .c-category-browser.is-enhanced .c-category-virtual {
        width: 100%;
        padding-right: 24px;
    }

    .c-category-progress {
        position: fixed;

        top: 50%;
        right: 8px;

        z-index: 20;

        transform: translateY(-50%);
    }

    .c-category-progress__track {
        height: 160px;
    }

    .c-category-progress__total,
    .c-category-progress__active {
        display: none;
    }
}


/* ========================================
   MOBILE
   ======================================== */

@media (max-width: 767px) {
    .c-category__title {
        font-size: 28px;
        line-height: 39px;
    }

    .c-category-post__title {
        font-size: 24px;
        line-height: 33px;
    }

    .c-category-post__excerpt {
        font-size: 16px;
        line-height: 28px;
    }

    .c-category-progress__track {
        height: 120px;
    }

    .c-category-progress__position {
        font-size: 9px;
    }
}


/* ========================================
   INDICATOR MINIMAL MODE

   SOULHA UI:
   세로 Track + Thumb + Current / Total만 표시한다.
   ======================================== */

.c-category-progress__total,
.c-category-progress__active {
    display: none !important;
}

.c-category-progress {
    gap: 0;

    width: 40px;
}

.c-category-progress__track {
    margin: 0;
}

.c-category-progress__position {
    margin-top: 10px;

    color: var(--color-text-primary);

    font-size: 11px;
    line-height: 15px;

    font-variant-numeric: tabular-nums;

    white-space: nowrap;
}


/* ========================================
   SOULHA CATEGORY TYPOGRAPHY TUNING
   ======================================== */

/* 카테고리명은 콘텐츠 제목보다 한 단계 낮은 위계로 표시 */
.c-category__title {
    font-size: 18px;
    line-height: 26px;
    font-weight: 600;
    color: #666;
}

/* JS 렌더링 콘텐츠 제목 */
.c-category-post__title {
    font-size: 24px;
    line-height: 33px;
    font-weight: 600;
}

.c-category-post__title a {
    color: #222;
}

/* 서버 fallback 콘텐츠 제목 */
.c-category-fallback .c-post-item__title {
    font-size: 24px;
    line-height: 33px;
    font-weight: 600;
}

.c-category-fallback .c-post-item__title a {
    color: #222;
}


/* ----------------------------------------
   EXCERPT: 최대 3줄
   ---------------------------------------- */

.c-category-post__excerpt {
    overflow: hidden;
}

.c-category-post__excerpt,
.c-category-post__excerpt > p,
.c-category-fallback .c-post-item__excerpt,
.c-category-fallback .c-post-item__excerpt > p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}


/* ----------------------------------------
   MOBILE
   ---------------------------------------- */

@media (max-width: 767px) {
    .c-category__title {
        font-size: 16px;
        line-height: 24px;
    }

    .c-category-post__title,
    .c-category-fallback .c-post-item__title {
        font-size: 21px;
        line-height: 30px;
    }
}

/* ========================================
   /SOULHA CATEGORY TYPOGRAPHY TUNING
   ======================================== */
