/* HGOS FINAL CLEAN CSS
 * Original attached CSS normalized in place.
 * Common 4-level typography only; duplicate declarations and empty rules removed.
 * No appended override block.
 */

/* ============================================================
 * HGOS Growth Class
 * Page-specific CSS
 * ============================================================ */

.community-class-page {
    width: 100%;
    max-width: 1100px;
    margin: 28px auto 60px;
    padding: 0;
    box-sizing: border-box;}

.cc-shell {
    width: 100%;
    box-sizing: border-box;
    padding: 34px 42px;
    border: 1px solid var(--hgos-border);
    border-radius: 28px;
    background: var(--hgos-white);
    box-shadow: 0 18px 52px rgba(48, 30, 90, .07);}

.cc-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--hgos-border);}

.cc-hero-main {
    min-width: 0;
    flex: 1 1 auto;}

.cc-title-row {
    display: flex;
    align-items: center;
    gap: 12px;}

.cc-hero h1 {
    margin: 5px 0 7px;
    color: var(--hgos-title);
    
    line-height: 1.22;
    
    letter-spacing: -.045em;
    font-size: var(--hgos-type-1-size);
    font-weight: 700;
}

.cc-description {
    margin: 0;
    color: var(--hgos-text);
    
    line-height: 1.75;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-hero-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;}

.cc-manager-link {
    color: var(--hgos-primary);
    
    line-height: 1;
    
    text-decoration: none;
    white-space: nowrap;
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

.cc-manager-link:hover {
    text-decoration: underline;}

.is-hidden {
    display: none !important;}

.cc-search {
    padding: 24px 0;
    border-bottom: 1px solid var(--hgos-border);}

.cc-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px 100px;
    gap: 10px;}

.cc-policy-guide {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 12px;
    color: var(--hgos-muted);
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-policy-guide b {
    color: var(--hgos-primary);
    font-weight: 700;}

.cc-list-panel {
    min-width: 0;
    padding-top: 26px;}

.cc-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    color: var(--hgos-title);}

.cc-section-head strong {
    
    line-height: 1.35;
    
    letter-spacing: -.025em;
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

.cc-section-head span {
    color: var(--hgos-muted);
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;}

.cc-class-card {
    width: 100%;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--hgos-border-soft);
    border-radius: 17px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;}

.cc-class-card:hover,
.cc-class-card.is-selected {
    border-color: var(--hgos-primary);
    background: var(--hgos-primary-soft-2);
    box-shadow: var(--hgos-shadow-sm);}

.cc-class-card:hover {
    transform: translateY(-1px);}

.cc-thumb {
    width: 88px;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 11px;
    background: var(--hgos-primary-soft);
    color: var(--hgos-primary);
    font-size: 20px;
    font-weight: 700;}

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

.cc-card-main {
    min-width: 0;}

.cc-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;}

