@charset "UTF-8";

/* [Variables] - works_youtube.css / works_insta.css와 동일 톤 유지 */
: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);
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    word-break: keep-all;
}

.inner {
    max-width: 1600px;
    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; }

/* [Total Count Bar] */
.ai-works-section .list-filter {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ai-works-section .total-count {
    color: var(--text-sub);
    font-size: 14px;
    letter-spacing: 1px;
}
.ai-works-section .total-count strong { color: var(--point-color); font-size: 16px; }

/* [AI Works Grid - 한 페이지 6개(3x2) 기준] */
.ai-works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.ai-work-card {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transition: var(--transition);
}

.ai-work-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 45px rgba(255, 95, 0, 0.18);
}

.ai-work-media {
    position: absolute;
    inset: 0;
    background: #000;
}

.ai-work-media iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
    /* 유튜브 자체 UI를 가리기 위한 미세 확대 */
    transform: scale(1.15);
}

/* 하단 그라데이션 캡션 오버레이 - 항상 일부 노출, hover 시 이유(reason) 텍스트까지 확장 */
.ai-work-overlay {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 14px 14px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 10%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 2;
}

.ai-work-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 20px;
    background: rgba(255,255,255,0.12);
    color: #D1D6DB;
    margin-bottom: 8px;
}
.ai-work-badge.ongoing { background: var(--point-color); color: #fff; }

.ai-work-overlay strong {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ai-work-overlay p {
    color: #D1D6DB;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: var(--transition);
}

.ai-work-card:hover .ai-work-overlay p {
    max-height: 60px;
    opacity: 1;
    margin-top: 2px;
}

/* =========================================
   반응형 - 태블릿 / 모바일
   ========================================= */
@media screen and (max-width: 768px) {
    .ai-works-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
        padding: 0 4px 60px;
    }
    .ai-work-card { border-radius: 14px; }
    .ai-work-card:hover { transform: none; } /* 모바일은 hover 없음 */

    /* 모바일은 hover가 없으므로 캡션(브랜드명+이유)을 항상 살짝 보이게 */
    .ai-work-overlay p {
        max-height: 44px;
        opacity: 1;
        font-size: 11px;
        margin-top: 2px;
    }
    .ai-work-overlay strong { font-size: 12px; }
    .ai-work-badge { font-size: 9px; padding: 2px 7px; }

    .ai-works-section .list-filter { margin-bottom: 24px; padding: 0 4px 16px; }
}

@media screen and (max-width: 360px) {
    .ai-works-grid { gap: 8px; }
}


/* =========================================
   [Pagination] works_youtube.php와 동일 톤 (6개씩 페이지네이션)
   ========================================= */
.pagination-wrap {
    margin-top: 60px;
    padding-bottom: 100px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.pagination a {
    display: inline-block;
    width: 38px;
    height: 38px;
    line-height: 38px;
    font-size: 14px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    color: var(--text-sub);
    text-decoration: none;
    transition: var(--transition);
}

.pagination a.active,
.pagination a:hover {
    background: var(--point-color);
    color: #fff;
    border-color: var(--point-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 95, 0, 0.25);
}

@media screen and (max-width: 768px) {
    .pagination-wrap {
        margin-top: 40px;
        padding: 0 15px 60px;
    }
    .pagination {
        gap: 6px;
        overflow-x: auto;
        max-width: 100%;
        scrollbar-width: none;
    }
    .pagination::-webkit-scrollbar { display: none; }
    .pagination a {
        flex: 0 0 auto;
        width: 34px;
        height: 34px;
        line-height: 34px;
        font-size: 13px;
    }
}