﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    color: #222;
    padding: 2rem;
    font-size: 14px;
}

.page-header {
    margin-bottom: 2rem;
}

    .page-header h1 {
        font-size: 1.75rem;
        font-weight: 700;
        color: #111;
        margin-bottom: 0.25rem;
    }

    .page-header p {
        color: #888;
        font-size: 0.85rem;
    }

/* Summary strip */
.summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.summary-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    min-width: 130px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

    .summary-card strong {
        display: block;
        font-size: 2rem;
        font-weight: 700;
        color: #1a1a1a;
        line-height: 1.1;
    }

    .summary-card span {
        display: block;
        font-size: 0.75rem;
        color: #888;
        margin-top: 0.25rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

/* Ad blocks */
.ad-block {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.ad-block__header {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

/* Toggle button covering header area */
.ad-block__toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

    .ad-block__toggle:focus {
        outline: 3px solid rgba(37,99,235,0.15);
        outline-offset: 2px;
    }

.ad-block__name {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    flex: 1;
}

.ad-block__meta {
    padding: 0.5rem 1.25rem;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.8rem;
    color: #777;
    display: flex;
    gap: 2rem;
}

.ad-block__body {
    padding: 1rem 1.25rem;
}

/* Tags & categories */
.ad-tags, .ad-cats {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.85rem;
}

.tag-badge {
    display: inline-block;
    background: #eef2ff;
    color: #3730a3;
    padding: 0.18rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
}

.cat-badge {
    display: inline-block;
    background: #ecfdf5;
    color: #065f46;
    padding: 0.18rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Chevron indicator */
.ad-block__chev {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    transition: transform .18s ease;
    color: #6b7280;
    flex-shrink: 0;
}

.ad-block.is-expanded .ad-block__chev {
    transform: rotate(90deg);
}

/* Hidden when collapsed */
.ad-block.is-collapsed .ad-block__body {
    display: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge--active {
    background: #d1fae5;
    color: #065f46;
}

.badge--expired {
    background: #fee2e2;
    color: #991b1b;
}

.badge--soon {
    background: #fef3c7;
    color: #92400e;
}

.badge--noexpiry {
    background: #e5e7eb;
    color: #374151;
}

/* Article list */
.article-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.875rem;
}

    .article-list__item:last-child {
        border-bottom: none;
    }

    .article-list__item a {
        color: #2563eb;
        text-decoration: none;
        font-weight: 500;
    }

        .article-list__item a:hover {
            text-decoration: underline;
        }

    .article-list__item .url {
        font-size: 0.75rem;
        color: #aaa;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 300px;
    }

.article-count {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.no-match {
    color: #aaa;
    font-style: italic;
    font-size: 0.875rem;
}

/* Left border colour by status */
.ad-block--active {
    border-left: 4px solid #10b981;
}

.ad-block--expired {
    border-left: 4px solid #ef4444;
}

.ad-block--soon {
    border-left: 4px solid #f59e0b;
}

.ad-block--noexpiry {
    border-left: 4px solid #9ca3af;
}

.ad-cats-tags {
    padding: 20px 20px 10px;
}
