/* ==========================================================================
   Trang Tin tức & Sự kiện — layout magazine (khác sidebar BHS)
   ========================================================================= */

.page-news {
    background: var(--hpr-bg-muted);
    color: var(--hpr-text);
}

.news-wrap {
    width: 90%;
    max-width: 1180px;
    margin: 0 auto;
}

/* --- Hero --- */
.news-hero {
    position: relative;
    min-height: clamp(260px, 38vh, 360px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.news-hero__bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, rgba(11, 41, 79, 0.92) 0%, rgba(0, 140, 180, 0.5) 100%),
        url("../../images/bg-desktop.jpg") center/cover no-repeat;
}

.news-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(8, 24, 44, 0.5) 0%, transparent 55%);
}

.news-hero__inner {
    position: relative;
    z-index: 2;
    padding: clamp(5rem, 12vh, 7rem) 0 2.5rem;
    color: #fff;
}

.news-breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.news-breadcrumb a {
    color: #fff;
    text-decoration: none;
}

.news-breadcrumb a:hover {
    color: #7ee8ff;
}

.news-breadcrumb span {
    margin: 0 0.4rem;
    opacity: 0.6;
}

.news-hero__inner h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.75rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.news-hero__inner > p {
    max-width: 520px;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* --- Main --- */
.news-main {
    padding: 2.5rem 0 3rem;
    margin-top: -1.5rem;
    position: relative;
    z-index: 3;
}

.news-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(11, 41, 79, 0.06);
}

.news-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-filter {
    border: 1px solid #dde5ee;
    background: #fff;
    color: #5a6b7d;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-filter:hover {
    border-color: #00b4d8;
    color: #00b4d8;
}

.news-filter.is-active {
    background: #00b4d8;
    border-color: #00b4d8;
    color: #fff;
}

.news-count {
    font-size: 0.85rem;
    color: #7a8a9a;
    font-weight: 500;
}

.news-toolbar-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
}

.news-toolbar-search input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dde5ee;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.84rem;
}

.news-toolbar-search button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #00b4d8;
    color: #fff;
    cursor: pointer;
}

/* --- Featured --- */
.news-featured {
    margin-bottom: 2rem;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 12px 40px rgba(11, 41, 79, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0, 180, 216, 0.15);
}

.news-featured.is-hidden {
    display: none;
}

.news-featured__link {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    text-decoration: none;
    color: inherit;
    min-height: 280px;
}

.news-featured__media {
    position: relative;
    min-height: 260px;
    overflow: hidden;
}

.news-featured__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-featured:hover .news-featured__media img {
    transform: scale(1.05);
}

.news-featured__body {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-featured__body time {
    font-size: 0.8rem;
    color: #00b4d8;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.news-featured__body h2 {
    font-size: clamp(1.1rem, 2.2vw, 1.45rem);
    font-weight: 800;
    color: #0b294f;
    line-height: 1.35;
    margin-bottom: 0.85rem;
}

.news-featured__body p {
    font-size: 0.9rem;
    color: #5a6b7d;
    line-height: 1.65;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-read-more {
    font-size: 0.88rem;
    font-weight: 700;
    color: #00b4d8;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.news-read-more i {
    transition: transform 0.2s ease;
}

.news-featured:hover .news-read-more i {
    transform: translateX(4px);
}

/* --- Tags --- */
.news-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #00b4d8;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-tag--sm {
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
}

.news-tag--event {
    background: #6c5ce7;
}

.news-tag--project {
    background: #0b294f;
}

.news-tag--press {
    background: #b8860b;
}

.news-card__source {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8a6a1a;
    letter-spacing: 0.02em;
}

/* --- Grid --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.news-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(11, 41, 79, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 36px rgba(0, 180, 216, 0.14);
}

.news-card.is-hidden {
    display: none;
}

.news-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.news-card__thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.news-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.news-card:hover .news-card__thumb img {
    transform: scale(1.08);
}

.news-card__body {
    padding: 1.15rem 1.25rem 1.35rem;
}

.news-card__body time {
    font-size: 0.75rem;
    color: #00b4d8;
    font-weight: 600;
}

.news-card__body h3 {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0b294f;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-empty {
    text-align: center;
    padding: 3rem;
    color: #7a8a9a;
    background: #fff;
    border-radius: 12px;
    grid-column: 1 / -1;
}

.news-load-more {
    text-align: center;
    margin-top: 2.5rem;
}

.btn-load-more {
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.9rem;
}

/* --- CTA --- */
.news-cta {
    background: linear-gradient(135deg, #0b294f 0%, #0d4a6e 100%);
    padding: 2.5rem 0;
    margin-bottom: 0;
}

.news-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    color: #fff;
}

.news-cta__inner h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.news-cta__inner p {
    font-size: 0.9rem;
    opacity: 0.85;
}

.news-cta__form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 420px;
    min-width: 260px;
}

