.news-page {
    --kto-navy: #4a5677;
    --kto-navy-dark: #003568;
    --kto-navy-hover: #474e63;
    --kto-red: #d22a49;
    --kto-head-bg: #f4f4f4;
    --kto-row-line: #ddd;
    --kto-col-text: #555;
}

.news-page ol,
.news-page ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-page .content-wrap {
    padding-top: 50px;
}

@media (max-width: 768px) {
    .news-page .content-wrap {
        padding-top: 0px;
    }
}

.board-wrap {
    margin-top: 40px;
}

.board-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 30px;
    font-size: 0.9rem;
    color: #666;
}

.board-list-head .total-text {
    font-size: 18px;
    font-weight: 700;
    color: red;
}

.btn-find-more {
    display: inline-block;
    padding: 13px 22px;
    border: 1px solid #4A5677;
    border-radius: 4px;
    color: #4A5677;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.btn-find-more:hover {
    background-color: #4A5677;
    color: #fff;
}

@media (max-width: 640px) {
    .board-list-head {
        flex-wrap: wrap;
        gap: 12px;
    }
}

.news-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.news-search {
    flex: 1 1 240px;
    min-width: 0;
    height: 48px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
}

.news-search:focus {
    outline: none;
    border-color: var(--accent);
}

.news-sort {
    flex: 0 0 auto;
    height: 48px;
    padding: 0 40px 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23444444' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px 8px;
}

.news-search-btn {
    flex: 0 0 auto;
    height: 48px;
    padding: 0 28px;
    border: 0;
    border-radius: 8px;
    background-color: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.news-search-btn:hover {
    opacity: 0.9;
}

@media (max-width: 640px) {
    .news-toolbar {
        flex-direction: column;
    }

    .news-search,
    .news-sort,
    .news-search-btn {
        flex: 1 1 auto;
        width: 100%;
    }
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 24px;
}

@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px 20px;
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 16px;
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
    }
}

.news-grid .no-data {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    padding: 60px 0;
}

.news-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.news-cover {
    display: block;
    aspect-ratio: 3 / 2;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f4f4f4;
}

.news-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.news-card:hover .news-cover img {
    transform: scale(1.03);
}

.news-title {
    display: -webkit-box;
    margin: 16px 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    min-height: calc(1.4em * 2);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.news-card:hover .news-title {
    color: var(--kto-navy);
}

.news-date {
    font-size: 14px;
    color: var(--kto-col-text);
}

.board-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.board-list.list-head {
    background-color: var(--kto-head-bg);
    border-top: 2px solid var(--kto-navy-dark);
}

.board-list.list-head strong {
    font-size: 18px;
}

.board-list.list-head .col.col-number {
    padding: 4px 10px;
}

.board-list.list-body {
    border-top: 2px solid var(--kto-navy-dark);
}

.board-list .board-data-group {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 10px;
    border-bottom: 1px solid var(--kto-row-line);
}

.board-list .board-data-group .col.col-number {
    padding: 4px 10px;
}

.board-list.list-head .board-data-group {
    border-bottom: none;
    color: #191919;
    font-weight: 500;
}

.board-list .col-number {
    flex: 0 0 80px;
    text-align: center;
    color: var(--kto-col-text);
}

.board-list .col-subject {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

.board-list.list-body .col-subject {
    text-align: left;
}

.board-list .col-date {
    flex: 0 0 110px;
    text-align: center;
    color: var(--kto-col-text);
    font-size: 0.9rem;
}

.board-data-subject .text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-data-subject a {
    color: #333;
    text-decoration: none;
}

.board-data-subject a:hover {
    color: var(--kto-navy);
}

.board-list .no-data .board-data-group {
    justify-content: center;
    color: var(--muted);
    padding: 48px 0;
    border-bottom: none;
}

.news-detail-media {
    display: none;
}

.news-detail-excerpt {
    display: none;
}

.paginate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 40px 0 0;
}

.paginate a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    color: #444;
    text-decoration: none;
    font-size: 0.95rem;
}

