/* ------------------- 最新消息標題 ------------------- */
.chapter-title {
    position: relative;
    background-image: url("/assets/images/News-Title/News-Title.jpg");
    background-size: cover;
    background-position: 0 60%;
    background-repeat: no-repeat;
}

.news-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 2rem 0;
    background-color: #f5f5f5;
    overflow: hidden;
}

/* ------------------- 新聞類別 ------------------- */
.news-type {
    padding: 5px;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: 500;
}

/* 公告 */
.news-type[data-news-type="1"] {
    color: #D62828;
    border: #D62828 2px solid;
}

/* 活動 */
.news-type[data-news-type="2"] {
    color: #0077B6;
    border: #0077B6 2px solid;
}

/* 新聞 */
.news-type[data-news-type="3"] {
    color: #2A9D8F;
    border: #2A9D8F 2px solid;
}

/* 產品 */
.news-type[data-news-type="4"] {
    color: #dd9e00;
    border: #dd9e00 2px solid;
}

/* ------------------- 新聞資訊欄 ------------------- */
.news-card {
    display: flex;
    align-items: flex-start;
    justify-self: center;
    position: relative;
    width: 80%;
    margin-bottom: 3rem;
    border-bottom: 5px solid #d20c01;
    background-color: rgb(255, 255, 255, 0.8);
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.news-img-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    width: 400px;
    height: 300px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    padding: 1rem 1rem;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.news-card:hover .news-img-wrap img {
    transform: scale(1.05);
    transform-origin: center;
}

.news-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-top: 2.5rem;
    width: 100%;
}

.news-article {
    display: block;
}

.news-meta {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    width: 30%;
}

.news-date {
    margin-left: auto;
    border: none;
    background-color: transparent;
    color: #cbcbcb;
    text-decoration: none;
}

.news-article .news-article-title {
    padding-top: 10px;
    color: #000;
    font-size: 1.5rem;
    font-weight: 600;
}

.news-card:hover .news-article .news-article-title {
    color: #d20c01;
    text-decoration: underline;
}

.news-article .news-description {
    margin-top: 1rem;
    margin-right: 1.3rem;
    color: #3b3b3b;
    font-size: 16px;
    font-weight: 400;
}

.news-description {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-card>span {
    position: absolute;
    right: 10px;
    bottom: 10px;
    color: #979797;
    font-size: 1.2rem;
    font-weight: 500;
}

.page {
    display: none;
    flex-wrap: wrap;
    gap: 1rem;
}

.page.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

#pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

#pagination button {
    padding: 0.4rem 0.8rem;
    border: 1px solid #333;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

#pagination button:hover {
    border: 1px solid #d20c01;
    background-color: #d20c01;
    color: #fff;
}

#pagination button.active {
    background-color: #d20c01;
    color: #fff;
    border-color: #d20c01;
    cursor: default;
}

#pagination button.prev,
#pagination button.next {
    font-weight: bold;
}

/* ------------------- 新聞內容 ------------------- */

/* 文章與側邊欄共用容器 */
.article-main {
    background-color: #fff;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

/* 標題區 */
.article-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 10px;
}

.article-header .meta {
    font-size: 0.9rem;
    color: #888;
}

/* 內文 */
.article-content p {
    line-height: 1.9;
    margin-bottom: 1.5rem;
    color: #444;
}

.article-content img {
    border-radius: 12px;
    width: 100%;
    margin: 25px 0;
}

/* 側邊欄 */
.sidebar h2 {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.sidebar ul li a {
    color: #222;
    text-decoration: none;
}

.sidebar ul li a:hover {
    text-decoration: underline;
}

/* 返回列表按鈕 */
.back-btn a {
    text-decoration: none;
    color: white;
    background: #0d6efd;
    padding: 10px 30px;
    border-radius: 50px;
    display: inline-block;
    transition: 0.2s;
}

.back-btn a:hover {
    background: #0b5ed7;
}

.news-item:hover {
    background-color: #f1f5fb;
    /* 輕微底色變化 */
}

.news-item:hover a {
    color: #d20c01;
    text-decoration: underline;
}

.news-item:last-child {
    border-bottom: none;
}

@media (max-width: 992px) {
    .article-main {
        padding: 30px 20px;
    }
}