/**
 * 最新消息公開頁面 - 卡片式設計
 * 訪客/學員瀏覽用
 */

/* 減少橫幅與內容之間的空白 */
.rbt-team-area.rbt-section-gap {
    padding-top: 30px;
}

/* ========================================
   左側選單（Sidebar）— 統一卡片
   ======================================== */

/* 整個側欄為一張白色卡片 */
.news-sidebar {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.04);
    padding: 20px 18px;
}

/* 個別 widget — 移除框框，改用底線分隔 */
.news-sidebar .rbt-single-widget {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    margin-bottom: 0;
    border: none;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.news-sidebar .rbt-single-widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Widget 標題 — 簡潔小字 */
.news-sidebar .rbt-widget-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: none;
    display: block;
    gap: 0;
}

.news-sidebar .rbt-widget-title::before {
    display: none;
}

/* 搜尋框 */
.news-sidebar .rbt-search-style-1 {
    position: relative;
}

.news-sidebar .rbt-search-style-1 input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #f8fafc;
}

.news-sidebar .rbt-search-style-1 input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.news-sidebar .rbt-search-style-1 .search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 16px;
    padding: 4px;
}

/* Checkbox / Radio 列表 */
.news-sidebar .organizer-list-check,
.news-sidebar .category-type-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-sidebar .organizer-list-check li,
.news-sidebar .category-type-list li {
    padding: 3px 0;
}

.news-sidebar .organizer-list-check .form-check,
.news-sidebar .category-type-list .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.news-sidebar .organizer-list-check .form-check:hover,
.news-sidebar .category-type-list .form-check:hover {
    background: #f1f5f9;
}

.news-sidebar .organizer-list-check label,
.news-sidebar .category-type-list label {
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    margin: 0;
    user-select: none;
    transition: color 0.2s;
}

.news-sidebar .organizer-list-check label:hover,
.news-sidebar .category-type-list label:hover {
    color: #4f46e5;
}

.news-sidebar .organizer-list-check .form-check-input,
.news-sidebar .category-type-list .form-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #4f46e5;
}

/* 顯示更多按鈕 */
.news-sidebar .rbt-show-more-btn {
    font-size: 13px;
    color: #4f46e5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 0;
    font-weight: 500;
    transition: opacity 0.2s;
}

.news-sidebar .rbt-show-more-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ========================================
   頂部工具列（結果數 + 排序切換）
   ======================================== */
