/* news-index.css — LawnBeast /news index (card grid) re-skin.
   Layers on top of base.css + public-base.css; never redefines their tokens.
   Namespaced .ni-* selectors only (no base.css .card/.sidebar/.layout/.header/.main/.kpi*).
   MOBILE-FIRST: base = phone; @700px = featured 2-col + grid 2-col; @1000px = grid 3-col. */

/* ---- container / header ---- */
.news-index {
    /* vertical padding only; horizontal gutter comes from .pub-container
       (and is narrowed to 12px on phones by the max-width:699.98px block) */
    padding-top: 32px;
    padding-bottom: 8px;
}

.ni-header {
    margin-bottom: 24px;
}

.ni-title {
    margin: 0;
    font-size: clamp(28px, 6vw, 34px);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
}

.ni-sub {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted);
}

/* ---- featured hero ---- */
.ni-featured {
    display: block;
    color: inherit;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
    transition: var(--transition-fast);
}

.ni-featured:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ni-featured-media {
    min-height: 200px;
}

.ni-featured-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ni-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.ni-featured-tag {
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    background: var(--accent-bg);
    color: var(--accent-dark);
    padding: 3px 10px;
    border-radius: 999px;
}

.ni-featured-title {
    margin: 0 0 12px;
    font-size: clamp(20px, 4.5vw, 26px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--text);
    text-wrap: pretty;
}

.ni-featured-dek {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
    text-wrap: pretty;
}

.ni-featured-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.ni-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
}

.ni-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---- grid ---- */
.ni-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr);
}

.ni-card {
    display: block;
    color: inherit;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: var(--transition-fast);
}

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

.ni-card-media {
    height: 160px;
}

.ni-card-body {
    padding: 16px 18px 18px;
}

.ni-card-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.28;
    color: var(--text);
    text-wrap: pretty;
}

.ni-card-teaser {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text-secondary);
    text-wrap: pretty;
}

.ni-card-date {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
}

.ni-card.is-hidden {
    display: none;
}

/* ---- media placeholder + images ---- */
.ni-media-ph {
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .85);
    background:
        radial-gradient(rgba(255, 255, 255, .12) 1.4px, transparent 1.5px) 0 0 / 14px 14px,
        linear-gradient(135deg, var(--accent) 0%, var(--sidebar-active) 100%);
}

.ni-media-ph i {
    font-size: 24px;
}

.ni-featured-media .ni-media-ph i {
    font-size: 30px;
}

.ni-card-media img,
.ni-featured-media img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

.ni-featured-media {
    display: flex;
}

.ni-featured-media img,
.ni-featured-media .ni-media-ph {
    min-height: 200px;
}

/* ---- load more ---- */
.ni-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.ni-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.ni-more:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- empty state ---- */
.ni-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 0;
}

.ni-empty i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.ni-empty p {
    margin: 0;
    font-size: 15px;
}

/* ---- tablet: featured 2-col, grid 2-col ---- */
@media (min-width: 700px) {
    .ni-featured {
        display: grid;
        grid-template-columns: 1.15fr .85fr;
    }

    .ni-featured-media {
        min-height: 300px;
    }

    .ni-featured-media img,
    .ni-featured-media .ni-media-ph {
        min-height: 300px;
    }

    .ni-featured-body {
        padding: 30px;
    }

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

/* ---- desktop: grid 3-col ---- */
@media (min-width: 1000px) {
    .ni-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---- MOBILE (< 700px): uniform bordered list ----
   Every article reads as the same bordered card laid out as a row — square
   thumbnail on the left, text (title + teaser + date) on the right. The
   featured hero collapses into the exact same row shape as the cards (its
   "Featured" tag + "Read story" button are dropped), so the newest article
   looks identical to the rest. The big hero + multi-column card grid only
   return at >= 700px. Pure override of the mobile-first base rules; the
   >= 700px cascade (and the base surface/border/hover) is left untouched. */
@media (max-width: 699.98px) {
    /* tiny breathing room from the viewport edges on phones */
    .news-index {
        padding-left: 12px;
        padding-right: 12px;
    }

    .ni-featured,
    .ni-card {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px;
        border-radius: 10px;
        box-shadow: var(--shadow-xs);
        overflow: hidden;
    }
    .ni-featured { margin-bottom: 22px; }

    /* square thumbnail (overrides the base 160/200px media blocks) */
    .ni-featured-media,
    .ni-card-media {
        flex: 0 0 auto;
        width: 100px;
        height: 100px;
        min-height: 0;
        border-radius: 8px;
        overflow: hidden;
    }
    .ni-featured-media { display: block; }
    .ni-featured-media img,
    .ni-featured-media .ni-media-ph,
    .ni-card-media img,
    .ni-card-media .ni-media-ph {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    /* text column */
    .ni-featured-body,
    .ni-card-body {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
    }

    /* strip the hero's chrome so it matches a plain card */
    .ni-featured .ni-badges,
    .ni-featured .ni-read { display: none; }

    /* title: bold, 2-line clamp */
    .ni-featured-title,
    .ni-card-title {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: -.01em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* teaser: one muted line under the title */
    .ni-featured-dek,
    .ni-card-teaser {
        margin: 0;
        font-size: 13px;
        line-height: 1.45;
        color: var(--text-muted);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* date (the hero keeps it inside its foot; the read button is hidden above) */
    .ni-featured-foot {
        margin: 0;
        gap: 0;
    }
    .ni-featured .ni-date,
    .ni-card-date {
        font-family: 'IBM Plex Mono', monospace;
        font-size: 12px;
        color: var(--text-muted);
    }
}
