/* ============================================================
   Category Page — Newspaper-style responsive grid
   ============================================================ */

/* ── Layout wrapper ─────────────────────────────────────── */
.cat-page {
    padding: 0 0 48px;
}

.cat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
    margin-top: 20px;
}

/* ── Category Header ─────────────────────────────────────── */
.cat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    border-top: 4px solid var(--black);
    padding: 16px 0 14px;
    margin-top: 20px;
    border-bottom: 1px solid var(--line);
}

.cat-header-left {
    flex: 1 1 auto;
}

.cat-parent-link {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cat-sep {
    color: var(--muted);
    margin: 0 5px;
    font-size: 13px;
}

.cat-title {
    font-family: "Noto Serif Bengali", serif;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--black);
    margin: 4px 0 6px;
    position: relative;
    display: inline-block;
}

.cat-title::after {
    content: '';
    display: block;
    height: 4px;
    background: var(--red);
    border-radius: 2px;
    margin-top: 4px;
}

.cat-desc {
    color: var(--muted);
    font-size: 14px;
    margin: 6px 0 0;
    max-width: 640px;
    line-height: 1.6;
}

.cat-subs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cat-sub-link {
    background: var(--soft);
    color: #333;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s, color .15s;
}

.cat-sub-link:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

/* Filter tabs */
.cat-filter-tabs {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.cat-tab {
    padding: 7px 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    background: #fff;
    transition: background .15s, color .15s, border-color .15s;
}

.cat-tab:hover {
    background: var(--soft);
}

.cat-tab.active {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

/* ── Ads ─────────────────────────────────────────────────── */
.cat-ad-top {
    text-align: center;
    margin: 16px 0 4px;
}

.cat-ad-mid {
    text-align: center;
    margin: 28px 0;
}

/* ── Featured (first post hero) ──────────────────────────── */
.cat-featured {
    margin-bottom: 24px;
}

.cat-featured-card {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .2s;
}

.cat-featured-card:hover {
    box-shadow: var(--shadow);
}

.cat-featured-img {
    position: relative;
    overflow: hidden;
}

.cat-featured-img img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}

.cat-featured-card:hover .cat-featured-img img {
    transform: scale(1.03);
}

.cat-featured-body {
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.cat-featured-cat {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    align-self: flex-start;
}

.cat-featured-title {
    font-family: "Noto Serif Bengali", serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.45;
    color: #111;
    margin-bottom: 10px;
}

.cat-featured-excerpt {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
    flex: 1;
}

/* ── Badges ──────────────────────────────────────────────── */
.cat-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 4px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .04em;
    z-index: 2;
}

.cat-badge.breaking {
    background: var(--red);
}

.cat-badge.trending {
    background: #e65100;
}

.cat-badge.featured {
    background: var(--green);
}

.cat-badge.sm {
    font-size: 10px;
    padding: 2px 7px;
}

/* ── Meta (time / views) ─────────────────────────────────── */
.cat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

/* ── 3-column grid ───────────────────────────────────────── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.cat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.cat-card-img {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.cat-card-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: var(--soft);
    transition: transform .35s;
}

.cat-card:hover .cat-card-img img {
    transform: scale(1.04);
}

.cat-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cat-card-cat {
    font-size: 11px;
    font-weight: 800;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 5px;
    display: block;
}

.cat-card-title {
    font-family: "Noto Serif Bengali", serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: #111;
    margin-bottom: 6px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-card-excerpt {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Pagination ──────────────────────────────────────────── */
.cat-pagination {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.cat-pagination .pagination {
    display: flex;
    list-style: none;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.cat-pagination .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #333;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s, color .15s;
}

.cat-pagination .page-item.active .page-link {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.cat-pagination .page-item.disabled .page-link {
    color: var(--muted);
    pointer-events: none;
    background: var(--soft);
}

.cat-pagination .page-item .page-link:hover:not(.active):not(.disabled) {
    background: var(--soft);
}

/* ── Empty state ─────────────────────────────────────────── */
.cat-empty {
    text-align: center;
    padding: 80px 0;
    color: var(--muted);
    font-size: 16px;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.cat-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.cat-sidebar-widget {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.cat-sidebar-widget.ad-widget {
    background: transparent;
    border: none;
    border-radius: 0;
    text-align: center;
}

.cat-widget-head {
    font-family: "Noto Serif Bengali", serif;
    font-size: 16px;
    font-weight: 800;
    padding: 12px 14px 10px;
    border-bottom: 3px solid var(--red);
    background: #fff;
    color: #111;
}

.cat-widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-widget-item {
    border-bottom: 1px solid var(--line);
}

.cat-widget-item:last-child {
    border-bottom: none;
}

.cat-widget-link {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    align-items: flex-start;
    transition: background .15s;
}

.cat-widget-link:hover {
    background: var(--soft);
}

.cat-widget-img {
    position: relative;
    flex: 0 0 72px;
}

.cat-widget-img img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    background: var(--soft);
}

.cat-widget-no {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 3px;
    display: grid;
    place-items: center;
    line-height: 1;
}

.cat-widget-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-widget-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-widget-meta {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
}

/* ── Responsive ──────────────────────────────────────────── */

/* Tablet: 2-col grid, sidebar wraps below */
@media (max-width: 1024px) {
    .cat-layout {
        grid-template-columns: 1fr;
    }

    .cat-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .cat-sidebar .ad-widget {
        grid-column: 1 / -1;
    }

    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1-col grid, compact cards */
@media (max-width: 640px) {
    .cat-header {
        flex-direction: column;
        gap: 12px;
    }

    .cat-filter-tabs {
        width: 100%;
        justify-content: flex-start;
    }

    .cat-title {
        font-size: 24px;
    }

    .cat-featured-card {
        grid-template-columns: 1fr;
    }

    .cat-featured-img img {
        min-height: 200px;
        height: 220px;
    }

    .cat-featured-body {
        padding: 16px;
    }

    .cat-featured-title {
        font-size: 18px;
    }

    .cat-grid {
        grid-template-columns: 1fr;
    }

    .cat-card-img img {
        height: 200px;
    }

    .cat-sidebar {
        grid-template-columns: 1fr;
    }

    .cat-sidebar {
        display: flex;
        flex-direction: column;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .cat-tab {
        padding: 6px 10px;
        font-size: 12px;
    }
}


/* ============================================================
   Reusable News Card component  (.nc-*)
   ============================================================ */

.nc-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    color: inherit;
}

.nc-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.nc-img {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.nc-img img {
    width: 100%;
    height: var(--nc-img-h, 180px);
    object-fit: cover;
    display: block;
    background: var(--soft);
    transition: transform .35s;
}

.nc-card:hover .nc-img img {
    transform: scale(1.04);
}

/* Shared badges (also used by news-featured) */
.nc-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .04em;
    z-index: 2;
    line-height: 1.6;
}

.nc-badge.breaking {
    background: var(--red);
}

.nc-badge.trending {
    background: #e65100;
}

.nc-badge.featured {
    background: var(--green);
}

.nc-badge.sm {
    font-size: 9px;
    padding: 1px 6px;
}

.nc-body {
    padding: 11px 13px 13px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nc-cat {
    font-size: 10px;
    font-weight: 800;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
    display: block;
}

.nc-title {
    font-family: "Noto Serif Bengali", serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    color: #111;
    margin-bottom: 6px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nc-excerpt {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 7px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    margin-top: auto;
}

.nc-time {
    color: var(--green-dark);
    font-weight: 700;
}

/* ============================================================
   Reusable News Featured hero block  (.nf-*)
   ============================================================ */

.nf-block {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    transition: box-shadow .2s;
}

.nf-block:hover {
    box-shadow: var(--shadow);
}

/* Big left card */
.nf-main {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--line);
}

.nf-main-img {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.nf-main-img img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    background: var(--soft);
    transition: transform .35s;
}

.nf-main:hover .nf-main-img img {
    transform: scale(1.03);
}

.nf-main-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nf-cat {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
    align-self: flex-start;
}

.nf-title {
    font-family: "Noto Serif Bengali", serif;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.45;
    color: #111;
    margin-bottom: 8px;
    flex: 1;
}

.nf-excerpt {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Freshness indicator (Latest page) */
.nf-freshness {
    color: var(--green-dark);
    font-weight: 800;
    font-size: 12px;
}

/* Right stacked secondary cards */
.nf-stack {
    display: flex;
    flex-direction: column;
    background: #fff;
}

.nf-sec-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    transition: background .15s;
}

.nf-sec-card:last-child {
    border-bottom: none;
}

.nf-sec-card:hover {
    background: var(--soft);
}

.nf-sec-img {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.nf-sec-img img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
    background: var(--soft);
    transition: transform .3s;
}

.nf-sec-card:hover .nf-sec-img img {
    transform: scale(1.04);
}

.nf-sec-body {
    padding: 9px 12px 10px;
    flex: 1;
}

.nf-sec-title {
    font-family: "Noto Serif Bengali", serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: #111;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Latest page: category filter chips wrap ── */
.latest-cat-filter {
    flex-wrap: wrap;
    max-width: 600px;
}

/* ── Latest grid: slight extra spacing, freshness colour for time ── */
.latest-grid .nc-time {
    color: var(--green-dark);
    font-weight: 800;
}

/* ── Responsive adjustments for nf-block ── */
@media (max-width: 860px) {
    .nf-block {
        grid-template-columns: 1fr;
    }

    .nf-main {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .nf-main-img img {
        height: 220px;
    }

    .nf-stack {
        flex-direction: row;
        overflow-x: auto;
    }

    .nf-sec-card {
        min-width: 200px;
        border-bottom: none;
        border-right: 1px solid var(--line);
    }

    .nf-sec-card:last-child {
        border-right: none;
    }

    .nf-sec-img img {
        height: 120px;
    }
}

@media (max-width: 540px) {
    .nf-main-img img {
        height: 190px;
    }

    .nf-title {
        font-size: 17px;
    }

    .nf-stack {
        display: none;
    }

    /* hide secondary on very small phones */

    .latest-cat-filter {
        gap: 6px;
    }

    .latest-cat-filter .cat-tab {
        padding: 5px 10px;
        font-size: 12px;
    }
}