.news-cta__form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

.news-cta__form button {
    white-space: nowrap;
}

.news-cta__form {
    flex-wrap: wrap;
    align-items: flex-start;
}

.news-cta__form .subscribe-success-msg {
    flex: 1 1 100%;
    width: 100%;
}

.news-cta__form.is-submitted input,
.news-cta__form.is-submitted button {
    display: none;
}

.news-cta__form .subscribe-success-msg--success {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(126, 232, 255, 0.55);
    color: #e8f8ff;
}

.news-cta__form .subscribe-success-msg--success i {
    color: #7ee8ff;
}

/* --- Article modal detail (no new page) --- */
.news-modal[hidden] {
    display: none;
}

.news-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    overscroll-behavior: contain;
    animation: newsModalFadeIn 0.22s ease;
}

.news-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 25, 46, 0.68);
    backdrop-filter: blur(4px);
}

.news-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(92%, 980px);
    max-height: min(88vh, 900px);
    margin: clamp(3rem, 7vh, 5rem) auto 0;
    background: #fdfefe;
    border-radius: 18px;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 28px 70px rgba(6, 26, 46, 0.42);
    border: 1px solid rgba(10, 63, 110, 0.12);
    animation: newsDialogRise 0.28s cubic-bezier(0.2, 0.85, 0.28, 1);
}

body.news-modal-open {
    overflow: hidden;
    height: 100vh;
}

.news-modal__head {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem 0.8rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    border-bottom: 1px solid rgba(10, 63, 110, 0.09);
}

.news-modal__close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(11, 41, 79, 0.08);
    color: #0b294f;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.news-modal__close:hover {
    background: rgba(11, 41, 79, 0.16);
    transform: rotate(90deg);
}

.news-modal__media {
    aspect-ratio: 16 / 8;
    overflow: hidden;
}

.news-modal__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-modal__body {
    padding: 1.1rem 1.35rem 1.35rem;
}

.news-modal__meta {
    font-size: 0.77rem;
    color: #0fa3c6;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.28rem;
}

.news-modal__head h3 {
    color: #0b294f;
    font-size: clamp(1.06rem, 2vw, 1.35rem);
    line-height: 1.4;
}

.news-modal__content p {
    color: #4e6072;
    line-height: 1.75;
    margin-bottom: 0.7rem;
}

.news-modal__actions {
    margin-top: 1rem;
    padding-top: 0.95rem;
    border-top: 1px dashed rgba(10, 63, 110, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.news-modal__action {
    border: none;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 0.62rem 1rem;
}

.news-modal__action--ghost {
    color: #0d4b80;
    background: rgba(13, 75, 128, 0.08);
}

.news-modal__action--primary {
    color: #fff;
    background: linear-gradient(90deg, #0d4b80, #1b5f98);
}

@keyframes newsDialogRise {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes newsModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 992px) {
    .news-hero {
        padding-top: 72px;
    }

    .news-featured__link {
        grid-template-columns: 1fr;
    }

    .news-featured__media {
        min-height: 220px;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 600px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .news-filters {
        justify-content: flex-start;
    }

    .news-cta__form {
        flex-direction: column;
        max-width: none;
    }
}
