/* =========================================
   1. 타이포그래피 및 공통 스타일
   ========================================= */
h1,
h2.category-title {
    font-weight: 700;
    color: #333;
    word-break: keep-all; /* 단어 단위 줄바꿈 (한글 가독성) */
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

h2.category-title {
    font-size: 1.5rem;
    margin-top: 40px; /* 간격 조금 더 확보 */
    margin-bottom: 15px;
    display: flex;
    align-items: center; 
    justify-content: flex-start;
    flex-wrap: wrap; /* 모바일에서 버튼이 줄바꿈 되도록 */
    gap: 10px; /* 제목과 버튼 사이 간격 */
}

/* 설명 영역 링크 스타일 */
.page-desc a {
    color: #0078ff; /* 파란색 계열 추천 (가독성) */
    font-weight: 600;
    text-decoration: none;
}

.page-desc a:hover {
    text-decoration: underline;
}

/* =========================================
   2. 버튼 스타일
   ========================================= */
.join-btn {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background-color: #cc0000;
    border: 1px solid #cc0000;
    padding: 6px 14px;
    border-radius: 20px; /* 둥근 버튼이 더 트렌디함 */
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: 10px; /* flex gap이 지원 안되는 구형 브라우저 대비 */
    white-space: nowrap; /* 버튼 텍스트 줄바꿈 방지 */
}

.join-btn:hover {
    background-color: #990000;
    border-color: #990000;
    transform: translateY(-2px); /* 살짝 떠오르는 효과 */
}

/* =========================================
   3. 그리드 레이아웃 (Band4)
   ========================================= */
.band4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* minmax 생략 가능 */
    gap: 20px; /* grid-gap 표준 명칭은 gap */
    margin-bottom: 40px;
}

/* 개별 아이템 래퍼 */
.item {
    position: relative;
    width: 100%;
}

/* =========================================
   4. 카드(Card) 컴포넌트 스타일
   ========================================= */
.card {
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    background-color: #fff;
    border: 1px solid #eee; /* 아주 연한 테두리 추가 */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* 평소엔 은은하게 */
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

/* 썸네일 영역 (이미지 래퍼) */
.thumb-wrapper {
    position: relative; /* 배지 위치 잡기 위해 */
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.thumb-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* .card:hover .thumb-img {
    transform: scale(1.05);
} */

/* ★ [추가] 썸네일 위 '회원 전용' 배지 (선택 사항) */
/* HTML 수정 없이 CSS 가상 요소로 처리 가능 */
.card::after {
    content: "🔒 Member Only";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 2;
}

/* 텍스트 컨테이너 */
.card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

/* 카드 제목 */
.card-title {
    font-size: 1.05rem; /* 16px보다 조금 더 키움 */
    font-weight: 700;   /* 굵게 */
    color: #111;
    margin: 0 0 10px 0;
    line-height: 1.4;
    letter-spacing: -0.02em;
    
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8em; /* 2줄 높이 고정 (제목 길이 달라도 카드 높이 일정하게) */
}

/* 하단 메타 정보 */
.card-meta {
    font-size: 0.85rem;
    color: #666;
    margin-top: auto; /* 항상 바닥에 붙음 */
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================================
   5. [추가] 스켈레톤 로딩 애니메이션
   ========================================= */
.skeleton {
    cursor: wait;
}

.skeleton .thumb-img,
.skeleton .card-title,
.skeleton .card-meta {
    opacity: 0; /* 로딩 중 실제 콘텐츠 숨김 */
}

.skeleton::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 10;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =========================================
   6. 반응형 미디어 쿼리
   ========================================= */
/* 노트북/태블릿 가로 (1024px 이하) */
@media (max-width: 1024px) {
    .band4 {
        grid-template-columns: repeat(3, 1fr); /* 3열 */
    }
}

/* 태블릿 세로/대형 모바일 (768px 이하) */
@media (max-width: 768px) {
    .band4 {
        grid-template-columns: repeat(2, 1fr); /* 2열 */
        gap: 12px; /* 간격 좁힘 */
    }
    
    .card-content {
        padding: 12px; /* 패딩 줄임 */
    }
    
    .card-title {
        font-size: 0.95rem; /* 폰트 살짝 줄임 */
    }
    
    /* 제목과 버튼이 겹치지 않게 줄바꿈 처리 */
    h2.category-title {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .join-btn {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* 소형 모바일 (480px 이하) - 선택 사항 */
/* 썸네일을 크게 보여주려면 1열로 변경 */
@media (max-width: 480px) {
    /* .band4 {
        grid-template-columns: 1fr; 
    } 
    */
    /* 현재는 2열 유지하되 폰트만 조정 */
    .card-meta span:last-child {
        display: none; /* 공간 부족 시 시간 정보 숨기기 등 */
    }
}