/* =============================================================
   ChatMMM News Strips (V2)
   Horizontal scroll rails of compact signal cards.
   Used for: Breaking Now, Your Watchlist, By Industry.
   ============================================================= */
@layer components {

    /* --- Section group wrapper for "By Industry" --- */
    .news-strip-group {
        display: flex;
        flex-direction: column;
        gap: 18px;
        margin-bottom: 22px;
    }
    .news-strip-group__head {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 4px 0 -4px;
        color: var(--text-muted);
        font-size: var(--fs-xs);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-weight: 700;
    }
    .news-strip-group__head i { font-size: 12px; }

    /* --- Single strip --- */
    .news-strip {
        margin-bottom: 22px;
    }
    .news-strip__head {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
    }
    .news-strip__title {
        font-size: var(--fs-md);
        font-weight: 700;
        color: var(--text-primary);
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin: 0;
    }
    .news-strip__title i {
        font-size: 13px;
        color: var(--brand-700);
    }
    .news-strip__count {
        font-size: 11px;
        font-weight: 700;
        color: var(--text-secondary);
        background: var(--surface-sunken);
        border: 1px solid var(--border-color);
        padding: 2px 8px;
        border-radius: 999px;
        line-height: 1.4;
    }
    .news-strip__action {
        margin-left: auto;
        font-size: var(--fs-xs);
        font-weight: 600;
        color: var(--brand-700);
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    .news-strip__action:hover { text-decoration: underline; }

    /* Variant: Breaking Now — accent header */
    .news-strip--breaking .news-strip__title i { color: #ef4444; animation: cmm-pulse 2.4s ease-in-out infinite; }
    @keyframes cmm-pulse {
        0%, 100% { opacity: 1; }
        50%      { opacity: 0.45; }
    }

    /* --- Horizontal rail --- */
    .news-strip__rail {
        position: relative;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 280px;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        padding: 4px 4px 12px;
        margin: 0 -4px;
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) transparent;
    }
    .news-strip__rail::-webkit-scrollbar { height: 8px; }
    .news-strip__rail::-webkit-scrollbar-track { background: transparent; }
    .news-strip__rail::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 4px;
    }
    .news-strip__rail::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

    /* --- Compact strip card --- */
    .news-strip__card {
        scroll-snap-align: start;
        display: grid;
        grid-template-rows: auto auto 1fr auto;
        gap: 8px;
        padding: 14px;
        background: var(--surface-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        text-decoration: none;
        color: inherit;
        position: relative;
        overflow: hidden;
        transition: transform var(--dur-fast) var(--ease-out),
                    box-shadow var(--dur-fast) var(--ease-out),
                    border-color var(--dur-fast) var(--ease-out);
        cursor: pointer;
        min-height: 132px;
    }
    .news-strip__card::before {
        content: '';
        position: absolute;
        inset: 0 auto 0 0;
        width: 3px;
        background: var(--border-color);
    }
    .news-strip__card[data-dir="bullish"]::before { background: var(--bull, #16a34a); }
    .news-strip__card[data-dir="bearish"]::before { background: var(--bear, #dc2626); }
    .news-strip__card[data-dir="neutral"]::before { background: var(--border-color); opacity: 0.5; }
    .news-strip__card:hover {
        transform: translateY(-2px);
        box-shadow: var(--elev-2);
        border-color: var(--brand-200);
    }

    /* Gold is reserved for the lock badge (.cmm-lock-pill, shell.css): the old
       gold star / --prominent chrome was deleted — placement in the lead rail
       IS the prominence marker. */

    /* Hover-reveal "save bookmark" on a strip card (card is position:relative). */
    .news-strip__card-bookmark {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 24px;
        height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: none;
        border-radius: 7px;
        background: var(--surface-card);
        color: var(--text-muted);
        font-size: 12px;
        line-height: 1;
        cursor: pointer;
        opacity: 0;
        z-index: 4;
        transition: opacity var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
    }
    .news-strip__card:hover .news-strip__card-bookmark,
    .news-strip__card-bookmark:focus-visible { opacity: 1; }
    .news-strip__card-bookmark:hover { color: var(--brand-600); background: var(--brand-50, #eef2ff); }
    .news-strip__card-bookmark.is-saved { opacity: 1; color: var(--brand-600); }

    .news-strip__card-head {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .news-strip__card-sym {
        font-weight: 700;
        font-size: var(--fs-xs);
        letter-spacing: 0.02em;
        color: var(--brand-700);
        background: var(--brand-50);
        padding: 3px 8px;
        border-radius: 6px;
    }
    .news-strip__card-industry {
        font-size: 10px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .news-strip__card-new {
        margin-left: auto;
        font-size: 10px;
        font-weight: 700;
        color: #fff;
        background: var(--brand-700);
        padding: 2px 7px;
        border-radius: 999px;
    }

    .news-strip__card-row {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: var(--fs-sm);
    }
    .news-strip__card-dir {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-weight: 600;
        font-size: 11px;
        padding: 2px 8px;
        border-radius: 999px;
    }
    .news-strip__card[data-dir="bullish"] .news-strip__card-dir {
        color: var(--bull-strong, #047857);
        background: var(--bull-soft, #d1fae5);
    }
    .news-strip__card[data-dir="bearish"] .news-strip__card-dir {
        color: var(--bear-strong, #b91c1c);
        background: var(--bear-soft, #fee2e2);
    }
    .news-strip__card[data-dir="neutral"] .news-strip__card-dir {
        color: var(--text-muted);
        background: var(--surface-sunken);
    }
    .news-strip__card-pct {
        font-variant-numeric: tabular-nums;
        font-weight: 700;
        font-size: var(--fs-sm);
        margin-left: auto;
    }
    .news-strip__card[data-dir="bullish"] .news-strip__card-pct { color: var(--bull-strong, #047857); }
    .news-strip__card[data-dir="bearish"] .news-strip__card-pct { color: var(--bear-strong, #b91c1c); }
    .news-strip__card[data-dir="neutral"] .news-strip__card-pct { color: var(--text-muted); }

    .news-strip__card-headline {
        font-size: var(--fs-sm);
        color: var(--text-primary);
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 0;
    }
    .news-strip__card-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 11px;
        color: var(--text-muted);
    }
    .news-strip__card-pill {
        font-size: 9px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        padding: 2px 6px;
        border-radius: 4px;
    }
    .news-strip__card-pill--live {
        color: #166534;
        background: #dcfce7;
    }

    /* --- Skeleton --- */
    .news-strip__skel {
        scroll-snap-align: start;
        min-height: 132px;
        background: linear-gradient(90deg,
            var(--surface-sunken) 0%, var(--surface-card) 50%, var(--surface-sunken) 100%);
        background-size: 200% 100%;
        border-radius: 12px;
        animation: cmm-shimmer 1.6s ease-in-out infinite;
    }
    @keyframes cmm-shimmer {
        0%   { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }

    /* Latest section header (matches strip header style) */
    .news-latest__head {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 6px 0 12px;
    }
    .news-latest__title {
        font-size: var(--fs-md);
        font-weight: 700;
        color: var(--text-primary);
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin: 0;
    }
    .news-latest__title i { font-size: 13px; color: var(--text-muted); }
    .news-latest__count {
        font-size: 11px;
        font-weight: 700;
        color: var(--text-secondary);
        background: var(--surface-sunken);
        border: 1px solid var(--border-color);
        padding: 2px 8px;
        border-radius: 999px;
    }

    /* --- Mobile: smaller cards --- */
    @media (max-width: 640px) {
        .news-strip__rail {
            grid-auto-columns: 240px;
        }
        .news-strip__card { min-height: 124px; padding: 12px; }
    }
}
