/* ─────────────────────────────────────────────────────────────────────
   Theme: "newspaper" — old-fashioned classified-ads look for Helsinki Live.

   Overrides the shared list components from site.html <style> with a dense,
   multi-column newspaper feel: flat rows (no cards/radius/shadow), thin
   hairlines between rows, vertical rules between columns (CSS multi-column
   column-rule), small-caps category/genre tags instead of color stripes,
   and masthead-style day labels.

   Scope: everything targets :is(body.theme-newspaper, body.theme-newspaper-compact) so other verticals are
   unaffected. The active theme's markup (event-paper rows) is generated by
   the Jinja macros + JS search/bookmark builders in site.html.
   ───────────────────────────────────────────────────────────────────── */

/* Wider layout for the multi-column list */
:is(body.theme-newspaper, body.theme-newspaper-compact) .container {
    max-width: 1080px;
}
:is(body.theme-newspaper, body.theme-newspaper-compact):has(.filter-bar) .container {
    max-width: 1200px;
}

/* ── Masthead-style section + day labels ── */
:is(body.theme-newspaper, body.theme-newspaper-compact) .section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text);
}

:is(body.theme-newspaper, body.theme-newspaper-compact) .day-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text);
    padding: 8px 0 6px;
    margin-bottom: 6px;
    border-bottom: 2px solid var(--text);
    background: var(--bg);
    backdrop-filter: none;
}

/* Classification headlines (MUSIIKKI / TEATTERI / TAIDE / ...) */
:is(body.theme-newspaper, body.theme-newspaper-compact) .category-group {
    margin: 48px 0 0;
    border-top: 3px double var(--border);
    padding-top: 16px;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .category-group:first-of-type {
    margin-top: 28px;
    border-top: none;
    padding-top: 0;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .category-group > .section-header {
    border-bottom: none;
    margin-bottom: 12px;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .category-group > .section-header .section-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1.1;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .category-group > .section-header .section-title::after {
    content: "";
    display: block;
    height: 2px;
    background: var(--text);
    margin-top: 6px;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .category-group > .section-header .section-count {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* ── Per-day classification (day heading first, then per-type/genre) ── */
:is(body.theme-newspaper, body.theme-newspaper-compact) .classified-group .day-items {
    margin-top: 2px;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .cat-block {
    break-inside: avoid;
    margin: 0 0 10px;
    min-width: 0;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .cat-head {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding: 4px 0 2px;
    margin: 0 0 2px;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .cat-count,
:is(body.theme-newspaper, body.theme-newspaper-compact) .genre-count {
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .genre-block {
    break-inside: avoid;
    margin: 2px 0 6px;
    min-width: 0;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .genre-head {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    padding: 3px 0 1px;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .cat-head,
:is(body.theme-newspaper, body.theme-newspaper-compact) .genre-head {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 639px) {
    :is(body.theme-newspaper, body.theme-newspaper-compact) .cat-head {
        font-size: 0.76rem;
    }
    :is(body.theme-newspaper, body.theme-newspaper-compact) .genre-head {
        font-size: 0.66rem;
    }
}

/* ── Nav pills: flat newspaper section tabs ── */
:is(body.theme-newspaper, body.theme-newspaper-compact) .nav-pills a {
    border-radius: 0;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    background: transparent;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .nav-pills a:hover {
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text);
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .nav-pills a.active {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

/* ── Flat filter bar ── */
:is(body.theme-newspaper, body.theme-newspaper-compact) .filter-bar {
    border-bottom: 1px solid var(--border);
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .today-genre-pill,
:is(body.theme-newspaper, body.theme-newspaper-compact) .today-expand {
    border-radius: 0;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) #venueFilter {
    border-radius: 0;
}

/* ── Multi-column list (true newspaper columns: top-to-bottom, then across) ── */
:is(body.theme-newspaper, body.theme-newspaper-compact) .today-group-items,
:is(body.theme-newspaper, body.theme-newspaper-compact) .day-items {
    display: block;                       /* drop the card grid */
    column-count: 1;
    column-gap: 28px;
    column-rule: 1px solid #dedede;
}
@media (min-width: 640px) and (max-width: 1023px) {
    :is(body.theme-newspaper, body.theme-newspaper-compact) .today-group-items,
    :is(body.theme-newspaper, body.theme-newspaper-compact) .day-items {
        column-count: 2;
    }
}
@media (min-width: 1024px) {
    :is(body.theme-newspaper, body.theme-newspaper-compact) .today-group-items,
    :is(body.theme-newspaper, body.theme-newspaper-compact) .day-items {
        column-count: 3;
    }
}

/* ── Paper row: date · time · title/venue · caps tags ── */
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper {
    display: grid;
    grid-template-columns: 3.2em 2.6em minmax(0, 1fr) auto;
    column-gap: 6px;
    align-items: baseline;
    padding: 5px 0;
    margin: 0;
    border: none;                         /* kill card chrome */
    border-left: none;
    border-bottom: 1px solid #e8e8e8;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    break-inside: avoid;
    text-decoration: none;
    color: var(--text);
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper:hover {
    background: var(--accent-soft);
    box-shadow: none;
    transform: none;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper.cancelled {
    opacity: 0.5;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper.cancelled .event-paper-title {
    text-decoration: line-through;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-date {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-time {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: break-word;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-venue {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-venue:empty {
    display: none;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-tags {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    white-space: nowrap;
    min-width: 0;
    padding-left: 8px;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-cat {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4a4a4a;
    max-width: 8em;
    overflow: hidden;
    text-overflow: ellipsis;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-tag {
    font-size: 0.56rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    max-width: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-tag.event-paper-facet {
    color: var(--facet-text, #6b5b00);
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-remove {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}
:is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-remove:hover {
    color: var(--accent);
}

/* ── Narrow screens: single column, hide the date cell (day label carries it) ── */
@media (max-width: 639px) {
    :is(body.theme-newspaper, body.theme-newspaper-compact) .today-group-items,
    :is(body.theme-newspaper, body.theme-newspaper-compact) .day-items {
        column-count: 1;
        column-rule: none;
    }
    :is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper {
        grid-template-columns: 2.6em minmax(0, 1fr) auto;
    }
    :is(body.theme-newspaper, body.theme-newspaper-compact) .event-paper-date {
        display: none;
    }
}