/* ═══════════════════════════════════════════════════
 *  BB News Aggregator — Front-End Styles
 *
 *  Design philosophy: "News Without Political Noise"
 *  ─────────────────────────────────────────────────
 *  Political news = noise. Boulder Bubble filters it.
 *
 *  Visual language:
 *  • Cool-grey background tint (vs Plugin 1's warm white)
 *  • Slightly muted text (distilled, calmer than typical news)
 *  • Source badges in brand colors — the only vibrant elements
 *  • Featured articles "surface" from the noise — warm accent
 *  • Filter bar as an editorial control — you choose what to see
 *
 * ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Root container ── */
.bb-news-agg-root {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #333;
    max-width: 100%;
}

/* ── Section heading ── */
.bb-na-heading {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #1a1a1a;
    letter-spacing: -0.01em;
    text-align: center;
}

.bb-na-subheading {
    display: none;
}

/* ── Filter bar ── */
.bb-na-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: #f6f7f8;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.04);
}

.bb-na-source-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.bb-na-source-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1.5px solid transparent;
    border-radius: 5px;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.bb-na-source-btn:hover {
    border-color: rgba(0,0,0,0.15);
}

.bb-na-source-btn.active {
    color: #1a1a1a;
    border-color: rgba(0,0,0,0.2);
    font-weight: 700;
    background: rgba(0,0,0,0.03);
}

.bb-na-source-btn .bb-na-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bb-na-source-btn.active .bb-na-dot {
    width: 7px;
    height: 7px;
}

.bb-na-search-wrap {
    position: relative;
    width: 200px;
}

.bb-na-search {
    width: 100%;
    padding: 0.4rem 0.7rem 0.4rem 2rem;
    border: 1.5px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}

.bb-na-search:focus {
    border-color: rgba(0,0,0,0.2);
}

.bb-na-search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #bbb;
    pointer-events: none;
}

/* ── Articles list ── */
.bb-na-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bb-na-list.bb-na-cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
}

/* ── Individual article card ── */
.bb-na-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.15s ease;
    position: relative;
}

.bb-na-item:last-child {
    border-bottom: none;
}

.bb-na-item:hover {
    background-color: rgba(0,0,0,0.012);
}

/* ── "Noise" treatment — muted, calm, filtered ── */
.bb-na-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    border-radius: 2px;
    background: #e0e2e5;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.bb-na-item:hover::before {
    opacity: 1;
}

/* ── Featured article — "surfaced from the noise" ── */
.bb-na-item.bb-na-featured {
    background: linear-gradient(135deg, rgba(255,248,235,0.6) 0%, rgba(255,243,224,0.3) 100%);
    border-bottom-color: rgba(212,168,67,0.1);
}

.bb-na-item.bb-na-featured::before {
    background: linear-gradient(180deg, #f5a623, #d4a843);
    opacity: 1;
}

.bb-na-featured-badge {
    display: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #d4a843;
    background: rgba(212,168,67,0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.4rem;
}

.bb-na-featured .bb-na-featured-badge {
    display: inline-block;
}

/* ── Thumbnail ── */
.bb-na-thumb-link {
    flex-shrink: 0;
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    /* Noise effect: slightly desaturated thumbnails */
    filter: saturate(0.7) contrast(0.95);
}

.bb-na-thumb-link:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    filter: saturate(1) contrast(1);
}

.bb-na-featured .bb-na-thumb-link {
    filter: saturate(0.9) contrast(1);
}

.bb-na-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    display: block;
}

/* Placeholder */
.bb-na-no-thumb {
    background: linear-gradient(135deg, #ebedf0 0%, #dfe1e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-na-placeholder-icon {
    width: 22px;
    height: 22px;
    color: #c0c4cc;
}

.bb-na-placeholder-icon svg {
    width: 100%;
    height: 100%;
}

/* ── Content ── */
.bb-na-content {
    flex: 1;
    min-width: 0;
}

/* ── Meta line: source badge + date ── */
.bb-na-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
    flex-wrap: wrap;
}

.bb-na-source-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    color: #fff;
    line-height: 1.5;
    /* Noise effect: slightly desaturated badges */
    filter: saturate(0.8);
    transition: filter 0.2s;
}

.bb-na-item:hover .bb-na-source-badge {
    filter: saturate(1);
}

.bb-na-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 400;
    color: #aaa;
}

/* ── Title ── */
.bb-na-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 0.9rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.45;
    color: #444;  /* Muted vs Plugin 1's #1a1a1a — "noise is quieter" */
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.bb-na-title:hover {
    color: #1a1a1a;
}

/* Featured titles are warmer — "surfaced signal" */
.bb-na-featured .bb-na-title {
    color: #2a2a2a;
    font-weight: 400;
}

.bb-na-featured .bb-na-title:hover {
    color: #4D4D4D;
}

/* ── Loading skeleton ── */
.bb-na-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bb-na-skeleton-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.bb-na-skeleton-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: bb-na-shimmer 1.5s infinite;
    flex-shrink: 0;
}

.bb-na-skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bb-na-skeleton-line {
    height: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: bb-na-shimmer 1.5s infinite;
}

.bb-na-skeleton-line.short { width: 40%; }
.bb-na-skeleton-line.medium { width: 75%; }
.bb-na-skeleton-line.long { width: 95%; }

@keyframes bb-na-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Empty / error states ── */
.bb-na-empty,
.bb-na-error {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #999;
    text-align: center;
    padding: 2.5rem 1rem;
}

.bb-na-error {
    color: #c0392b;
}

/* ── Article count ── */
.bb-na-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    color: #bbb;
    text-align: right;
    padding: 0.5rem 0.75rem 0;
    letter-spacing: 0.02em;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .bb-na-list.bb-na-cols-2 {
        grid-template-columns: 1fr;
    }

    .bb-na-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .bb-na-search-wrap {
        width: 100%;
    }

    .bb-na-thumb-link,
    .bb-na-thumb {
        width: 48px;
        height: 48px;
    }

    .bb-na-title {
        font-size: 0.82rem;
    }

    .bb-na-heading {
        font-size: 1.15rem;
    }
}

/* ── Numbered Pagination ── */
.bb-na-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.25rem 0 0.5rem;
}

.bb-na-page-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #555;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 2rem;
    text-align: center;
}

.bb-na-page-btn:hover {
    background: #f5f5f5;
    border-color: rgba(0,0,0,0.2);
}

.bb-na-page-btn.bb-na-page-active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
    font-weight: 700;
}

.bb-na-page-arrow {
    font-size: 1rem;
    padding: 0.35rem 0.55rem;
}

.bb-na-page-ellipsis {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #999;
    padding: 0 0.15rem;
}
