@charset "UTF-8";

/* [Variables] */
:root {
    --bg-dark: #0b0e12;
    --bg-card: #191f28;
    --point-color: #FF5F00;
    --text-main: #ffffff;
    --text-sub: #8B95A1;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* [Layout] */
body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    word-break: keep-all;
}

.inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* [Header Section] */
.works-header {
    padding: clamp(80px, 10vh, 140px) 0 60px;
    text-align: center;
}

.works-header .badge {
    color: var(--point-color);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    display: inline-block;
    margin-bottom: 15px;
    padding: 4px 12px;
    background: rgba(255, 95, 0, 0.1);
    border-radius: 4px;
}

.works-header h2 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    margin: 0 0 20px 0;
}

.works-header h2 strong { color: var(--point-color); }
.works-header p { color: var(--text-sub); font-size: clamp(16px, 2vw, 19px); margin: 0; }

/* [Filter Bar] */
.list-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sort-buttons { display: flex; gap: 8px; }
.sort-buttons a {
    color: var(--text-sub);
    font-size: 14px;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 50px;
    background: rgba(255,255,255,0.05);
    transition: var(--transition);
}

.sort-buttons a.active, .sort-buttons a:hover {
    background: var(--point-color);
    color: #fff;
}

/* [Youtube Grid] */
.yt-grid-container {
    display: grid;
    /* 기본 4열 배치 */
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.yt-card-item {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.yt-card-item:hover {
    transform: translateY(-12px);
    border-color: var(--point-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

/* 썸네일 영역 */
.yt-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* 비율 고정 */
    overflow: hidden;
}

.yt-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.yt-card-item:hover .yt-thumb-wrap img { transform: scale(1.08); }

/* 카드 본문 */
.yt-card-body {
    padding: 24px;
    flex-grow: 1;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.p-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #000;
    flex-shrink: 0;
}

.p-text h6 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.p-text .follower { font-size: 13px; color: var(--text-sub); }

.yt-stats-row {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.stat { font-size: 13px; color: var(--text-sub); display: flex; align-items: center; gap: 6px; }
.stat i { color: var(--point-color); font-size: 14px; }

/* [Paging] */
.pagination-wrap {
    margin-top: 60px;
    padding-bottom: 100px;
    text-align: center;
}
/* =========================================
   [Youtube] 모바일 2열 및 페이지네이션 최적화
   ========================================= */

   @media screen and (max-width: 768px) {
    /* 1. 그리드 설정: 1열 -> 2열 변신 */
    .yt-grid-container {
        grid-template-columns: repeat(2, 1fr) !important; /* ★ 2열 강제 */
        gap: 12px !important; /* 간격을 좁혀서 아기자기하게 */
        padding: 0 10px;
    }

    /* 2. 카드 내부 슬림화 (공간 확보) */
    .yt-card-body {
        padding: 15px 12px !important;
    }

    .channel-info {
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .p-img {
        width: 32px !important; /* 프로필 이미지 축소 */
        height: 32px !important;
    }

    .p-text h6 {
        font-size: 13px !important; /* 폰트 축소 */
    }

    .p-text .follower {
        font-size: 11px !important;
    }

    .yt-stats-row {
        padding-top: 10px;
    }

    .stat {
        font-size: 10px !important; /* 스탯 폰트 마이크로화 */
        gap: 4px;
    }

    /* 3. ★ 페이지네이션 잘림 방지 (가로 스크롤형) */
    .pagination-wrap {
        margin-top: 40px;
        padding: 0 15px 60px;
        display: flex;
        justify-content: center; /* 기본은 중앙 */
    }

    /* 숫자 버튼들을 감싸는 컨테이너 (필요시 HTML 구조에 div 추가 권장) */
    .pagination {
        display: flex;
        gap: 5px;
        overflow-x: auto; /* ★ 10개가 다 안 들어가면 가로 스크롤 허용 */
        white-space: nowrap;
        padding: 10px 5px;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        scrollbar-width: none; /* 파이어폭스 스크롤바 숨김 */
    }

    .pagination::-webkit-scrollbar {
        display: none; /* 크롬/사파리 스크롤바 숨김 */
    }

    .pagination a {
        flex: 0 0 auto; /* 크기 유지 */
        width: 32px !important; /* 버튼 크기 축소 */
        height: 32px !important;
        line-height: 32px;
        font-size: 12px !important;
        border-radius: 50%;
        background: var(--bg-card);
        border: 1px solid rgba(255,255,255,0.05);
    }


    .list-filter {
        flex-direction: column; /* 세로로 쌓기 */
        gap: 15px;
        padding: 20px 15px;
        margin-bottom: 30px;
        text-align: center;
    }

    .total-count {
        font-size: 12px !important; /* 글씨 앙증맞게 */
        letter-spacing: -0.5px;
    }

    .sort-buttons {
        width: 100%;
        justify-content: center; /* 버튼 중앙 정렬 */
        gap: 6px;
    }

    .sort-buttons a {
        font-size: 11px !important; /* 14px -> 11px 마이크로화 */
        padding: 6px 14px !important;
        flex: 1; /* 버튼 너비 균등 분배 */
        max-width: 90px; /* 너무 퍼지지 않게 */
        white-space: nowrap;
    }


    
}

/* 360px 이하 초소형 기기 정밀 튜닝 */
@media screen and (max-width: 360px) {
    .yt-grid-container {
        gap: 8px !important;
    }
    .p-text h6 { font-size: 12px !important; }
    .pagination a {
        width: 28px !important; /* 극강의 슬림화 */
        height: 28px !important;
        line-height: 28px;
    }
}



/* =========================================
   [Pagination] 5개 버튼 중앙 정렬 최적화
   ========================================= */

   @media screen and (max-width: 768px) {
    .pagination-wrap {
        margin-top: 40px;
        padding-bottom: 60px;
        display: flex;
        justify-content: center; /* 5개일 때 중앙 정렬이 가장 예쁨 */
    }

    .pagination {
        display: inline-flex;
        gap: 6px; /* 버튼 사이 간격 옹기종기하게 */
        align-items: center;
    }

    .pagination a {
        /* 5개 버튼이 한 줄에 쏙 들어오는 마법의 크기 */
        flex: 0 0 auto;
        width: 34px !important; 
        height: 34px !important;
        line-height: 34px;
        font-size: 13px !important;
        background: #191f28;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 50%; /* 둥글둥글 아기자기하게 */
        color: #8B95A1;
        transition: all 0.3s ease;
    }

    /* 활성화된 페이지 & 호버 효과 */
    .pagination a.active, 
    .pagination a:hover {
        background: #FF5F00 !important;
        color: #fff !important;
        border-color: #FF5F00 !important;
        transform: translateY(-2px); /* 살짝 들리는 효과 */
        box-shadow: 0 4px 10px rgba(255, 95, 0, 0.2);
    }

    /* [선택사항] 만약 HTML에서 10개가 출력되는데 CSS로 6번 이후를 숨기고 싶다면? */
    /* .pagination a:nth-child(n+7) { display: none !important; } */
    /* 위 주석을 해제하면 6번째 버튼부터 강제로 안 보입니다. */
}

/* 360px 이하 초소형 모바일 */
@media screen and (max-width: 360px) {
    .pagination {
        gap: 4px;
    }
    .pagination a {
        width: 30px !important;
        height: 30px !important;
        line-height: 30px;
        font-size: 12px !important;
    }
}