.news-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.news-toolbar__count {
    font-size: 1.35rem;
    color: var(--color-body, #6b7280);
}

.news-toolbar__count strong {
    color: var(--color-heading, #1f2937);
    font-weight: 700;
}

.news-toolbar__sort {
    display: flex;
    gap: 0;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
}

.news-toolbar__sort-btn {
    padding: 0.6rem 1.35rem;
    font-size: 1.2rem;
    border: none;
    background: var(--color-white, #fff);
    color: var(--color-body, #6b7280);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.news-toolbar__sort-btn:hover {
    background: var(--color-gray-light, #f3f4f6);
}

.news-toolbar__sort-btn.active {
    background: var(--color-primary, #2563eb);
    color: #fff;
}

/* ========================================
   新聞卡片列表
   ======================================== */
.news-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ========================================
   單一新聞卡片
   ======================================== */
.news-card {
    display: flex;
    background: var(--color-white, #fff);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    border: 1px solid var(--color-border, #e5e7eb);
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary-opacity, rgba(37, 99, 235, 0.25));
}

/* 圖片區 */
.news-card__image {
    flex-shrink: 0;
    width: 260px;
    min-height: 180px;
    background-size: cover;
    background-position: center;
    background-color: var(--color-gray-light, #f3f4f6);
    position: relative;
}

.news-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.news-card__image--placeholder i {
    font-size: 3rem;
    color: rgba(99, 102, 241, 0.35);
}

/* Badge 區（置頂/重要）*/
.news-card__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.news-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.3;
    backdrop-filter: blur(4px);
}

.news-card__badge--pinned {
    background: rgba(245, 158, 11, 0.92);
    color: #fff;
}

.news-card__badge--important {
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
}

/* 內容區 */
.news-card__body {
    flex: 1;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
    min-width: 0;
}

.news-card__category {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 20px;
    width: fit-content;
    letter-spacing: 0.3px;
}

.news-card__title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-heading, #1f2937);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
    transition: color 0.2s ease;
}

.news-card:hover .news-card__title {
    color: var(--color-primary, #2563eb);
}

.news-card__summary {
    font-size: 1.35rem;
    color: var(--color-body, #6b7280);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.7;
}

.news-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 1.2rem;
    color: var(--color-body, #9ca3af);
    margin-top: auto;
    padding-top: 0.25rem;
}

.news-card__meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-card__meta-item i {
    font-size: 0.9rem;
}

/* 分隔點 */
.news-card__meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #d1d5db;
}

/* 附件標示 */
.news-card__meta-item--attach {
    color: var(--color-primary, #2563eb);
    font-weight: 500;
}

/* ========================================
   載入更多按鈕
   ======================================== */
.news-load-more {
    text-align: center;
    margin-top: 2rem;
}

.news-load-more__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.7rem 2rem;
    border: 2px solid var(--color-primary, #2563eb);
    background: transparent;
    color: var(--color-primary, #2563eb);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.news-load-more__btn:hover {
    background: var(--color-primary, #2563eb);
    color: #fff;
}

.news-load-more__btn i {
    transition: transform 0.3s ease;
}

.news-load-more__btn:hover i {
    transform: translateY(2px);
}

/* ========================================
   空結果提示
   ======================================== */
.news-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-body, #9ca3af);
}

.news-empty__icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.news-empty__text {
    font-size: 1.05rem;
    margin: 0;
}

/* ========================================
   骨架載入動畫
   ======================================== */
.news-skeleton {
    display: flex;
    background: var(--color-white, #fff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--color-border, #e5e7eb);
}

.news-skeleton__image {
    flex-shrink: 0;
    width: 260px;
    min-height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.news-skeleton__body {
    flex: 1;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.news-skeleton__line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.news-skeleton__line--title {
    height: 20px;
    width: 70%;
}

.news-skeleton__line--text {
    width: 90%;
}

.news-skeleton__line--meta {
    width: 50%;
    margin-top: auto;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   RWD - 平板 (≤991px)
   ======================================== */
@media (max-width: 991px) {
    .news-card__image {
        width: 200px;
        min-height: 150px;
    }

    .news-skeleton__image {
        width: 200px;
        min-height: 150px;
    }

    .news-card__title {
        font-size: 1.1rem;
    }

    .news-card__summary {
        font-size: 0.9rem;
    }
}

/* ========================================
   RWD - 手機 (≤767px)
   ======================================== */
@media (max-width: 767px) {
    .news-card {
        flex-direction: column;
    }

    .news-card__image {
        width: 100%;
        min-height: 180px;
        max-height: 220px;
    }

    .news-card__body {
        padding: 1rem 1.15rem;
    }

    .news-card__title {
        font-size: 1.05rem;
    }

    .news-card__summary {
        font-size: 0.88rem;
        -webkit-line-clamp: 2;
    }

    .news-skeleton {
        flex-direction: column;
    }

    .news-skeleton__image {
        width: 100%;
        min-height: 160px;
    }

    .news-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    /* 手機版側邊欄 */
    .news-sidebar {
        padding: 16px 14px;
        border-radius: 12px;
    }
}

/* ========================================
   RWD - 小手機 (≤575px)
   ======================================== */
@media (max-width: 575px) {
    .news-card__image {
        min-height: 150px;
    }

    .news-card__meta {
        gap: 0.5rem;
    }

    .news-card__meta-dot {
        display: none;
    }
}