.kh-home-partners-section,
.kh-home-news-section {
    --kh-green: var(--color-main, #14665D);
    --kh-gold: var(--color-phu, #C59B40);
    --kh-ink: #15363a;
    --kh-mint: #e9f8f1;
    --kh-stroke: rgba(20, 102, 93, .11);
    --kh-soft-shadow: 0 12px 35px rgba(11, 67, 55, .055);
    isolation: isolate;
    position: relative;
    overflow: hidden;
}

.kh-home-partners-section *,
.kh-home-news-section * {
    box-sizing: border-box;
}

.kh-home-partners-section .section-content,
.kh-home-news-section .section-content {
    position: relative;
    z-index: 1;
}

.kh-home-partners-section>.section-bg,
.kh-home-news-section>.section-bg {
    background: transparent !important;
}

.kh-home-partners-section .row,
.kh-home-news-section .row {
    max-width: 1150px;
}

/* 01 – Khu vực logo đối tác */
.kh-home-partners-section {
    background: linear-gradient(150deg, #ffffff 0%, #fbfdfc 42%, #f5faf8 100%) !important;
}

.kh-home-news-section {
    background:
        radial-gradient(ellipse at 93% 20%, rgba(194, 231, 213, .18), transparent 38%),
        linear-gradient(150deg, #ffffff, #f8fcfa 55%, #f2f9f5 100%) !important;
}

/* Tiêu đề đều là UX Text, sửa trực tiếp trong Builder */
.kh-home-partners-section .kh-home-section-title,
.kh-home-news-section .kh-home-section-title {
    margin-bottom: 0 !important;
}

.kh-home-section-title h2 {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 !important;
    color: var(--kh-ink);
    font-size: clamp(23px, 2.6vw, 30px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.035em;
    text-transform: uppercase;
}

.kh-home-section-title h2::before {
    content: '';
    display: inline-block;
    flex: 0 0 4px;
    height: 31px;
    border-radius: 4px;
    background: linear-gradient(180deg, #36ca91, #14834a);
}

.kh-home-partners-section .kh-home-title-row,
.kh-home-news-section .kh-home-title-row {
    margin-bottom: clamp(20px, 3vw, 32px) !important;
}

.kh-home-partners-section .kh-home-title-row>.col,
.kh-home-news-section .kh-home-title-row>.col {
    padding-bottom: 0 !important;
}

/* Đối tác: 5 UX Image độc lập trong Row; JS nhân đôi phía ngoài Builder */
.kh-home-partners-section .kh-partners-marquee {
    width: 100%;
    max-width: 1150px;
    overflow: hidden;
    margin: 0 auto !important;
    padding: 3px 0 7px;
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 2%, #000 98%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 2%, #000 98%, transparent);
}

.kh-home-partners-section .kh-partners-marquee>.col,
.kh-home-partners-section .kh-partners-group>.col {
    width: 168px !important;
    min-width: 168px !important;
    flex: 0 0 168px !important;
    max-width: 168px !important;
    padding: 0 !important;
}

.kh-home-partners-section .kh-partners-group>.col>.col-inner,
.kh-home-partners-section .kh-partners-marquee>.col>.col-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 90px;
    width: 100%;
    min-height: 90px;
    padding: 12px 15px;
    border: 1px solid rgba(19, 74, 63, .11);
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(251, 255, 253, .94));
    box-shadow: 0 5px 15px rgba(22, 84, 70, .035);
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.kh-home-partners-section .kh-partners-group>.col:hover>.col-inner {
    transform: translateY(-3px);
    border-color: rgba(20, 102, 93, .23);
    box-shadow: var(--kh-soft-shadow);
}

.kh-home-partners-section .kh-partners-group>.col>.col-inner>*,
.kh-home-partners-section .kh-partners-marquee>.col>.col-inner>* {
    width: 100%;
    margin: 0;
}

.kh-home-partners-section .kh-partners-marquee .img,
.kh-home-partners-section .kh-partners-marquee .img-inner {
    height: 62px !important;
    width: 100%;
    padding: 0 !important;
}

.kh-home-partners-section .kh-partners-marquee img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: 62px;
    object-fit: contain;
    object-position: center;
}

.kh-home-partners-section .kh-partner-wordmark p {
    margin: 0;
    text-align: center;
    color: #18282b;
    font-size: clamp(14px, 1.6vw, 20px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.25;
}

.kh-home-partners-section .kh-partner-wordmark--wide p {
    font-size: 15px;
    letter-spacing: -.03em;
}

.kh-home-partners-section .kh-partners-track {
    display: flex;
    flex: 0 0 auto;
    width: max-content;
    gap: 0;
    align-items: stretch;
    animation: kh-partners-scroll var(--kh-marquee-duration, 30s) linear infinite;
    will-change: transform;
}

.kh-home-partners-section .kh-partners-group {
    display: flex;
    width: max-content;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 14px;
    padding-right: 14px;
}

.kh-home-partners-section .kh-partners-marquee:hover .kh-partners-track {
    animation-play-state: paused;
}

@keyframes kh-partners-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* 02 – Tin tức: 1 bài lớn + 3 bài nhỏ, từ danh mục WP */
.kh-home-news-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.36fr) minmax(0, .97fr);
    gap: 15px;
    align-items: stretch;
    min-height: 326px;
}

.kh-home-news-grid a {
    text-decoration: none !important;
}

.kh-home-news-grid--single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 700px;
}

.kh-home-news-feature {
    position: relative;
    min-height: 326px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 17px;
    background: linear-gradient(135deg, #cde4d7, #659989);
    box-shadow: 0 16px 26px rgba(8, 80, 57, .11);
    isolation: isolate;
    color: var(--color-white);
}

.kh-home-news-feature::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, rgba(5, 27, 27, 0) 22%, rgba(1, 21, 18, .28) 52%, rgba(1, 31, 26, .92) 100%);
    pointer-events: none;
}

.kh-home-news-feature-media,
.kh-home-news-feature-media img,
.kh-home-news-feature-media .kh-home-news-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.kh-home-news-feature-media img {
    object-fit: cover;
    transition: transform .7s ease;
}

.kh-home-news-feature:hover .kh-home-news-feature-media img {
    transform: scale(1.045);
}

.kh-home-news-placeholder {
    background:
        radial-gradient(circle at 67% 24%, rgba(197, 155, 64, .20), transparent 34%),
        linear-gradient(130deg, #247366, #0b403d);
}

.kh-home-news-feature-body {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 24px 25px 25px;
}

.kh-home-news-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 100px;
}

.kh-home-news-date::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.kh-home-news-date--light {
    color: var(--color-white);
    padding: 5px 9px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .38);
    backdrop-filter: blur(5px);
}

