/* =============================================
   News Feed — Responsive (Mobile + Desktop)
   ============================================= */

/* ── Outer container — forced full viewport width ── */
.nls-news-feed-outer {
    /* Classic themes: break out of the centered content container */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Block themes (useRootPaddingAwareAlignments): extend past root padding instead */
.nls-news-feed-outer.alignfull {
    width: calc(100% + var(--wp--style--root--padding-left, 0px) + var(--wp--style--root--padding-right, 0px));
    margin-left: calc(var(--wp--style--root--padding-left, 0px) * -1);
    margin-right: calc(var(--wp--style--root--padding-right, 0px) * -1);
}

@media (min-width: 1024px) {
  .nls-news-feed-outer.alignfull {
    width: calc(100% + var(--wp--style--root--padding-left, 0px) + var(--wp--style--root--padding-right, 0px));
    margin-left: calc(var(--wp--style--root--padding-left, 0px) * -1);
    margin-right: calc(var(--wp--style--root--padding-right, 0px) * -1);
    padding: 24px;
    }
}

/* ── Page wrapper: desktop = 2 col, mobile = 1 col ── */
.nls-news-feed-page {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    max-width: var(--wp--style--global--wide-size, 1200px);
    margin: 0 auto;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

/* ── Main feed column ── */
.nls-news-feed-main {
    flex: 1;
    min-width: 0;
    background: #fff;
}

/* ══════════════════════════════════
   TAB HEADER
══════════════════════════════════ */
.nls-news-feed-header {
    display: flex;
    align-items: center;
    border-bottom: 1.5px solid #e5e7eb;
    margin-bottom: 0;
}

.nls-news-feed-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    gap: 0;
}

.nls-news-feed-tabs::-webkit-scrollbar { display: none; }

.nls-news-feed-tab {
    flex-shrink: 0;
    padding: 11px 16px 10px;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    outline: none;
}

.nls-news-feed-tab:hover { color: #c62828; }

.nls-news-feed-tab.is-active {
    color: #111827;
    font-weight: 700;
    border-bottom-color: #c62828;
    background-color: transparent !important;
}

/* "Xem thêm →" in tab row — desktop only */
.nls-more-desktop {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    color: #c62828;
    text-decoration: none;
    white-space: nowrap;
    display: none; /* shown on desktop via media query */
}
.nls-more-desktop:hover { color: #c73127; }

/* ══════════════════════════════════
   SLIDER
══════════════════════════════════ */
.nls-news-feed-slider { overflow: hidden; }

.nls-news-feed-track {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.nls-news-feed-panel {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
}

/* ══════════════════════════════════
   DESKTOP LAYOUT (hidden on mobile)
══════════════════════════════════ */
.nls-news-feed-desktop-body {
    display: none; /* shown on desktop */
    gap: 0;
}

/* Featured post */
.nls-news-feed-featured {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 16px 0;
}

.nls-news-feed-featured-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 3px;
    background: #d1d5db;
    margin-bottom: 12px;
}

.nls-news-feed-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nls-news-feed-featured-img .nls-news-feed-no-thumb {
    width: 100%;
    height: 100%;
    background: #d1d5db;
}

.nls-news-feed-featured-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    color: #111827;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nls-news-feed-featured:hover .nls-news-feed-featured-title { color: #c62828; }

.nls-news-feed-featured-time {
    font-size: 13px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Secondary posts (text-only list) */
.nls-news-feed-secondary-list {
    list-style: none;
    margin: 0;
    padding: 16px 0 0;
}

.nls-news-feed-secondary-item {
    border-top: 1px solid #f0f0f0;
    padding: 12px 0;
}

.nls-news-feed-secondary-item:first-child {
    border-top: none;
    padding-top: 0;
}

.nls-news-feed-secondary-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: #1f2937;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nls-news-feed-secondary-title:hover { color: #c62828; }

/* ══════════════════════════════════
   MOBILE LAYOUT
══════════════════════════════════ */
.nls-news-feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nls-news-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.nls-news-feed-item:last-child { border-bottom: none; }

.nls-news-feed-thumb {
    flex-shrink: 0;
    display: block;
    width: 120px;
    height: 88px;
    overflow: hidden;
    border-radius: 3px;
    background: #d1d5db;
}

.nls-news-feed-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nls-news-feed-no-thumb {
    width: 100%;
    height: 100%;
    background: #d1d5db;
}

.nls-news-feed-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 2px;
}

.nls-news-feed-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    color: #111827;
    text-decoration: none;
}

.nls-news-feed-title:hover { color: #c62828; }

.nls-news-feed-time {
    font-size: 12px;
    color: #9ca3af;
}

/* Mobile "Xem thêm" footer */
.nls-more-mobile {
    padding: 14px 12px;
    border-top: 1px solid #f0f0f0;
    display: block;
}

.nls-news-feed-more-link {
    font-size: 14px;
    font-weight: 600;
    color: #c62828;
    text-decoration: none;
}

.nls-news-feed-more-link:hover { color: #c73127; text-decoration: underline; }

/* Empty state */
.nls-news-feed-empty {
    padding: 30px 12px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* ══════════════════════════════════
   AD COLUMN — hidden on mobile
══════════════════════════════════ */
.nls-news-feed-ad {
    display: none; /* shown on desktop */
    flex-shrink: 0;
    width: 300px;
}

.nls-news-feed-ad img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* ══════════════════════════════════
   DESKTOP BREAKPOINT ≥ 768px
══════════════════════════════════ */
@media (min-width: 768px) {
    /* Show ad column */
    .nls-news-feed-ad { display: block; }

    /* Show Xem thêm in header row */
    .nls-more-desktop { display: block; }

    /* Show desktop content layout */
    .nls-news-feed-desktop-body {
        display: grid;
        grid-template-columns: 1.25fr 1fr;
        gap: 0 24px;
        padding: 8px 16px;
        align-items: start;
    }

    /* Hide mobile layout */
    .nls-news-feed-list { display: none; }
    .nls-more-mobile { display: none; }

    /* Tabs slightly smaller on desktop */
    .nls-news-feed-tab {
        font-size: 15px;
        padding: 12px 18px 11px;
    }

    /* Featured post fills left grid cell */
    .nls-news-feed-featured { padding: 16px 0; }

    /* Secondary list fills right grid cell */
    .nls-news-feed-secondary-list { padding: 16px 0; }
}
