/* ==============================
   公告區域基本設定
============================== */
.news-body {
    width: 100%;
    margin: 20px 0;
    font-family: Arial, "Noto Sans TC", sans-serif;
    font-size: 16px;
    color: #333;
}

/* ==============================
   標題區域
============================== */

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    margin-bottom: 8px;
}

    .news-header h1,
    .news-header h2 {
        font-size: 22px;
        font-weight: bold;
    }

    .news-header a {
        font-size: 16px;
        color: #2673b8;
        text-decoration: none;
    }

        .news-header a:hover {
            text-decoration: underline;
        }

/* ==============================
   公告列表
============================== */

.news-list {
    width: 100%;
}

.news-item {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 110px;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 6px 8px;
    border-bottom: 1px solid #ddd;
    font-size: 16px;
    line-height: 1.5;
}

/* 公告類別 */

.news-category {
    display: inline-block;
    text-align: center;
    padding: 3px 8px;
    font-size: 16px;
    line-height: 1.5;
    background: #edf3f8;
    color: #28618a;
    border-radius: 4px;
}

/* 公告主旨 */

.news-subject {
    min-width: 0;
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

    .news-subject a {
        color: #333;
        text-decoration: none;
    }

        .news-subject a:hover {
            color: #2673b8;
            text-decoration: underline;
        }

/* 公告日期 */

.news-date {
    text-align: right;
    font-size: 16px;
    line-height: 1.5;
    color: #777;
    text-decoration: none;
    white-space: nowrap;
}

/* ==============================
   分頁
============================== */

.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}

    .pagination button {
        padding: 7px 13px;
        font-family: inherit;
        font-size: 16px;
        border: 1px solid #ddd;
        background: #fff;
        cursor: pointer;
        border-radius: 4px;
    }

        .pagination button:hover:not(:disabled) {
            background: #edf3f8;
        }

        .pagination button.active {
            background: #28618a;
            color: #fff;
            border-color: #28618a;
        }

        .pagination button:disabled {
            color: #aaa;
            cursor: not-allowed;
        }

/* ==============================
   手機版
============================== */

@media (max-width: 600px) {

    .news-item {
        grid-template-columns: 85px minmax(0, 1fr);
        gap: 6px 10px;
        padding: 8px 5px;
    }

    .news-date {
        grid-column: 2;
        text-align: left;
    }

    .news-category {
        font-size: 15px;
    }

    .news-header h1,
    .news-header h2 {
        font-size: 20px;
    }
}

/* 日期位置修正：維持原本格線，不改變排版 */
.news-item {
    align-items: center;
}

    .news-item .news-date {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
        justify-self: stretch;
        align-self: center;
        text-decoration: none !important;
        border: none !important;
        box-shadow: none !important;
        white-space: nowrap;
        line-height: 1.5;
    }

        /* 日期若被全域連結樣式影響，也取消底線 */
        .news-item .news-date a {
            text-decoration: none !important;
            border-bottom: none !important;
        }

    /* ==============================
   置頂公告
============================== */

    .news-item.is-pinned {
        background-color: #fff0f0;
    }