.cc-card-top strong {
    overflow: hidden;
    color: var(--hgos-title);
    
    
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

.cc-policy {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--hgos-primary-soft);
    color: var(--hgos-primary);
    
    font-style: normal;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-policy.is-matching {
    background: var(--hgos-info-soft);
    color: var(--hgos-info);}

.cc-policy.is-participant {
    background: var(--hgos-warning-soft);
    color: var(--hgos-warning);}

.cc-lesson {
    display: block;
    margin-top: 5px;
    color: var(--hgos-text);
    
    line-height: 1.45;
    font-size: var(--hgos-type-3-size);
    font-weight: 500;
}

.cc-meta {
    display: block;
    margin-top: 6px;
    color: var(--hgos-muted);
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-empty {
    grid-column: 1 / -1;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 24px;
    color: var(--hgos-muted);
    text-align: center;}

.cc-empty small {
    display: block;
    margin-top: 5px;}

.cc-more {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;}

/* ============================================================
 * VIDEO MODAL
 * ============================================================ */

body.cc-modal-open {
    overflow: hidden;}

.cc-video-modal {
    position: fixed;
    inset: 0;
    z-index: calc(var(--hgos-z-modal) + 5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(14, 10, 26, .78);
    backdrop-filter: blur(5px);}

.cc-video-modal.is-open {
    display: flex;}

.cc-video-dialog {
    width: min(1120px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 22px;
    background: #0b0b0d;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .34);}

.cc-video-head {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px 12px 20px;
    background: #fff;}

.cc-video-heading {
    min-width: 0;}

.cc-video-heading strong {
    display: block;
    overflow: hidden;
    color: var(--hgos-title);
    
    
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

.cc-video-heading span {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--hgos-muted);
    
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-video-close {
    flex: 0 0 auto;
    min-width: 58px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--hgos-border);
    border-radius: 11px;
    background: #fff;
    color: var(--hgos-title);
    
    
    cursor: pointer;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-video-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;}

.cc-video-media iframe,
.cc-video-media video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;}

.cc-video-external,
.cc-video-unavailable {
    width: 100%;
    height: 100%;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #fff;}

/* ============================================================
 * PAYMENT MODAL
 * 공통 4단계 타이포그래피 적용
 * ============================================================ */

.cc-pay-modal {
    position: fixed;
    inset: 0;
    z-index: var(--hgos-z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(26, 20, 42, .48);
    backdrop-filter: blur(3px);
}

.cc-pay-modal.is-open {
    display: flex;
}

.cc-pay-dialog {
    width: min(460px, 100%);
    padding: 30px 26px 26px;
    border: 1px solid var(--hgos-border-soft);
    border-radius: 22px;
    background: var(--hgos-white);
    box-shadow: var(--hgos-shadow-lg);
    box-sizing: border-box;
}

.cc-pay-dialog h2 {
    margin: 0 0 14px;
    color: var(--hgos-title);
    line-height: 1.35;
    letter-spacing: -.025em;
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

.cc-pay-dialog > p {
    margin: 0;
    color: var(--hgos-text);
    line-height: 1.65;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-pay-dialog dl {
    margin: 20px 0 18px;
    padding: 16px 14px;
    border-radius: 14px;
    background: var(--hgos-bg-soft);
}

.cc-pay-dialog dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 36px;
    padding: 4px 0;
}

.cc-pay-dialog dt {
    flex: 0 0 auto;
    color: var(--hgos-muted);
    line-height: 1.45;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-pay-dialog dd {
    min-width: 0;
    margin: 0;
    color: var(--hgos-title);
    line-height: 1.45;
    text-align: right;
    word-break: keep-all;
    font-size: var(--hgos-type-3-size);
    font-weight: 500;
}

.cc-pay-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.cc-pay-actions .h-btn {
    min-height: 48px;
    border-radius: 13px;
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

#payCancel {
    min-width: 72px;
}

#payConfirm {
    min-width: 190px;
}

@media (max-width: 768px) {
    .cc-pay-modal {
        padding: 16px;
    }

    .cc-pay-dialog {
        padding: 24px 18px 20px;
        border-radius: 20px;
    }

    .cc-pay-dialog h2 {
        font-size: var(--hgos-type-2-size);
        font-weight: 700;
    }

    .cc-pay-dialog > p,
    .cc-pay-dialog dt {
        font-size: var(--hgos-type-4-size);
        font-weight: 400;
    }

    .cc-pay-dialog dd {
        font-size: var(--hgos-type-3-size);
        font-weight: 500;
    }

    .cc-pay-actions {
        gap: 8px;
    }

    .cc-pay-actions .h-btn {
        flex: 1 1 auto;
        min-width: 0;
        font-size: var(--hgos-type-2-size);
        font-weight: 700;
    }

    #payCancel {
        flex: 0 0 76px;
    }

    #payConfirm {
        flex: 1 1 auto;
    }
}

/* ============================================================
 * MOBILE
 * 공용 헤더와 동일하게 화면 전체 폭을 사용한다.
 * ============================================================ */

@media (max-width: 768px) {
    /*
     * 공용 모바일 헤더와 동일한 외곽 여백.
     * 영상 모달은 아래에서 계속 viewport 100%를 사용한다.
     */
    .community-class-page {
        width: calc(100% - 24px);
        max-width: none;
        margin: 12px auto 36px;
        padding: 0;
        box-sizing: border-box;}

    .cc-shell {
        width: 100%;
        padding: 20px 16px 24px;
        border-radius: 22px;
        box-shadow: none;
        box-sizing: border-box;}

    .cc-hero {
        display: block;
        padding-bottom: 10px;
        border-bottom: 0;}

    .cc-title-row {
        justify-content: space-between;
        gap: 10px;}

    .cc-hero h1 {
        margin: 4px 0 0;
    font-size: var(--hgos-type-1-size);
    font-weight: 700;
}

    .cc-manager-link {
        margin-top: 4px;
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

    .cc-description,
    .cc-hero-actions,
    .cc-policy-guide {
        display: none;}

    .cc-search {
        padding: 10px 0 14px;}

    .cc-search-row {
        grid-template-columns: minmax(0, 1fr) 92px;
        gap: 8px;}

    .cc-search-row #classSearch {
        grid-column: 1 / -1;
        min-height: 48px;}

    .cc-search-row #classPolicy,
    .cc-search-row #btnClassSearch {
        min-height: 46px;}

    .cc-list-panel {
        padding-top: 16px;}

    .cc-section-head {
        margin-bottom: 12px;}

    .cc-section-head strong {
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

    .cc-section-head span {
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

    .cc-list {
        grid-template-columns: 1fr;
        gap: 9px;}

    .cc-class-card {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 12px;
        padding: 11px;
        border-radius: 16px;}

    .cc-thumb {
        width: 78px;}

    .cc-card-top strong {
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

    .cc-lesson {
    font-size: var(--hgos-type-3-size);
    font-weight: 500;
}

    .cc-video-modal {
        padding: 0;
        background: rgba(0, 0, 0, .92);}

    .cc-video-dialog {
        width: 100%;
        max-height: 100vh;
        border: 0;
        border-radius: 0;}

    .cc-video-head {
        min-height: 58px;
        padding: 9px 10px 9px 14px;}

    .cc-video-heading strong {
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

    .cc-video-media {
        aspect-ratio: 16 / 9;}

    .cc-video-external,
    .cc-video-unavailable {
        min-height: 220px;}
}


/* API/인증 오류는 JS toast로만 표시 */
.cc-list .cc-runtime-error,
.cc-list .cc-api-error {
    display: none !important;}

/* ============================================================
 * HGOS TOAST
 * API / 인증 / 권한 오류는 본문이 아니라 화면 상단 토스트로 표시
 * ============================================================ */

#toast.h-toast,
#toast {
    position: fixed !important;
    top: max(18px, env(safe-area-inset-top)) !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 2147483000 !important;

    width: max-content !important;
    max-width: min(520px, calc(100vw - 32px)) !important;
    margin: 0 !important;
    padding: 12px 18px !important;

    border: 1px solid rgba(116, 7, 255, .20) !important;
    border-radius: 12px !important;
    background: rgba(34, 27, 48, .96) !important;
    box-shadow: 0 12px 34px rgba(25, 16, 45, .20) !important;

    color: #fff !important;
    
    
    line-height: 1.45 !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: keep-all !important;

    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate(-50%, -12px) !important;
    transition:
        opacity .18s ease,
        transform .18s ease,
        visibility .18s ease !important;
    font-size: var(--hgos-type-4-size) !important;
    font-weight: 400 !important;
}

#toast.show,
#toast.is-show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, 0) !important;}

@media (max-width: 768px) {
    #toast.h-toast,
    #toast {
        top: max(12px, env(safe-area-inset-top)) !important;
        max-width: calc(100vw - 24px) !important;
        padding: 11px 14px !important;
        border-radius: 11px !important;
    font-size: var(--hgos-type-4-size) !important;
    font-weight: 400 !important;
}
}


/* ============================================================
 * COURSE / LESSON BROWSER
 * 과정(피드) 1 : N 강의(클래스)
 * Desktop: 왼쪽 과정목록 / 오른쪽 강의목록
 * ============================================================ */

.cc-browser {
    display: grid;
    grid-template-columns: minmax(300px, .85fr) minmax(0, 1.35fr);
    gap: 16px;
    align-items: stretch;}

.cc-browser-pane {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--hgos-border-soft);
    border-radius: 20px;
    background: #fff;}

.cc-pane-head {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(116, 7, 255, .10);
    background: #eee7ff;}

.cc-pane-head strong {
    color: var(--hgos-title);
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

.cc-pane-head span {
    color: var(--hgos-muted);
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-list,
.cc-course-list {
    display: block;
    min-height: 420px;
    max-height: 640px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    scrollbar-gutter: stable;}

.cc-list .cc-class-card {
    margin-bottom: 9px;}

.cc-list .cc-class-card:last-child {
    margin-bottom: 0;}

.cc-course-card {
    width: 100%;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 9px;
    padding: 13px 14px;
    border: 1px solid var(--hgos-border-soft);
    border-radius: 15px;
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease,
        transform .18s ease;}

.cc-course-card:last-child {
    margin-bottom: 0;}

.cc-course-card:hover,
.cc-course-card.is-selected {
    border-color: var(--hgos-primary);
    background: var(--hgos-primary-soft-2);
    box-shadow: var(--hgos-shadow-sm);}

.cc-course-card:hover {
    transform: translateY(-1px);}

.cc-course-card-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;}

.cc-course-card-main strong {
    overflow: hidden;
    color: var(--hgos-title);
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--hgos-type-2-size);
    font-weight: 700;
}

.cc-course-card-main span {
    overflow: hidden;
    color: var(--hgos-muted);
    
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-course-card-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;}

.cc-course-card-side em {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--hgos-primary-soft);
    color: var(--hgos-primary);
    
    font-style: normal;
    
    white-space: nowrap;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-course-card-side small {
    max-width: 120px;
    overflow: hidden;
    color: var(--hgos-muted);
    
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-course-placeholder,
.cc-pane-empty {
    min-height: 390px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px;
    color: var(--hgos-muted);
    text-align: center;}

.cc-course-placeholder-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    border-radius: 16px;
    background: var(--hgos-primary-soft);
    color: var(--hgos-primary);
    font-size: 20px;}

.cc-course-placeholder strong {
    color: var(--hgos-title);
    font-size: var(--hgos-type-3-size);
    font-weight: 500;
}

.cc-course-placeholder small {
    max-width: 320px;
    
    line-height: 1.6;
    font-size: var(--hgos-type-4-size);
    font-weight: 400;
}

.cc-browser .cc-class-card {
    grid-template-columns: 78px minmax(0, 1fr);}

.cc-browser .cc-thumb {
    width: 78px;}

@media (max-width: 768px) {
    .cc-section-head > span {
        display: none;}

    .cc-browser {
        grid-template-columns: 1fr;
        gap: 12px;}

    /*
     * 모바일에서는 과정 선택이 먼저 보이도록 과정목록을 위에 배치한다.
     * 데스크톱에서는 왼쪽=과정, 오른쪽=강의이다.
     */
    .cc-course-pane {
        order: 1;}

    .cc-lesson-pane {
        order: 2;}

    .cc-list,
    .cc-course-list {
        min-height: 260px;
        max-height: 430px;
        padding: 8px;}

    .cc-course-placeholder,
    .cc-pane-empty {
        min-height: 240px;
        padding: 20px 14px;}

    .cc-course-card {
        min-height: 68px;
        padding: 11px 12px;
        border-radius: 14px;}

    .cc-course-card-main strong {
        font-size: var(--hgos-type-2-size);
        font-weight: 700;
    }

    .cc-browser .cc-class-card {
        grid-template-columns: 70px minmax(0, 1fr);}

    .cc-browser .cc-thumb {
        width: 70px;}
}