.paginate a:hover {
    color: #222;
    background-color: #f4f4f4;
}

.paginate a.active {
    background-color: var(--kto-navy);
    color: #fff;
    font-weight: 600;
}

.paginate a.com {
    position: relative;
    color: transparent;
}

.paginate a.com::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-top: 2px solid #444;
    border-right: 2px solid #444;
}

.paginate a.com.prev::before {
    transform: translate(-30%, -50%) rotate(-135deg);
}

.paginate a.com.next::before {
    transform: translate(-70%, -50%) rotate(45deg);
}

.paginate a.com.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.news-detail-page .content-body {
    margin-top: 24px;
}

.news-detail-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 16px 0;
    margin-bottom: 24px;
    border-top: 2px solid var(--kto-navy-dark);
    border-bottom: 1px solid var(--kto-row-line);
}

.news-detail-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #222;
    line-height: 1.5;
}

.news-detail-date {
    flex-shrink: 0;
    color: var(--kto-col-text);
    font-size: 0.95rem;
}

.news-detail-media {
    margin: 0 0 24px;
}

.news-detail-media img {
    width: 100%;
    display: block;
}

.news-detail-excerpt {
    color: var(--kto-col-text);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0 0 24px;
}

.news-detail-content {
    max-width: 960px;
    margin: 0 auto;
    line-height: 1.75;
    font-size: 1.05rem;
    color: #333;
    padding: 0 50px;
}

.news-detail-content img {
    max-width: 100%;
    height: auto;
}

/* Rich Editor (Froala) căn ảnh bằng class riêng (fr-fil/fr-fir cho trái/phải), class đó chỉ có
   nghĩa trong CSS của trình soạn thảo, không được nạp ở theme công khai. Ảnh không bị gắn class
   trái/phải (tức mặc định hoặc "center") sẽ tự căn giữa ở đây; ảnh có fr-fil/fr-fir vẫn giữ float
   trái/phải bình thường qua CSS gốc của trình duyệt/nội dung. */
.news-detail-content img:not(.fr-fil):not(.fr-fir) {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.news-detail-content a {
    color: var(--kto-navy);
}

.news-detail-page .news-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 960px;
    margin: 24px auto 0;
    padding: 0 50px;
}

.news-detail-tag {
    display: inline-block;
    background-color: var(--kto-head-bg);
    border-radius: 999px;
    padding: 6px 16px;
    color: var(--kto-navy);
    font-size: 0.85rem;
    line-height: 1.4;
}

.news-detail-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--kto-row-line);
}

.btn-back-list {
    display: inline-block;
    background-color: #fff;
    border-style: solid;
    border-width: 1px;
    border-color: #4A5677;
    margin: 0;
    padding: 13px 22px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    word-break: keep-all;
    word-wrap: break-word;
    hyphens: auto;
    text-decoration: none;
    color: #4A5677;
}

.btn-back-list:hover {
    border-color: var(--kto-navy);
    background-color: var(--kto-navy);
    color: #FFF;
    transition: all 0.3s ease;
}

@media (max-width: 1023px) {
    .board-wrap {
        margin-top: 28px;
    }
}

@media (max-width: 767px) {
    .board-list-head {
        padding-bottom: 16px;
    }

    .board-list .board-data-group {
        gap: 8px;
        padding: 12px 6px;
    }

    .board-list .col-number {
        flex: 0 0 32px;
    }

    .board-list .col-date {
        flex: 0 0 72px;
        font-size: 0.75rem;
    }

    .paginate {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .news-detail-head {
        gap: 6px;
    }

    .news-detail-title {
        font-size: 1.1rem;
    }

    .news-detail-media {
        margin: 20px 0 8px;
    }

    .news-detail-actions {
        justify-content: center;
    }

    .btn-back-list {
        width: 100%;
        text-align: center;
    }

    .news-detail-content {
        padding: 0 30px;
    }

    .news-detail-page .news-detail-tags {
        padding: 0 30px;
    }
}