/* 首頁與最新消息共用的公告元件樣式。 */

.news-item { flex-wrap: wrap; }
.news-title-link { display: block; flex: 1; min-width: 180px; color: inherit; text-decoration: none; }
.news-title-link:hover { text-decoration: underline; }
.news-social { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; margin-top: 10px; white-space: normal; }
.news-social .news-social-button {
    box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
    width: auto; min-width: 64px; min-height: 40px; margin: 0; padding: 8px 13px;
    border: 1px solid #cdd8e2; border-radius: 20px; background: #fff; color: #17466d;
    font: inherit; font-size: .9rem; line-height: 1.3; text-decoration: none; cursor: pointer;
}
.news-social .news-social-button:hover { background: #edf5fc; }
.news-social .news-social-button[aria-pressed="true"] { color: #b7234e; border-color: #edb5c5; background: #fff0f4; }
.news-social-button:focus-visible, .news-title-link:focus-visible { outline: 3px solid #0067b1; outline-offset: 3px; }
.news-social [hidden] { display: none !important; }
.news-share-status { width: 100%; color: #526579; font-size: .85rem; }
.news-social-summary { color: #526579; font-size: .9rem; gap: 18px; }
.news-stat { display: inline-flex; align-items: center; gap: 5px; }
.news-social-button:disabled { cursor: wait; opacity: .65; }
.news-link-error { color: #a52834; text-align: center; }
.news-pagination { flex-wrap: wrap; gap: 8px; }
.news-pagination .news-page-btn.news-page-number { min-width: 40px; }
.news-pagination .news-page-number.is-active { background: #005a9c; color: #fff; border-color: #005a9c; }

        .news-rich-text { line-height: 1.8; overflow-wrap: anywhere; }
        .news-carousel { position: relative; margin-top: 20px; border-radius: 12px; background: #f2f4f7; overflow: hidden; }
        .news-carousel-viewport { position: relative; overflow: hidden; touch-action: pan-y; }
        .news-carousel-track { display: flex; transition: transform .42s ease; will-change: transform; }
        .news-carousel-slide { flex: 0 0 100%; min-width: 0; margin: 0; display: grid; align-content: center; }
        .news-carousel-slide a { display: grid; place-items: center; min-height: 220px; background: #f2f4f7; }
        .news-carousel-slide img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; }
        .news-carousel-caption { margin: 0; padding: 11px 16px 13px; background: #fff; color: #3f4750; line-height: 1.65; text-align: center; border-top: 1px solid #e3e7eb; }
        .news-carousel-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 11px 12px; background: #fff; border-top: 1px solid #e3e7eb; }
        .news-link-item { position: relative; }
        .news-direct-link {
            position: absolute !important;
            inset: 0 !important;
            z-index: 3 !important;
            display: block !important;
            width: auto !important;
            height: auto !important;
            min-width: 0 !important;
            min-height: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
            border: 0 !important;
            border-radius: inherit !important;
            background: transparent !important;
            box-shadow: none !important;
            color: transparent !important;
            font-size: 0 !important;
            text-decoration: none !important;
        }
        .news-direct-link:focus-visible { outline: 3px solid #0067b1 !important; outline-offset: 3px; }
        .news-pin-mark { margin-right: 5px; }
        .news-file-list { display: grid; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #e3e7eb; }
        .news-file-heading { margin: 0; font-weight: 900; }
        .news-file-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #dce3e9; border-radius: 8px; background: #f8fafc; color: #005a9c; text-decoration: none; overflow-wrap: anywhere; }
        .news-page-indicator { min-width: 72px; text-align: center; font-weight: 800; }
        @media (max-width: 600px) { .news-carousel-slide a { min-height: 160px; } }
        @media (prefers-reduced-motion: reduce) { .news-carousel-track { transition: none; } }

/* 按鈕完整重設，防止共用 button 的寬度、內距或 transform 覆蓋。 */
.news-carousel .news-carousel-viewport > button.news-carousel-control {
    all: unset;
    box-sizing: border-box !important;
    position: absolute !important; top: 50% !important; bottom: auto !important;
    transform: translateY(-50%) !important;
    width: 42px !important; min-width: 42px !important; max-width: 42px !important;
    height: 42px !important; min-height: 42px !important; max-height: 42px !important;
    aspect-ratio: 1 / 1 !important; border-radius: 50% !important;
    border: 0 !important; padding: 0 !important; margin: 0 !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    flex: 0 0 42px !important; overflow: hidden !important;
    background: rgba(0, 21, 41, .78) !important; color: #fff !important;
    cursor: pointer !important; z-index: 2 !important;
    line-height: 1 !important; appearance: none !important;
}
.news-carousel .news-carousel-viewport > button.news-carousel-prev { left: 12px !important; right: auto !important; }
.news-carousel .news-carousel-viewport > button.news-carousel-next { right: 12px !important; left: auto !important; }
.news-carousel button.news-carousel-control svg { display: block; width: 22px; height: 22px; pointer-events: none; }
.news-carousel .news-carousel-viewport > button.news-carousel-control:hover { background: #0067b1 !important; }
.news-carousel .news-carousel-viewport > button.news-carousel-control:focus-visible { outline: 3px solid #ffcc33 !important; outline-offset: -3px !important; }
.news-carousel .news-carousel-dots > button.news-carousel-dot {
    all: unset; box-sizing: border-box !important; display: block !important;
    width: 10px !important; min-width: 10px !important; max-width: 10px !important;
    height: 10px !important; min-height: 10px !important; max-height: 10px !important;
    border: 0 !important; padding: 0 !important; margin: 0 !important;
    border-radius: 50% !important; background: #b5bec7 !important; cursor: pointer !important;
}
.news-carousel .news-carousel-dots > button.news-carousel-dot.is-active { background: #0067b1 !important; transform: scale(1.25); }
.news-carousel .news-carousel-dots > button.news-carousel-dot:focus-visible { outline: 2px solid #0067b1; outline-offset: 3px; }
.news-carousel-caption[hidden] { display: none !important; }
.news-pagination .news-page-btn {
    box-sizing: border-box; width: auto !important; min-width: 88px;
    height: 40px; min-height: 40px; padding: 0 12px !important;
    display: inline-flex; align-items: center; justify-content: center;
    white-space: nowrap; line-height: 1; flex: 0 0 auto;
}
@media (max-width: 600px) {
    .news-carousel .news-carousel-viewport > button.news-carousel-control {
        width: 36px !important; min-width: 36px !important; max-width: 36px !important;
        height: 36px !important; min-height: 36px !important; max-height: 36px !important;
        flex-basis: 36px !important;
    }
    .news-carousel .news-carousel-viewport > button.news-carousel-prev { left: 7px !important; }
    .news-carousel .news-carousel-viewport > button.news-carousel-next { right: 7px !important; }
}