.kh-home-news-feature h3 {
    margin: 11px 0 10px;
    color: var(--color-white);
    font-size: clamp(20px, 2.18vw, 27px);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kh-home-news-feature p {
    margin: 0;
    color: rgba(255, 255, 255, .83);
    font-size: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kh-home-news-side {
    display: grid;
    grid-template-rows: repeat(var(--kh-mini-count, 3), minmax(0, 1fr));
    gap: 13px;
    min-width: 0;
}

.kh-home-news-mini {
    min-height: 0;
    display: grid;
    grid-template-columns: 37% minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--kh-stroke);
    border-radius: 12px;
    background: linear-gradient(115deg, #fff 65%, #f7fcf9);
    box-shadow: 0 6px 16px rgba(9, 59, 48, .032);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.kh-home-news-mini:hover {
    transform: translateY(-2px);
    border-color: rgba(20, 102, 93, .28);
    box-shadow: 0 12px 27px rgba(12, 65, 54, .09);
}

.kh-home-news-mini-media {
    position: relative;
    overflow: hidden;
    min-height: 92px;
    background: #d4e9de;
}

.kh-home-news-mini-media img,
.kh-home-news-mini-media .kh-home-news-placeholder {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
    transition: transform .5s ease;
}

.kh-home-news-mini:hover .kh-home-news-mini-media img {
    transform: scale(1.05);
}

.kh-home-news-mini-info {
    min-width: 0;
    padding: 12px 13px 10px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
}

.kh-home-news-date--green {
    padding: 4px 8px;
    color: #138658;
    background: rgba(218, 248, 236, .6);
    border: 1px solid rgba(41, 178, 115, .15);
    font-size: 9px;
}

.kh-home-news-mini h3 {
    margin: 7px 0 0;
    font-size: clamp(12px, 1.1vw, 13px);
    font-weight: 650;
    line-height: 1.45;
    color: var(--kh-ink);
    letter-spacing: -.01em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kh-home-news-empty {
    margin: 0;
    padding: 22px;
    border: 1px dashed rgba(20, 102, 93, .24);
    border-radius: 12px;
    color: #34665b;
    background: #f7fcf9;
}

@media (max-width: 849px) {
    .kh-home-partners-section .kh-partners-marquee,
    .kh-home-news-section .kh-home-news-grid {
        max-width: 100%;
    }

    .kh-home-news-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
    }

    .kh-home-news-feature {
        min-height: 300px;
    }

    .kh-home-news-side {
        grid-template-rows: none;
    }

    .kh-home-news-mini {
        min-height: 112px;
    }
}

@media (max-width: 549px) {
    .kh-home-partners-section {
        padding: 31px 0 44px !important;
    }

    .kh-home-news-section {
        padding: 33px 0 56px !important;
    }

    .kh-home-section-title h2 {
        font-size: 23px;
        gap: 11px;
    }

    .kh-home-section-title h2::before {
        height: 26px;
    }

    .kh-home-partners-section .kh-partners-marquee>.col,
    .kh-home-partners-section .kh-partners-group>.col {
        width: 150px !important;
        min-width: 150px !important;
        flex-basis: 150px !important;
        max-width: 150px !important;
    }

    .kh-home-partners-section .kh-partners-group>.col>.col-inner,
    .kh-home-partners-section .kh-partners-marquee>.col>.col-inner {
        height: 80px;
        min-height: 80px;
    }

    .kh-home-news-feature {
        min-height: 265px;
    }

    .kh-home-news-feature-body {
        padding: 17px 17px 20px;
    }

    .kh-home-news-feature h3 {
        font-size: 20px;
        -webkit-line-clamp: 3;
    }

    .kh-home-news-feature p {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }

    .kh-home-news-mini {
        grid-template-columns: 39% minmax(0, 1fr);
        min-height: 98px;
    }

    .kh-home-news-mini-info {
        padding: 9px 10px;
    }

    .kh-home-news-mini h3 {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kh-home-partners-section .kh-partners-track {
        animation: none !important;
    }

    .kh-home-partners-section .kh-partners-marquee {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .kh-home-news-feature-media img,
    .kh-home-news-mini-media img,
    .kh-home-news-mini {
        transition: none !important;
    }
}

/* V2: logo được chọn bằng UX Image (không phải UX Text). */
.kh-home-partners-section .kh-partner-logo-image {
    display: block;
    margin: 0 auto !important;
    width: 100%;
}

.kh-home-partners-section .kh-partner-logo-image .img-inner,
.kh-home-partners-section .kh-partner-logo-image img {
    background: transparent !important;
}

.kh-home-partners-section .kh-partner-logo-image img {
    object-fit: contain !important;
    object-position: center;
}