/* ============================================================
   JP News (جهينة نيوز) — finaldesign «الشبكة» — listing.css
   The listing family (2026-09-28): the FEED (sub-section page,
   the no-children section page), the lead story above a feed, the
   curated SECTION front (lead package · one band per child ·
   opinion strip · video strip) and the tribune's author-led items.
   Loaded after interior.css on subsection.html, section.html and
   section-no-subs.html only.
   ============================================================ */

/* ------------------------------------------------------------
   LEAD STORY above a feed — the home's large image card, one step
   bigger: kicker · h2 · dek · time beside a 16:9 picture. From 768
   the picture takes 3/5 of the column and the text 2/5, so the
   picture is never wider than its 640px derivative (no upscaling
   — the captured library tops out at 888px).
   ------------------------------------------------------------ */
.feed-lead {
    margin-block-end: var(--space-lg);
}

.feed-lead .card-body {
    min-inline-size: 0;
}

@media (min-width: 768px) {
    .feed-lead .card-link {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        gap: var(--space-md);
        align-items: start;
    }

    .feed-lead .card-kicker {
        margin-block-start: 0;
    }
}

.feed-lead .card-title {
    font-size: var(--fs-feature);
    font-weight: 800;
    line-height: 1.35;
}

.feed-lead .card-dek {
    font-size: var(--fs-md);
    margin-block-start: var(--space-sm);
}

/* ------------------------------------------------------------
   FEED — hairline rows, one link per row (the home's card grammar:
   nothing interactive inside the link). Thumb column 120 / 160 /
   200px at <576 / 576–767 / ≥768; the dek hides on phones.
   A row without a picture spans the whole width — no empty box.
   ------------------------------------------------------------ */
.feed-list {
    display: flex;
    flex-direction: column;
    --feed-thumb: 120px;
}

.feed-item + .feed-item {
    border-block-start: 1px solid var(--color-border);
}

.feed-link {
    display: grid;
    grid-template-columns: var(--feed-thumb) minmax(0, 1fr);
    gap: var(--space-md);
    align-items: start;
    padding-block: var(--space-md);
    min-block-size: 44px;
}

.feed-item-noimage .feed-link {
    grid-template-columns: minmax(0, 1fr);
}

.feed-media {
    display: block;
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-card);
}

.feed-media img {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
}

.feed-body {
    display: block;
    min-inline-size: 0;
}

/* The kicker line: subcategory kicker, or a badge, then the time at the end */
.feed-kicker-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs) var(--space-sm);
    margin-block-end: var(--space-xs);
}

.feed-kicker-line .kicker {
    margin-block-end: 0;
}

.feed-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--fs-thumb);
    line-height: 1.5;
}

.feed-link:hover .feed-title,
.feed-link:focus-visible .feed-title {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.feed-dek {
    display: none;                  /* phones: density first */
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-block-start: var(--space-xs);
}

.feed-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs) var(--space-sm);
    margin-block-start: var(--space-xs);
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

.feed-meta .icon-sm {
    inline-size: 14px;
    block-size: 14px;
}

/* «تغطية مستمرة» — continuing coverage. An OUTLINED chip with a
   STATIC dot in the category colour and the «آخر تحديث» time in the
   same colour. No pulse, no red, no «مباشر»: the 2026-09-03 «no
   live/on-air» ruling stands; this marks an updating story, not a
   broadcast. */
.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-block-size: 24px;
    padding-inline: 10px;
    border: 1px solid var(--cat, var(--color-text));
    border-radius: var(--radius-chip);
    color: var(--cat, var(--color-text));
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: var(--fs-xs);
    line-height: 1;
    white-space: nowrap;
}

.badge-live::before {
    content: '';
    inline-size: 8px;
    block-size: 8px;
    border-radius: 50%;
    background-color: var(--cat, var(--color-text));
}

.feed-time-live {
    color: var(--cat, var(--color-text));
    font-weight: 700;
}

/* The in-feed ad row keeps the hairline rhythm */
.feed-item-ad {
    padding-block: 0;
}

.feed-item-ad .ad-inread {
    margin-block: 0;
    border-block: 0;
}

@media (min-width: 576px) {
    .feed-list {
        --feed-thumb: 160px;
    }

    .feed-dek {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
    }

    .feed-title {
        font-size: var(--fs-lg);
        line-height: 1.45;
    }
}

@media (min-width: 768px) {
    .feed-list {
        --feed-thumb: 200px;
    }
}

/* ------------------------------------------------------------
   TRIBUNE feed (منبر جهينة) — author-led rows: a 64px portrait in
   the thumb column, the byline on the kicker line. Same component,
   one modifier.
   ------------------------------------------------------------ */
.feed-list-tribune {
    --feed-thumb: 64px;
}

.feed-list-tribune .feed-media {
    border-radius: 50%;
}

.feed-list-tribune .byline {
    margin-block-end: 0;
}

/* Tribune lead package: one lead + two secondary pieces, author first */
.tribune-lead {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
    margin-block-end: var(--space-lg);
}

.tribune-piece {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    background-color: var(--color-bg-alt);
    border-block-start: 4px solid var(--cat, var(--color-text));
    border-radius: var(--radius-card);
    min-inline-size: 0;
}

.tribune-piece .card-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    block-size: 100%;
}

.tribune-author {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.tribune-portrait {
    inline-size: 48px;
    block-size: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.tribune-author-text {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
}

.tribune-piece .byline {
    margin-block-end: 0;
}

.tribune-piece .card-title {
    margin-block-start: 0;
}

.tribune-piece-lead .card-title {
    font-size: var(--fs-card-lg);
    font-weight: 800;
}

.tribune-piece .card-dek {
    margin-block-start: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

@media (min-width: 768px) {
    .tribune-lead {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tribune-piece-lead {
        grid-row: 1 / span 2;
    }
}

/* ------------------------------------------------------------
   SECTION FRONT (section.html)
   Lead package: one overlay lead (2 of 3 columns) + three thumb rows.
   ------------------------------------------------------------ */
.lead-package {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--zone-gap);
    margin-block-end: var(--space-lg);
}

.lead-package-side {
    --thumb-w: 120px;
}

.lead-package-side .thumb-list > li:first-child {
    border-block-start: 1px solid var(--color-border);
}

@media (min-width: 768px) {
    .lead-package {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        align-items: start;
    }

    .lead-package-side .thumb-list > li:first-child {
        border-block-start: 0;
    }

    .lead-package-side .thumb-row:first-child .thumb-link {
        padding-block-start: 0;
    }
}

@media (min-width: 1200px) {
    .lead-package-side {
        --thumb-w: 140px;
    }
}

/* Wide screens: the lead stops at its largest derivative (870px) and the
   side rows take the rest — nothing is ever upscaled */
@media (min-width: 1400px) {
    .lead-package {
        grid-template-columns: minmax(0, 870px) minmax(0, 1fr);
    }
}

/* One band per child subcategory: label row, 4 cards, «المزيد» */
.band {
    padding-block: var(--space-lg);
    border-block-start: 1px solid var(--color-border);
}

.band-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
}

@media (min-width: 576px) {
    .band-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .band-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .band-grid .card-link {
        display: grid;
        /* grid-template-columns: 120px minmax(0, 1fr); */
        gap: var(--space-md);
        align-items: start;
    }

    .band-grid .card-title,
    .band-grid .card-kicker {
        margin-block-start: 0;
    }

    .band-grid .card-media {
        border-radius: var(--radius-card);
    }
}

/* In-band ad seams reuse the home tiers; a little more air between bands */
.band + .ad-slot,
.ad-slot + .band {
    border-block-start: 0;
}
