@charset "UTF-8";

/* =========================================
   1. 기본 레이아웃 및 공통 설정
   ========================================= */
.ecommerce-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 100px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    color: #333;
}

/* 섹션 구분선 (상단 작은 타이틀) */
.section-divider {
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: #999;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top:20px;
}

/* 메인 타이틀 */
.new-section h2 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    color: #111;
}

/* =========================================
   2. 게시판 탭 네비게이션
   ========================================= */
.bbs-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 60px;
    border-bottom: 1px solid #e5e5e5;
}

.bbs-tab {
    display: inline-block;
    padding: 15px 30px;
    font-size: 16px;
    color: #888;
    text-decoration: none;
    position: relative;
    transition: all 0.2s;
    font-weight: 500;
}

.bbs-tab:hover {
    color: #333;
}

/* 활성화 된 탭 */
.bbs-tab.is-active {
    color: #111;
    font-weight: 700;
}

.bbs-tab.is-active::after {
    content: '';
    position: absolute;
    bottom: -1px; /* border-bottom 위에 겹치도록 */
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #111;
}

/* =========================================
   3. 이벤트 리스트 (그리드 스타일)
   ========================================= */
.event-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* PC 3열 */
    gap: 30px;
}

/* 카드 아이템 */
.event-card {
    display: block;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* 썸네일 영역 */
.event-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* 비율 고정 */
    overflow: hidden;
    background-color: #f5f5f5;
}

.event-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.event-card:hover .event-thumb img {
    transform: scale(1.05); /* 호버 시 확대 효과 */
}

/* 종료된 이벤트 오버레이 */
.event-ended-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    z-index: 2;
}

.ended-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ended-sub {
    font-size: 14px;
    opacity: 0.8;
}

/* 종료된 카드 스타일 (반투명 처리) */
.event-card.ended .event-info {
    opacity: 0.6;
    background-color: #f9f9f9;
}

/* 텍스트 정보 영역 */
.event-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1; /* 높이 맞춤 */
}

.event-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
}

.event-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #888;
    margin-top: auto; /* 하단 고정 */
}

.badge {
    background-color: #f0f0f0;
    color: #555;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* =========================================
   4. 일반 게시판 리스트 (PC: 테이블형)
   ========================================= */
.bbs-content-title {
    display: flex;
    background-color: #f9f9f9;
    border-top: 2px solid #222;
    border-bottom: 1px solid #ddd;
    padding: 15px 0;
    font-weight: 600;
    text-align: center;
    color: #444;
}

.bbs-content {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    text-align: center;
    font-size: 15px;
    color: #555;
    transition: background-color 0.2s;
}

.bbs-content:hover {
    background-color: #fdfdfd;
}

/* 컬럼별 너비 설정 */
.bbs-sec       { width: 80px; flex-shrink: 0; } /* 번호 */
.bbs-subject   { flex: 1; text-align: left; padding-left: 20px; font-weight: 500; } /* 제목 */
.bbs-write-name{ width: 120px; flex-shrink: 0; } /* 작성자 */
.bbs-time      { width: 120px; flex-shrink: 0; color: #888; } /* 날짜 */
.bbs-readcount { width: 80px;  flex-shrink: 0; color: #888; } /* 조회수 */

/* 제목 링크 스타일 */
.bbs-subject a {
    text-decoration: none;
    color: #333;
}
.bbs-subject a:hover {
    text-decoration: underline;
}

/* 댓글수 카운트 */
.bbs-subject span {
    color: #e74c3c;
    font-size: 13px;
    margin-left: 5px;
}

/* 게시판 내 모바일용 라벨 숨김 (PC용) */
.bbs-content .bbs-write-name span,
.bbs-content .bbs-time span,
.bbs-content .bbs-readcount span {
    display: none;
}

/* 카테고리 버튼 스타일 */
.bbs-sec button {
    background: #f0f0f0;
    border: none;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    cursor: default;
}

/* 게시물 없음 */
.bbs-empty {
    padding: 100px 0;
    text-align: center;
    color: #999;
    border-bottom: 1px solid #eee;
}

/* =========================================
   5. 페이지네이션 (Pagination)
   ========================================= */
.pagination-wrapper {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 페이지네이션 내부 스타일 (PHP에서 생성되는 HTML에 따라 조정 필요) */
.pagination a, 
.pagination strong {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s;
}

.pagination strong,
.pagination a:hover,
.pagination .active { /* active 클래스 사용하는 경우 */
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* =========================================
   6. 반응형 (Mobile)
   ========================================= */
@media (max-width: 768px) {
    .ecommerce-main {
        padding: 30px 15px 60px;
    }

    /* 탭 메뉴 스크롤 가능하게 변경 */
    .bbs-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0;
        margin-bottom: 30px;
        -webkit-overflow-scrolling: touch; /* 부드러운 스크롤 */
    }
    
    .bbs-tab {
        padding: 12px 15px;
        font-size: 14px;
    }

    /* 이벤트 그리드 2열 -> 1열 */
    .event-grid {
        grid-template-columns: repeat(1, 1fr); /* 1열 */
        gap: 25px;
    }

    /* 일반 게시판 -> 카드 리스트형으로 변환 */
    .bbs-content-title {
        display: none; /* 헤더 숨김 */
    }

    .bbs-content {
        flex-wrap: wrap;
        padding: 20px 0;
        text-align: left;
        position: relative;
        align-items: flex-start;
    }

    /* 번호/분류 */
    .bbs-sec {
        width: auto;
        margin-bottom: 8px;
    }
    
    /* 제목 (크게, 줄바꿈 허용) */
    .bbs-subject {
        width: 100%;
        padding-left: 0;
        margin-bottom: 12px;
        flex: none; /* flex-grow 해제 */
    }
    .bbs-subject a {
        font-size: 16px;
        font-weight: 600;
        display: block;
        line-height: 1.4;
    }

    /* 작성자, 날짜, 조회수 (한 줄에 배치) */
    .bbs-write-name, .bbs-time, .bbs-readcount {
        width: auto;
        font-size: 13px;
        color: #888;
        display: flex;
        align-items: center;
        margin-right: 12px;
    }

    /* 모바일용 라벨 표시 */
    .bbs-write-name span, 
    .bbs-time span, 
    .bbs-readcount span {
        display: inline-block;
        margin-right: 4px;
        color: #aaa;
    }
    
    /* 작성일은 보여주고 나머진 너무 길면 숨길 수도 있음 */
    .bbs-write-name { display: none; } /* 모바일에서 작성자 이름은 보통 숨김 */
}

@media (min-width: 769px) and (max-width: 1024px) {
    .event-grid {
        grid-template-columns: repeat(2, 1fr); /* 태블릿 2열 */
    }
}