/* ============================================================
   nam-long-post-views.css
   [nam_long_post_views] — 2-column: recent posts / top viewed
   ============================================================ */

/* ── Wrapper ── */
/* Override css */
body .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: 100% !important;
}

.ast-single-post .entry-content a, .ast-comment-content a:not(.ast-comment-edit-reply-wrap a) {
    text-decoration: none !important;
}

.nlspv-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
    margin: 0 auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

/* ── Filter bar ── */
.nlspv-filter-bar {
    /* display: flex; */
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.nlspv-filter-tab {
    display: inline-block;
    padding: 8px 16px;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #444;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .2s, border-color .2s, color .2s;
}

.nlspv-filter-tab:hover {
    border-color: #c62828;
    color: #c62828;
    background: #fafafa;
}

.nlspv-filter-tab.active {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

/* ── Empty state ── */
.nlspv-empty {
    color: #888;
    font-size: .9rem;
}

/* ============================================================
   LEFT COLUMN — Recent posts
   ============================================================ */
.nlspv-recent {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Individual article */
.nlspv-recent-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid #e8e8e8;
}
.nlspv-recent-item:first-child {
    padding-top: 0;
}
.nlspv-recent-item:last-child {
    border-bottom: none;
}

/* Image wrapper + badge */
.nlspv-recent-img-wrap {
    position: relative;
    display: block;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #f0f0f0;
    text-decoration: none;
}

.nlspv-recent-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.nlspv-recent-img-wrap:hover .nlspv-recent-img {
    transform: scale(1.04);
}

.nlspv-no-thumb {
    width: 100%;
    height: 100%;
    background: #dce1e7;
}

/* "TIN TỨC" badge — top-left of image */
.nlspv-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #c62828;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 4px 8px;
    border-radius: 0 0 6px 0;
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

/* Badge variants */
.nlspv-badge--internal {
    background: #1976d2; /* Blue for Tin tức nội khu */
}

.nlspv-badge--news {
    background: #c62828; /* Red for Tin tức */
}

/* Body */
.nlspv-recent-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Meta row: date • author */
.nlspv-recent-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: .8rem;
    color: #777;
}
.nlspv-meta-sep {
    color: #bbb;
}
.nlspv-meta-author {
    font-weight: 500;
    color: #555;
}

/* Title */
.nlspv-recent-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
}
.nlspv-recent-title a {
    color: inherit;
    text-decoration: none;
}
.nlspv-recent-title a:hover {
    color: #c62828;
}

/* Excerpt */
.nlspv-recent-excerpt {
    margin: 0;
    font-size: .875rem;
    color: #555;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   RIGHT COLUMN — Top viewed posts
   ============================================================ */
.nlspv-top {
    position: sticky;
    top: 80px;
}

.nlspv-top-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #c62828;
}

/* Ordered list — reset browser defaults */
.nlspv-top-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}



/* ============================================================
   Responsive
   ============================================================ */

/* Tablet: side-by-side but narrower sidebar */
@media (max-width: 1024px) {
    .nlspv-wrap {
        grid-template-columns: 1fr 240px;
        gap: 24px;
    }
    .nlspv-recent-item {
        grid-template-columns: 160px 1fr;
        gap: 14px;
    }
}

/* Mobile: single column stack */
@media (max-width: 768px) {
    .nlspv-wrap {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 16px 12px;
    }

    .nlspv-top {
        position: static;
    }

    .nlspv-recent-item {
        grid-template-columns: 120px 1fr;
        gap: 12px;
        padding: 14px 0;
    }

    .nlspv-recent-title {
        font-size: .95rem;
    }

    .nlspv-recent-excerpt {
        display: none; /* hide excerpt on very small screens */
    }
}

@media (max-width: 480px) {
    .nlspv-recent-item {
        grid-template-columns: 1fr;
    }
    .nlspv-recent-img-wrap {
        width: 100%;
        aspect-ratio: 16 / 9;
    }
    .nlspv-recent-excerpt {
        display: block;
        -webkit-line-clamp: 2;
    }
}

/* ============================================================
    Pagination
    ============================================================ */
.nlspv-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0 20px;
    padding-top: 20px;
}

.nlspv-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #1a1a1a;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .2s, border-color .2s, color .2s;
}

.nlspv-page-link:hover {
    border-color: #c62828;
    background: #f5f5f5;
    color: #c62828;
}

.nlspv-page-link.active {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
    cursor: default;
}
