@charset "utf-8";

/* ============================================
   기본 설정 및 모바일 스타일 (Mobile-First)
   - width: 100%를 기본으로 사용하며, PC/태블릿 스타일은 미디어 쿼리 안에서 덮어씀.
   ============================================ */

/* 1. 컨테이너 (PC에서 max-width: 1200px 유지) */
.container { 
    width: 100%; 
    max-width: 1200px; /* PC에서 1200px 제한 */
    margin: 45px auto 0; 
    padding: 0 1rem; 
    background: #f5f5f5; 
    min-height: 100vh; 
    border-radius: 6px; 
    box-shadow: 0 0 5px rgba(0,0,0,0.1); 
    overflow: hidden; 
}

/* 2. 글쓰기 제목 */
.list-write { 
    width: 100%; 
    font-size: 1.5rem; /* 모바일 기준 */
    margin-bottom: 1rem; 
    text-align: center; 
}

/* 3. 검색 폼 (모바일: 세로 100%로 쌓기) */
.search-form-board { 
    display: flex; 
    flex-direction: column; /* 모바일에서는 세로로 쌓기 (수정) */
    width: 100%; 
    gap: 10px; /* 세로 간격 조정 (수정) */
    margin: 0 auto 1rem; 
}

/* 4. 검색 입력창, 카테고리, 버튼 (모바일: 100% 너비) */
.search-input { 
    width: 100%; /* 모바일에서 100% (수정) */
    padding: 0.5rem; 
    font-size: 1rem; 
    box-sizing: border-box; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
}
.search-category{ 
    width: 100%; /* 모바일에서 100% (수정) */
    padding: 0.5rem; 
    font-size: 1rem; 
    box-sizing: border-box; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
}
.search-button { 
    width: 100%; /* 모바일에서 100% (수정) */
    padding: 0.5rem; 
    font-size: 1rem; 
    background: #28a745; 
    color: #fff; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    text-align: center; 
}


/* 5. 기타 요소 (모바일 기준) */
.select-all { 
    display: flex; 
    justify-content: flex-start; 
    align-items: center; 
    width: 100%; 
    margin: 0 auto 1rem; 
}

.post-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.post-item { 
    display: grid; 
    grid-template-columns: 90px 1fr; 
    gap: 12px; 
    padding: 5px; 
    align-items: center; 
    border-bottom: 1px solid #ddd; 
}

.thumb { 
    width: 90px; 
    height: 63px; 
    object-fit: cover; 
    border-radius: 4px; 
}

.post-summary { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

.post-title { 
    font-size: 1.2rem; 
    font-weight: bold; 
    margin-bottom: 6px; 
    color: #111; 
}

.post-title a { 
    color: #111; 
    text-decoration: none; 
}

.post-meta { 
    font-size: 0.85rem; 
    display: flex; 
    flex-wrap: wrap; 
    align-items: center; 
    gap: 5px; 
    color: #555; 
}

.info { 
    color: #666; 
}

.vote-btn { 
    background: none; 
    border: none; 
    cursor: pointer; 
    font-size: 0.9rem; 
    color: #444; 
}

.like-count { 
    font-weight: bold; 
}

.write-btn { 
    display: block; 
    width: 90%; 
    max-width: 400px; 
    margin: 1rem auto; 
    padding: 0.75rem; 
    font-size: 1rem; 
    background: #007bff; 
    color: #fff; 
    text-decoration: none; 
    text-align: center; 
    border-radius: 5px; 
}

.pagination { 
    margin: 1rem 0; 
    text-align: center; 
}

.pagination a, .pagination span { 
    display: inline-block; 
    padding: 0.4rem 0.7rem; 
    margin: 0 0.2rem; 
    border: 1px solid #ccc; 
    border-radius: 3px; 
    text-decoration: none; 
    color: #333; 
}

.pagination .active { 
    background: #007bff; 
    color: #fff; 
    border-color: #007bff; 
}


/* ============================================
   PC/태블릿 레이아웃 (481px 이상)
   - 모바일 스타일을 덮어쓰고 PC 레이아웃으로 전환
   ============================================ */
@media (min-width: 481px) {
    /* (추가) 검색 폼을 다시 가로 정렬로 변경 */
    .search-form-board {
        flex-direction: row; 
        gap: 2%; /* 기존의 가로 간격 복구 */
        align-items: center;
    }
    
    /* 검색 폼 */
    .search-input { 
        flex: 1; /* PC에서 폭 넓게 사용 */
        width: auto; /* 모바일의 width: 100% 덮어쓰기 */
        margin-right: 0.5rem; 
    }
    .search-category {
        width: 27%; /* PC에서 적절한 너비 설정 */
    }
    .search-button { 
        flex: 0 0 120px; /* PC에서 버튼 너비 고정 */
        width: auto; /* 모바일의 width: 100% 덮어쓰기 */
    }

    /* 컨테이너 및 제목 */
    .main-content { 
        max-width: 1000px; 
        margin: 0 auto; 
    }
    .list-write { 
        font-size: 1.75rem; /* PC/태블릿 폰트 크기 */
        margin-bottom: 1.5rem; 
    }

    /* 리스트 아이템 레이아웃 */
    .post-item { 
        grid-template-columns: 150px 1fr; /* PC/태블릿 썸네일 크기 */
        gap: 12px;
        align-items: center;
        padding: 1.5rem 2.5rem; 
    }
    
    /* 썸네일 이미지 */
    .thumb { 
        width: 150px; /* PC/태블릿 썸네일 너비 */
        height: 100px; /* PC/태블릿 썸네일 높이 */
    }
    
    /* 포스트 요약 정보 */
    .post-summary { 
        padding: 0 1rem; 
    }
    
    /* 제목 */
    .post-title a { 
        font-size: 1.2rem; 
    }

    /* 메타 정보 */
    .post-meta { 
        font-size: 0.95rem; 
    }
    
    /* 투표 버튼 */
    .vote-btn { 
        margin-left: auto; 
    }
}