/* =======================
   News Page (반응형 버전)
   ======================= */

:root {
    --news-red: #e11d2e;
    --news-gray: #555;
    --news-black: #111;
}

/* 기본 래퍼 */
.news-wrap {
    width: min(1200px, 92%);
    margin: clamp(4rem, 6vw, 8rem) auto;
    text-align: center;
    font-family: "Noto Sans KR", system-ui, sans-serif;
}

/* 상단 영역 */
.news-header {
    margin-bottom: clamp(2rem, 4vw, 3rem);
}
.news-header .highlight {
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    font-weight: 800;
    color: var(--news-black);
    margin-bottom: 0.5rem;
}
.news-header p {
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
    color: var(--news-gray);
    margin-bottom: 1rem;
    line-height: 1.6;
}
.news-logo {
    width: clamp(120px, 10vw, 160px);
    margin: 0 auto;
    display: block;
}

/* =======================
   검색 영역
   ======================= */
.news-search {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(0.4rem, 1vw, 0.6rem);
    margin: clamp(2rem, 4vw, 2.5rem) auto;
    flex-wrap: wrap;
}
.news-search input {
    width: clamp(200px, 30vw, 280px);
    height: clamp(34px, 4vw, 38px);
    border: 1px solid #ccc;
    padding: 0 clamp(0.6rem, 1vw, 0.8rem);
    border-radius: 4px;
    font-size: clamp(0.85rem, 1.3vw, 0.9rem);
}
.news-search button {
    background: var(--news-red);
    color: #fff;
    border: none;
    height: clamp(34px, 4vw, 38px);
    padding: 0 clamp(1rem, 2vw, 1.4rem);
    font-size: clamp(0.85rem, 1.3vw, 0.9rem);
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s ease;
}
.news-search button:hover {
    background: #c80c1f;
}

/* =======================
   테이블
   ======================= */
.news-table-wrap {
    overflow-x: auto;
    margin-top: clamp(1.5rem, 3vw, 2rem);
}
.news-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
    min-width: unset;
    table-layout: fixed;
}
.news-table th {
    background: #f4f4f4;
    font-weight: 700;
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    border-top: 2px solid #aaa;
    border-bottom: 1px solid #ddd;
    color: #000;
}
.news-table td {
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    border-bottom: 1px solid #eee;
    color: #444;
}
.news-table tr:hover td {
    background: #fafafa;
}

/* 열 비율 */
.news-table th:nth-child(1),
.news-table td:nth-child(1) {
    width: 10%;
}
.news-table th:nth-child(2),
.news-table td:nth-child(2) {
    width: 60%;
    text-align: center;
}
.news-table th:nth-child(3),
.news-table td:nth-child(3) {
    width: 10%;
}
.news-table th:nth-child(4),
.news-table td:nth-child(4) {
    width: 10%;
}
.news-table th:nth-child(5),
.news-table td:nth-child(5) {
    width: 10%;
    color: var(--news-black);
    font-weight: 600;
}

/* =======================
   페이지네이션
   ======================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: clamp(2rem, 4vw, 2.5rem);
    gap: clamp(0.4rem, 1vw, 0.6rem);
    flex-wrap: wrap;
}
.pagination a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: clamp(26px, 4vw, 30px);
    height: clamp(26px, 4vw, 30px);
    border-radius: 50%;
    font-size: clamp(0.8rem, 1.3vw, 0.9rem);
    color: #333;
    text-decoration: none;
    border: 1px solid transparent;
}
.pagination a.active {
    background: var(--news-red);
    color: #fff;
    border: 1px solid var(--news-red);
}
.pagination a:hover {
    border: 1px solid var(--news-red);
    color: var(--news-red);
}
.pagination img {
    width: clamp(16px, 2.5vw, 20px);
    height: clamp(16px, 2.5vw, 20px);
}

/* =======================
   반응형
   ======================= */

/* 1200px 이하 - 작성자 숨김 */
@media (max-width: 1200px) {
    .news-table th:nth-child(4),
    .news-table td:nth-child(4) {
        display: none;
    }
}

/* 700px 이하 - 날짜 숨김 */
@media (max-width: 700px) {
    .news-table {
        min-width: 100%;
    }

    .news-table th:nth-child(3),
    .news-table td:nth-child(3) {
        display: none;
    }
    .news-search {
        flex-direction: column;
        align-items: center;
    }
    .news-search input {
        width: 90%;
    }
    .news-search button {
        width: 90%;
        height: 38px;
    }
}

/* 500px 이하 - 번호 숨김 */
@media (max-width: 500px) {
    .news-table th:nth-child(1),
    .news-table td:nth-child(1) {
        display: none;
    }
    .news-table th:nth-child(2),
    .news-table td:nth-child(2) {
        width: 25%;
        text-align: center;
    }

    .news-search {
        flex-direction: column;
        gap: 0.8rem;
    }

    .news-search input {
        width: 90%;
    }

    .news-table {
        font-size: 0.85rem;
        min-width: auto;
    }
}
