@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    --main-green: #1b6331;
    --gray-border: #ddd;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* 전체 구조 */
.news-page {
    font-family: 'Pretendard', 'Jost', sans-serif;
    background: #fff;
    color: #111;
    letter-spacing: -0.02em;
    text-align: center;
    overflow-x: hidden;
}

/* 헤더 */
.news-header {
    text-align: center;
}

.news-header .top-title {
    font-size: clamp(1.4rem, 2.8vw, 1.8rem);
    font-weight: 400;
    color: #222;
    margin-bottom: 0.6rem;
}

.news-header .top-sub {
    font-size: clamp(0.85rem, 1.4vw, 0.95rem);
    color: #777;
    margin-bottom: 1.2rem;
}

.news-header .main-title {
    font-family: 'Jost', sans-serif;
    color: var(--main-green);
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 700;
    margin-bottom: 4rem;
}

/* 검색 */
.news-search {
    margin: 3rem auto;
    text-align: center;
}

.search-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    width: 280px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--gray-border);
    border-radius: 3px;
    font-size: 0.9rem;
}

.search-btn {
    background: #555;
    color: #fff;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: 0.3s ease;
}

.search-btn:hover {
    background: var(--main-green);
}

/* 테이블 */
.news-table-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem 6rem;
    box-sizing: border-box;
}

.news-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
    word-break: keep-all;
}

.news-table th,
.news-table td {
    text-align: center;
    padding: 0.9rem 0.5rem;
    vertical-align: middle;
}

.news-table th {
    background: #f6f6f6;
    border-top: 2px solid #333;
    border-bottom: 1px solid var(--gray-border);
    padding: 0.9rem 0.5rem;
    color: #111;
    font-weight: 600;
}

.news-table td {
    border-bottom: 1px solid var(--gray-border);
    padding: 0.9rem 0.5rem;
    text-align: center;
    color: #333;
}

.news-table td.title a {
    display: inline-block;
    white-space: normal;
    word-break: break-word;
    line-height: 1.6;
}

.news-table td.title a:hover {
    color: var(--main-green);
}

.news-table tr:hover {
    background: #fafafa;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 2rem;
    align-items: center;
}

.pagination a {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    color: #555;
    text-decoration: none;
    border-radius: 3px;
    transition: 0.2s ease;
}

.pagination a:hover {
    color: var(--main-green);
}

.pagination a.active {
    background: var(--main-green);
    color: #fff;
}

/* ===============================
   반응형 스타일
=============================== */

/* --- 1024px 이하 : 전체 폰트/간격 축소 --- */
@media (max-width: 1024px) {
    .news-table-section {
        max-width: 95%;
        padding: 0 1rem 5rem;
    }

    .news-table th,
    .news-table td {
        font-size: 0.85rem;
        padding: 0.7rem 0.3rem;
    }

    .search-input {
        width: 240px;
    }
}

/* --- 900px 이하 : padding 줄이고 중앙정렬 강화 --- */
@media (max-width: 900px) {

    .news-header .main-title {
        font-size: clamp(1.3rem, 2vw, 1.6rem);
    }

    .news-table-section {
        padding: 0 0.8rem 5rem;
    }

    .news-table th,
    .news-table td {
        font-size: 0.85rem;
        padding: 0.7rem 0.3rem;
    }
}

/* --- 768px 이하 : 작성자 숨김 (3번째 열) --- */
@media (max-width: 768px) {
    .search-input {
        width: 65%;
    }

    .news-table th:nth-child(3),
    .news-table td:nth-child(3) {
        display: none;
    }

    .news-table th,
    .news-table td {
        font-size: 0.8rem;
    }

    .pagination a {
        font-size: 0.85rem;
    }
}

/* --- 600px 이하 : 번호 숨김 (1번째 열) --- */
@media (max-width: 600px) {
    .news-table th:nth-child(1),
    .news-table td:nth-child(1) {
        display: none;
    }

    .search-form {
        flex-direction: column;
        gap: 0.6rem;
    }

    .search-input {
        width: 80%;
    }

    .search-btn {
        width: 80%;
        font-size: 0.85rem;
    }

    .news-table {
        font-size: 0.85rem;
    }
}

/* --- 480px 이하 : 테이블 가로 스크롤 허용 --- */
@media (max-width: 480px) {
    .news-table-section {
        padding: 0 0.5rem 3rem;
    }

    .news-table {
        font-size: 0.8rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .pagination a {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }
}

