/* ND369 — Related posts carousel */
/* --- B?i vi?t li?n quan: desktop l??i | mobile vu?t ngang l?p l? --- */
.nd369-related {
    width: 100%;
    margin: 36px 0 16px;
    padding: 0;
    clear: both;
}

.nd369-related-inner {
    width: 100%;
}

.nd369-related-header {
    margin: 0 0 18px;
    text-align: left;
}

.nd369-related-title {
    color: var(--primary-color, #004d99);
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.3;
}

.nd369-related-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nd369-related-card {
    margin: 0;
    background: #fff;
    border: 1px solid #e4ebf3;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nd369-related-card:hover {
    border-color: rgba(0, 77, 153, 0.35);
    box-shadow: 0 6px 18px rgba(0, 51, 102, 0.08);
}

.nd369-related-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none !important;
    color: inherit;
}

.nd369-related-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-light, #f4f8ff);
    overflow: hidden;
}

.nd369-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    box-shadow: none !important;
}

.nd369-related-thumb-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8eef6 0%, #d5e2f0 100%);
}

.nd369-related-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nd369-related-card-title {
    color: var(--primary-color, #004d99);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nd369-related-card-link:hover .nd369-related-card-title {
    color: var(--secondary-color, #cc3300);
}

.nd369-related-date {
    color: #888;
    font-size: 0.85rem;
    margin-top: auto;
}

@media (max-width: 1024px) {
    .nd369-related-track {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nd369-related {
        margin: 28px -16px 8px;
        width: calc(100% + 32px);
    }

    .nd369-related-header {
        padding: 0 16px;
        margin-bottom: 14px;
    }

    .nd369-related-title {
        font-size: 1.2rem;
    }

    .nd369-related-track {
        display: flex;
        grid-template-columns: none;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 16px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        padding: 0 16px 14px;
        scrollbar-width: none;
    }

    .nd369-related-track::-webkit-scrollbar {
        display: none;
    }

    .nd369-related-card {
        flex: 0 0 78%;
        max-width: 78%;
        scroll-snap-align: start;
    }
}
