/* ================================================================
   [Works 페이지 스타일 - works.css]
   포트폴리오 그리드 카드 레이아웃
   ================================================================ */

.works-filter-wrapper { width: 100%; position: relative; z-index: 2; display: flex; justify-content: center; padding: 0 20px; margin-top: -48px; margin-bottom: 52px; }
.works-filter { display: inline-flex; position: relative; background: transparent; border: 2px solid #ff2c2c; border-radius: 50px; padding: 4px; gap: 0; }
.works-filter-indicator { position: absolute; top: 4px; left: 4px; height: calc(100% - 8px); width: 0; background: #ff2c2c; border-radius: 50px; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 0; pointer-events: none; }
.works-filter-btn { position: relative; z-index: 1; padding: 10px 26px; background: transparent; border: none; border-radius: 50px; color: rgba(255, 255, 255, 0.55); font-size: 15px; font-weight: 600; cursor: pointer; transition: color 0.3s ease; white-space: nowrap; }
.works-filter-btn:hover, .works-filter-btn.active { color: #fff; }

body.light-mode .works-filter { border-color: #ff2c2c; }
body.light-mode .works-filter-btn { color: rgba(11, 11, 11, 0.55); }
body.light-mode .works-filter-btn:hover, body.light-mode .works-filter-btn.active { color: #0b0b0b; }

.works-grid-wrapper { width: 100%; position: relative; z-index: 2; }
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 80px 48px; width: 100%; max-width: 100%; margin: 0 auto; padding: 0 17vw; padding-bottom: 120px; box-sizing: border-box; }

.works-card {
    display: block; background: transparent !important; border: none !important; color: #fff !important; text-decoration: none !important;
    opacity: 0; transform: translateY(60px); 
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.works-card.visible {
    opacity: 1; transform: translateY(0);
    transition: opacity 1.4s cubic-bezier(0.19, 1, 0.22, 1), transform 1.4s cubic-bezier(0.19, 1, 0.22, 1), filter 0.8s ease;
}

/* 블러 효과 상태 설정 */
.works-card.visible.blur-out { 
    filter: blur(6px) !important; 
    opacity: 0.3 !important; 
    transform: scale(0.96) !important; 
    transition: filter 0.8s ease, opacity 0.8s ease, transform 0.8s ease;
}

.works-card:hover { transform: translateY(-6px); box-shadow: none !important; }
.works-card.visible:hover { transform: translateY(-6px); }

.works-card-thumb { width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: #0b0b0b; border-radius: 16px; position: relative; }
.works-badge { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 6px 14px; background: #ff2c2c !important; color: #fff !important; font-size: 12px; font-weight: 600; border-radius: 50px; }
.works-card:hover .works-card-thumb { box-shadow: 0 0 20px rgba(255, 44, 44, 0.2); }
.works-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.works-card:hover .works-card-thumb img { transform: scale(1.05); }

.works-card-info { padding: 18px 4px 0; }
.works-card-info h3 { font-size: 26px; font-weight: 700; margin: 0; color: #fff !important; }

body.light-mode .works-card { background: transparent !important; box-shadow: none !important; }
body.light-mode .works-card-thumb { background: #f0f0f0; }
body.light-mode .works-card-info h3 { color: #1a1a1a !important; }
body.light-mode .works-badge { color: #fff !important; }

@media (max-width: 1024px) { .works-grid { grid-template-columns: repeat(2, 1fr); padding: 0 24px; gap: 36px 28px; } }

/* ================================================================
   [수정] 모바일 반응형 배열 및 여백 교정 (PC 버전 영향 없음)
   ================================================================ */
@media (max-width: 768px) {
    /* 1. Works 텍스트 위치: 이전(75px)보다 더 줄여서(60px) 헤더 바로 밑까지 최대한 끌어올림 */
    #project-web-section {
        padding-top: 60px !important; 
    }

    /* 타이틀과 필터 버튼 사이의 여백 (버튼 크기 유지) */
    .sub-header {
        padding-bottom: 0 !important;
        margin-bottom: 15px !important; 
    }
    .sub-header h1 {
        margin-bottom: 0 !important; 
    }

    .works-filter-wrapper {
        margin-top: 0 !important;
        margin-bottom: 25px !important; 
        padding: 0 5px !important; 
    }

    /* 2. 아웃라인(빨간 테두리) 형태 유지하며 비례 확대 (이전과 동일) */
    .works-filter {
        padding: 4px !important; 
        display: inline-flex !important; 
        justify-content: center !important;
        width: auto !important; 
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* 3. 버튼 크기 및 텍스트를 동일한 비율로 동시 확대 (이전과 동일) */
    .works-filter-btn {
        padding: 8px clamp(8px, 2.5vw, 16px) !important; 
        font-size: clamp(13px, 3.2vw, 15px) !important; 
        letter-spacing: -0.5px !important; 
        word-break: keep-all !important;
    }

    /* 그리드 및 카드 설정 */
    .works-grid {
        grid-template-columns: 1fr;
        gap: 30px; 
        padding: 0 20px;
    }
    .works-card-info {
        padding: 12px 4px 0;
    }
    .works-card-info h3 {
        font-size: 18px;
    }
}