/* ======================== Product Case CSS ======================== */
/* 적용사례 페이지 - layout.css, componets.css 클래스 활용, 모바일 대응 */

/* ---------- 페이지 로드 애니메이션 ---------- */
@keyframes case-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .case-section-title,
    .case-section-desc,
    .case-category-tabs,
    .case-card,
    .case-pagination { animation: none !important; }
}

/* ---------- 섹션 ---------- */
.case-section {
    margin: 20px auto 32px;
    max-width: 1000px;
}

.case-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    animation: case-fade-in-up 0.5s ease-out both;
}

.case-section-desc {
    font-size: 1rem;
    color: #666;
    text-align: center;
    margin-bottom: 14px;
    line-height: 1.5;
    animation: case-fade-in-up 0.5s ease-out 0.08s both;
}

.case-desc-mobile-br {
    display: none;
}

/* ---------- 카테고리 탭 ---------- */
.case-category-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    animation: case-fade-in-up 0.5s ease-out 0.15s both;
}

.case-category-tab {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.case-category-tab:hover {
    color: #333;
    background: #f8f8f8;
    border-color: #ccc;
}

.case-category-tab.active {
    color: #fff;
    background: #667eea;
    border-color: #667eea;
}

.case-category-tab.active:hover {
    background: #5568d3;
    border-color: #5568d3;
}

/* ---------- 카드 그리드 (2열 × 3줄, 사진 크게) ---------- */
.case-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.case-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    animation: case-fade-in-up 0.45s ease-out both;
    cursor: pointer;
}

.case-card:nth-child(1) { animation-delay: 0.22s; }
.case-card:nth-child(2) { animation-delay: 0.28s; }
.case-card:nth-child(3) { animation-delay: 0.34s; }
.case-card:nth-child(4) { animation-delay: 0.4s; }
.case-card:nth-child(5) { animation-delay: 0.46s; }
.case-card:nth-child(6) { animation-delay: 0.52s; }

.case-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.case-card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
    overflow: hidden;
}

.case-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ---------- 모델 뱃지 (이미지 위 오버레이, 한눈에 Pro/Mini 구분) ---------- */
.case-card-model-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-block;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.case-card-model-badge--pro {
    background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.case-card-model-badge--mini {
    background: linear-gradient(135deg, #0d9d6e 0%, #078558 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.case-card-title {
    font-size: 1.12rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 12px 14px 4px;
    line-height: 1.4;
}

.case-card-caption {
    font-size: 1rem;
    color: #6f7682;
    margin: 0;
    padding: 0 14px 12px;
    line-height: 1.55;
}

/* ---------- 페이지네이션 ---------- */
.case-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    flex-wrap: wrap;
    animation: case-fade-in-up 0.45s ease-out 0.58s both;
}

.case-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.case-pagination-btn,
.case-pagination-num {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.case-pagination-btn:hover:not(.disabled),
.case-pagination-num:hover:not(.active) {
    color: #333;
    background: #f5f5f5;
    border-color: #ccc;
}

.case-pagination-num.active {
    color: #fff;
    background: #667eea;
    border-color: #667eea;
    cursor: default;
}

.case-pagination-btn.disabled {
    color: #bbb;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ---------- 상세 모달 (팝업) ---------- */
.case-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.case-modal-overlay.is-open {
    display: flex;
}

.case-modal {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.case-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eee;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.case-modal-close:hover {
    color: #333;
    background: #fff;
}

.case-modal-title {
    margin: 0;
    padding: 24px 24px 16px 24px;
    padding-right: 56px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.case-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.case-modal-item {
    margin: 0;
}

.case-modal-media {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: min(78vh, 820px);
    object-fit: cover;
    border-radius: 12px;
    background: #f5f5f5;
}

.case-modal-item video.case-modal-media {
    background: #000;
}

.case-modal-caption {
    margin: 8px 0 0;
    font-size: 1.04rem;
    color: #4f5561;
    line-height: 1.65;
}

/* ---------- 태블릿 (2열 유지) ---------- */
@media (max-width: 900px) {
    .case-list {
        gap: 20px;
    }
}

/* ---------- 모바일 (1열) ---------- */
@media (max-width: 600px) {
    .case-section {
        margin: 14px auto 24px;
    }

    .case-section-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .case-section-desc {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

    .case-desc-mobile-br {
        display: block;
    }

    .case-category-tabs {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        margin-bottom: 10px;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .case-category-tab {
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .case-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .case-card-image-wrap {
        aspect-ratio: 1 / 1;
    }

    .case-card-model-badge {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .case-card-title {
        font-size: 1.06rem;
        padding: 12px 14px 6px;
    }

    .case-card-caption {
        font-size: 0.96rem;
        padding: 0 14px 14px;
    }

    .case-pagination {
        margin-top: 32px;
        gap: 6px;
    }

    .case-pagination-btn,
    .case-pagination-num {
        min-width: 32px;
        height: 32px;
        padding: 0 10px;
        font-size: 0.85rem;
    }

    .case-modal-overlay {
        padding: 12px;
    }

    .case-modal-title {
        font-size: 1.15rem;
        padding: 20px 20px 12px 20px;
        padding-right: 48px;
    }

    .case-modal-content {
        padding: 0 20px 20px;
        gap: 20px;
    }

    .case-modal-caption {
        font-size: 0.98rem;
    }

    .case-modal-media {
        aspect-ratio: auto;
        height: auto;
        object-fit: contain;
        background: transparent;
    }

    .case-modal-item video.case-modal-media {
        background: transparent;
    }
}
