/* ═════════════════════════════════════════════════════════════════════════
   TBF Programme — front-end stylesheet
   Scoped to `.tbf-programme` and `.tbf-hero-now`. Brand tokens live on the
   root container so each shortcode renders independently even on the same
   page. WordPress themes won't collide because every class is prefixed.
   ═════════════════════════════════════════════════════════════════════════ */

.tbf-programme, .tbf-hero-now, .tbf-ongoing {
    --tbf-black:   #000000;
    --tbf-text:    #7a7a7a;
    --tbf-yellow:  #FEFF06;
    --tbf-border:  #e5e5e5;
    --tbf-surface: #ffffff;
    --tbf-subtle:  #f6f6f6;
    --tbf-accent:  #195afe;
    --tbf-radius:  4px;
    --tbf-font:    "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --wp-header-height: 64px;

    font-family: var(--tbf-font);
    color: var(--tbf-black);
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}
.tbf-programme *, .tbf-hero-now *, .tbf-ongoing * { box-sizing: border-box; }

/* ── Hero ("Τι γίνεται τώρα;") ────────────────────────────────────────── */
.tbf-hero-now {
    background: #000; color: #fff;
    padding: 28px 24px 32px;
    border-bottom: 4px solid var(--tbf-yellow);
}
.tbf-hero-now[hidden] { display: none; }
.tbf-hero-inner { max-width: 1140px; margin: 0 auto; }
.tbf-hero-now h2 { color: #fff; font-size: 22px; margin: 0 0 6px; font-weight: 700; }
.tbf-hero-description {
    color: #ddd; font-size: 14px; line-height: 1.5;
    margin: 0 0 12px;
}
.tbf-hero-cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--tbf-yellow, #FEFF06); color: var(--tbf-black);
    padding: 10px 18px; border-radius: 4px;
    text-decoration: none; font-weight: 700; font-size: 13px;
    margin-bottom: 18px;
    transition: transform .1s ease, box-shadow .15s ease;
}
.tbf-hero-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(254,255,6,.25); color: var(--tbf-black); }
.tbf-hero-meta { font-size: 13px; color: #bbb; margin-bottom: 18px; }

/* When a .tbf-hero-now CTA scrolls to #tbf-programme, offset for the
   theme's sticky menu so the catalogue doesn't land under it.
   Override --wp-header-height in page CSS if your theme uses a different
   sticky-header height. */
.tbf-programme { scroll-margin-top: 80px; }
@media (max-width: 720px) { .tbf-programme { scroll-margin-top: 10px; } }

.tbf-hero-timeline .tbf-time-slot {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,.12);
}
.tbf-hero-timeline .tbf-time-slot:first-child { border-top: 0; }
.tbf-hero-timeline .tbf-slot-time {
    font-weight: 700; color: var(--tbf-yellow);
    padding-top: 10px; font-size: 14px;
}
.tbf-hero-timeline .tbf-slot-time small {
    display: block; font-weight: 400; color: rgba(255,255,255,.55);
    font-size: 11px; margin-top: 2px;
}
.tbf-hero-timeline .tbf-time-slot-events { display: grid; gap: 10px; }

/* Dark-themed cards inside the hero */
.tbf-hero-now .tbf-ev-card {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.12);
    color: #eee;
}
.tbf-hero-now .tbf-ev-card:hover { border-color: var(--tbf-yellow); }
.tbf-hero-now .tbf-ev-card h3 { color: #fff; }
.tbf-hero-now .tbf-ev-card .tbf-speaker { color: #aaa; }
.tbf-hero-now .tbf-ev-card .tbf-badge.tbf-venue {
    background: transparent; color: #fff; border-color: rgba(255,255,255,.35);
}
.tbf-hero-now .tbf-ev-card .tbf-badge.tbf-venue--off {
    color: #fca5a5; border-color: #fca5a5;
}
.tbf-hero-now .tbf-ev-card .tbf-badge.tbf-audience {
    background: rgba(255,255,255,.08); color: #ddd; border-color: rgba(255,255,255,.15);
}
.tbf-hero-now .tbf-ev-card .tbf-badge.tbf-org {
    background: transparent; color: #aaa; border-color: rgba(255,255,255,.15);
}
.tbf-hero-now .tbf-ev-card .tbf-badge.tbf-event-type {
    background: var(--tbf-accent); color: #fff; border: 0;
}
.tbf-hero-now .tbf-ev-card .tbf-badge.tbf-prog {
    background: #333; color: #fff;
}

.tbf-live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: #e11d48;
    border-radius: 50%;
    margin-right: 6px;
    animation: tbf-live-dot 1.5s infinite;
}

/* ── [tbf_now layout="carousel"] ─────────────────────────────────────────
   Pure-CSS horizontal carousel: one card per view, native scroll-snap,
   touch + keyboard + mouse-wheel friendly. Arrow buttons are positioned
   as overlays on the sides; the JS enhances them with smooth-scroll
   navigation and optional auto-rotate. */
.tbf-carousel {
    width: 100%;
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr auto auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 10px;
    align-items: center;
}
.tbf-carousel-track {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0;
}
.tbf-carousel-track::-webkit-scrollbar { display: none; }
.tbf-carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
    box-sizing: border-box;
}
.tbf-carousel-slide > .tbf-ev-card { width: 100%; }

.tbf-carousel-arrow {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(0,0,0,.65);
    color: var(--tbf-yellow, #FEFF06);
    font-family: inherit;
    font-size: 22px; line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease, opacity .2s ease;
    padding: 0; /* override theme button paddings */
}
.tbf-carousel-arrow:hover  { background: rgba(0,0,0,.85); }
.tbf-carousel-arrow:focus  { outline: 2px solid var(--tbf-yellow, #FEFF06); outline-offset: 2px; }
.tbf-carousel-arrow[disabled] { opacity: .3; cursor: default; }
.tbf-carousel-prev { grid-column: 2; grid-row: 2; }
.tbf-carousel-next { grid-column: 3; grid-row: 2; }

/* On light background variants (.tbf-hero-now--carousel keeps dark bg,
   but if the shortcode is used elsewhere the arrows adapt via currentColor
   + neutral background). */
.tbf-hero-now--carousel .tbf-carousel-arrow { background: rgba(255,255,255,.1); }
.tbf-hero-now--carousel .tbf-carousel-arrow:hover { background: rgba(255,255,255,.2); }

/* ── [tbf_now theme="light"] ──────────────────────────────────────────────
   Transparent-bg variant for placing the hero on themed pages. Mirrors the
   catalogue palette (white cards, gray text, blue slot-times) instead of
   the default dark hero. */
.tbf-hero-now--light { background: transparent; color: var(--tbf-black); border-bottom: 0; }
.tbf-hero-now--light h2 { color: var(--tbf-black); }
.tbf-hero-now--light .tbf-hero-description { color: var(--tbf-text); }
.tbf-hero-now--light .tbf-hero-meta { color: var(--tbf-text); }
.tbf-hero-now--light .tbf-hero-cta { background: var(--tbf-black); color: #fff; }
.tbf-hero-now--light .tbf-hero-cta:hover { box-shadow: 0 6px 18px rgba(0,0,0,.15); color: #fff; }
.tbf-hero-now--light .tbf-hero-timeline .tbf-time-slot { border-top-color: var(--tbf-border); }
.tbf-hero-now--light .tbf-hero-timeline .tbf-slot-time { color: var(--tbf-accent); }
.tbf-hero-now--light .tbf-hero-timeline .tbf-slot-time small { color: var(--tbf-text); }
.tbf-hero-now--light .tbf-ev-card {
    background: #fff; border-color: var(--tbf-border); color: var(--tbf-black);
}
.tbf-hero-now--light .tbf-ev-card:hover { border-color: var(--tbf-black); }
.tbf-hero-now--light .tbf-ev-card h3 { color: var(--tbf-black); }
.tbf-hero-now--light .tbf-ev-card .tbf-speaker { color: var(--tbf-text); }
.tbf-hero-now--light .tbf-ev-card .tbf-badge.tbf-venue {
    background: transparent; color: var(--tbf-black); border-color: var(--tbf-border);
}
.tbf-hero-now--light .tbf-ev-card .tbf-badge.tbf-venue--off {
    color: #b91c1c; border-color: #b91c1c;
}
.tbf-hero-now--light .tbf-ev-card .tbf-badge.tbf-audience {
    background: var(--tbf-subtle); color: var(--tbf-text); border-color: var(--tbf-border);
}
.tbf-hero-now--light .tbf-ev-card .tbf-badge.tbf-org {
    background: transparent; color: var(--tbf-text); border-color: var(--tbf-border);
}
.tbf-hero-now--light .tbf-ev-card .tbf-badge.tbf-event-type {
    background: var(--tbf-accent); color: #fff; border: 0;
}
.tbf-hero-now--light .tbf-ev-card .tbf-badge.tbf-prog {
    background: var(--tbf-subtle); color: var(--tbf-black);
}
/* Carousel arrows on the light variant */
.tbf-hero-now--light.tbf-hero-now--carousel .tbf-carousel-arrow {
    background: rgba(0,0,0,.06); color: var(--tbf-black);
}
.tbf-hero-now--light.tbf-hero-now--carousel .tbf-carousel-arrow:hover {
    background: rgba(0,0,0,.14);
}
.tbf-hero-now--light.tbf-hero-now--carousel .tbf-carousel-arrow:focus {
    outline-color: var(--tbf-black);
}
@keyframes tbf-live-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(1.4); }
}

/* ── Catalogue (full programme) ───────────────────────────────────────── */
.tbf-programme { display: block; }
.tbf-sticky-sentinel { height: 1px; }

.tbf-sticky-controls {
    position: sticky;
    top: var(--wp-header-height);
    z-index: 10;
    background: #e9e9e9;
    padding: 12px 16px 10px;
    margin: 0 0 16px;
    transition: box-shadow .2s ease, border-color .2s ease;
    border-bottom: 1px solid transparent;
}
.tbf-sticky-controls.is-stuck {
    box-shadow: 0 6px 14px rgba(0,0,0,.07);
    border-bottom-color: var(--tbf-border);
}

/* Programme chips */
.tbf-prog-chips {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.tbf-prog-chip {
    font: inherit;
    background: #fff;
    border: 2px solid var(--tbf-border);
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: var(--tbf-text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all .18s ease;
}
.tbf-prog-chip:hover { transform: translateY(-1px); border-color: var(--tbf-black); color: var(--tbf-black); }
.tbf-prog-chip.active { background: var(--tbf-black); color: #fff; border-color: var(--tbf-black); }
.tbf-prog-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tbf-black); }
.tbf-prog-chip .cnt {
    background: var(--tbf-subtle); color: var(--tbf-text);
    font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700;
    margin-left: 4px;
}
.tbf-prog-chip.active .cnt { background: var(--tbf-yellow); color: var(--tbf-black); }
.tbf-prog-chip--general-cultural .dot     { background: var(--tbf-black); }
.tbf-prog-chip--children-young-adults .dot{ background: #FFBC7D; }
.tbf-prog-chip--professional .dot         { background: #195AFE; }
.tbf-prog-chip--guest-of-honour .dot      { background: #bb19fe; }
.tbf-prog-chip--parallel-events .dot      { background: #10b981; }

/* Day pills */
.tbf-day-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tbf-day-pill {
    background: #fff; border: 1.5px solid var(--tbf-border);
    padding: 8px 14px; border-radius: 99px; font: inherit; font-size: 13px;
    cursor: pointer; font-weight: 500; position: relative;
    text-decoration: none; color: inherit;
    transition: all .15s ease; white-space: nowrap;
    display: inline-block;
}
.tbf-day-pill:hover { border-color: var(--tbf-black); }
.tbf-day-pill.active { background: var(--tbf-black); color: #fff; border-color: var(--tbf-black); }
.tbf-day-pill.today::before {
    content: "●"; color: var(--tbf-accent); font-size: 9px;
    margin-right: 5px; animation: tbf-live-dot 1.5s infinite;
    display: inline-block;
}
.tbf-day-pill.active.today::before { color: var(--tbf-yellow); }
.tbf-day-pill strong { font-weight: 700; }
.tbf-day-pill.all-days { background: var(--tbf-subtle); }
.tbf-day-pill.all-days.active { background: var(--tbf-black); color: #fff; }
.tbf-day-pill .cnt {
    background: var(--tbf-subtle); color: var(--tbf-text);
    font-size: 10px; padding: 1px 6px; border-radius: 999px;
    margin-left: 4px; font-weight: 700;
}
.tbf-day-pill.active .cnt { background: var(--tbf-yellow); color: var(--tbf-black); }

/* Filter bar */
/*
 * Filter bar morph: when the sticky sentinel is still in view (no
 * `.is-stuck`), search spans the top row and the 5 facets sit below.
 * When scrolled past and the bar is stuck, everything collapses to
 * a single row so we give the catalogue more vertical breathing room.
 * Grid-template-areas is a discrete change (no smooth tween available),
 * but it flips at the scroll threshold — a natural moment for the layout
 * to settle into its compact form.
 */
.tbf-filter-bar {
    display: grid;
    gap: 8px; margin: 0;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto;
    grid-template-areas:
        "search    search   search   search    search   clear"
        "organizer pavilion room     audience  etype    clear";
}
.tbf-filter-bar .tbf-f-search    { grid-area: search; }
.tbf-filter-bar .tbf-f-etype     { grid-area: etype; }
.tbf-filter-bar .tbf-f-pavilion  { grid-area: pavilion; }
.tbf-filter-bar .tbf-f-room      { grid-area: room; }
.tbf-filter-bar .tbf-f-audience  { grid-area: audience; }
.tbf-filter-bar .tbf-f-organizer { grid-area: organizer; }
.tbf-filter-bar .tbf-f-clear     { grid-area: clear; align-self: stretch; display: inline-flex; align-items: center; justify-content: center; }

/* Compact single row when stuck */
.tbf-sticky-controls.is-stuck .tbf-filter-bar {
    grid-template-columns: 1.6fr 1.2fr 1fr 1fr 1fr 1fr auto;
    grid-template-areas: "search organizer pavilion room audience etype clear";
}
.tbf-filter-bar input, .tbf-filter-bar select {
    padding: 10px 12px; border: 1px solid var(--tbf-border);
    border-radius: var(--tbf-radius); font: inherit; background: #fff; font-size: 13px;
    min-width: 0;
}
.tbf-filter-bar input:focus, .tbf-filter-bar select:focus {
    outline: 2px solid var(--tbf-yellow); border-color: var(--tbf-black);
}
.tbf-filter-clear {
    background: transparent; border: 1px solid var(--tbf-border);
    padding: 10px 14px; font: inherit; font-size: 13px; cursor: pointer;
    border-radius: var(--tbf-radius); font-weight: 500; white-space: nowrap;
    color: inherit; text-decoration: none; display: inline-flex; align-items: center;
}
.tbf-filter-clear:hover { border-color: var(--tbf-black); background: #f6f6f6; }

.tbf-ta-input { position: relative; }
.tbf-ta-input input { padding-right: 34px; width: 100%; }
.tbf-ta-input .tbf-caret {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--tbf-text);
}

.tbf-mobile-trigger { display: none; }

/* Day group + time slot */
.tbf-day-group { margin-top: 26px; }
.tbf-day-group:first-child { margin-top: 10px; }
.tbf-day-group-header {
    display: flex; align-items: baseline; gap: 12px;
    border-bottom: 2px solid var(--tbf-black); padding-bottom: 6px; margin-bottom: 12px;
}
.tbf-day-group-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.tbf-day-group-header .count { color: var(--tbf-text); font-size: 12px; }

.tbf-time-slot {
    display: grid; grid-template-columns: 78px 1fr; gap: 14px;
    padding: 12px 0; border-top: 1px solid var(--tbf-border);
}
.tbf-time-slot:first-child { border-top: 0; }
.tbf-slot-time { font-weight: 700; color: var(--tbf-accent); padding-top: 10px; font-size: 14px; }
.tbf-slot-time small { display: block; font-weight: 400; color: var(--tbf-text); font-size: 11px; margin-top: 2px; }
.tbf-time-slot-events { display: grid; gap: 10px; }

.tbf-empty-state { padding: 40px 20px; text-align: center; color: var(--tbf-text); }

/* Day-pager (prev / next day) at the foot of each day group */
.tbf-day-pager {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; margin-top: 18px; padding-top: 14px;
    border-top: 1px dashed var(--tbf-border);
}
.tbf-day-pager-prev, .tbf-day-pager-next { min-width: 0; }
.tbf-day-pager a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border: 1.5px solid var(--tbf-border);
    border-radius: 99px; font: inherit; font-size: 12px; font-weight: 500;
    color: var(--tbf-black); text-decoration: none; background: #fff;
    transition: border-color .15s, transform .1s;
}
.tbf-day-pager a:hover { border-color: var(--tbf-black); transform: translateY(-1px); }
.tbf-day-pager-arrow { color: var(--tbf-text); font-weight: 700; }
.tbf-day-pager a:hover .tbf-day-pager-arrow { color: var(--tbf-black); }

/* Event card */
.tbf-ev-card {
    background: #fff;
    border: 1px solid var(--tbf-border);
    border-radius: var(--tbf-radius);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 14px;
    align-items: start;
    transition: border-color .15s, transform .1s;
    cursor: pointer;
}
.tbf-ev-card:hover { border-color: var(--tbf-black); transform: translateY(-1px); }
.tbf-ev-card .tbf-time {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
}
.tbf-ev-card .tbf-time small { display: block; font-weight: 400; color: var(--tbf-text); font-size: 11px; margin-top: 2px; }
.tbf-ev-card .tbf-body { min-width: 0; }
.tbf-ev-card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.tbf-ev-card .tbf-speaker { color: var(--tbf-text); font-size: 12px; margin-bottom: 8px; }
.tbf-ev-card .tbf-meta { display: flex; flex-wrap: wrap; gap: 4px; }

/* Badges */
.tbf-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 2px;
    font-weight: 500;
    white-space: nowrap;
}
.tbf-badge.tbf-venue      { background: transparent; color: var(--tbf-black); border: 1px solid var(--tbf-black); }
.tbf-badge.tbf-venue--off {
    background: #FEE; color: #991b1b; border-color: #991b1b; font-style: italic;
    white-space: normal; word-break: break-word; line-height: 1.3; max-width: 100%;
}
.tbf-badge.tbf-audience   { background: var(--tbf-subtle); color: var(--tbf-black); border: 1px solid var(--tbf-border); }
.tbf-badge.tbf-org        {
    background: transparent; color: var(--tbf-text); border: 1px dashed var(--tbf-border);
    font-weight: 400; font-size: 10px;
    /* Organizer strings can be very long ("ΠΑΝΕΠΙΣΤΗΜΙΑΚΕΣ ΕΚΔΟΣΕΙΣ …") —
       allow wrapping so the badge doesn't push the card past the viewport. */
    white-space: normal; overflow-wrap: anywhere; line-height: 1.3; max-width: 100%;
}
.tbf-badge.tbf-prog       { background: var(--tbf-black); color: #fff; }
.tbf-badge.tbf-prog--general-cultural      { background: var(--tbf-black); color: #fff; }
.tbf-badge.tbf-prog--children-young-adults { background: #FFBC7D; color: var(--tbf-black); }
.tbf-badge.tbf-prog--professional          { background: #195AFE; color: #fff; }
.tbf-badge.tbf-prog--guest-of-honour       { background: #bb19fe; color: #fff; }
.tbf-badge.tbf-prog--parallel-events       { background: #10b981; color: #fff; }
.tbf-badge.tbf-event-type { background: var(--tbf-accent); color: #fff; border: 0; font-weight: 600; }

/* ── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .tbf-programme, .tbf-hero-now { --wp-header-height: 52px; }

    .tbf-hero-now { padding: 20px 14px 22px; }
    .tbf-hero-now h2 { font-size: 17px; }
    .tbf-hero-meta { font-size: 12px; margin-bottom: 14px; }
    .tbf-hero-timeline .tbf-time-slot {
        grid-template-columns: 1fr; gap: 0; padding: 10px 0;
    }
    .tbf-hero-timeline .tbf-slot-time { display: none; }

    .tbf-sticky-controls { padding: 10px 14px 8px; }

    .tbf-prog-chips {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        margin: 0 -14px 8px; padding: 0 14px 4px;
    }
    .tbf-prog-chips::-webkit-scrollbar { display: none; }
    .tbf-prog-chip { flex: 0 0 auto; font-size: 12px; padding: 8px 14px; }

    .tbf-day-pills {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        margin: 0 -14px 8px; padding: 0 14px 4px;
    }
    .tbf-day-pills::-webkit-scrollbar { display: none; }
    .tbf-day-pill { flex: 0 0 auto; }

    .tbf-filter-bar { display: none; }

    .tbf-mobile-trigger {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; background: #fff; border: 1.5px solid var(--tbf-black);
        padding: 11px 14px; font: inherit; font-size: 14px; font-weight: 500;
        border-radius: var(--tbf-radius); margin: 0; cursor: pointer; gap: 10px;
    }
    .tbf-mobile-trigger svg { width: 16px; height: 16px; flex-shrink: 0; }
    .tbf-mobile-trigger .label { flex: 1; text-align: left; }
    .tbf-mobile-trigger .badge-count {
        background: var(--tbf-yellow); color: #000;
        padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700;
    }
    .tbf-mobile-trigger .badge-count.empty { display: none; }

    /* Hide the slot-time column on mobile — per-card `.tbf-time` is enough
       and the column was stealing ~56px from an already-tight layout. */
    .tbf-time-slot { grid-template-columns: 1fr; gap: 0; padding: 10px 0; }
    .tbf-slot-time { display: none; }

    .tbf-ev-card { grid-template-columns: 56px 1fr; gap: 10px; padding: 12px 14px; }
    .tbf-ev-card .tbf-time { font-size: 13px; }
    .tbf-ev-card h3 { font-size: 13px; }
    .tbf-ev-card .tbf-speaker { font-size: 11px; margin-bottom: 6px; }
    .tbf-ev-card .tbf-badge { font-size: 10px; padding: 2px 7px; }

    .tbf-day-group-header h3 { font-size: 14px; }
}

/* ── Bottom-sheet (mobile filters) ───────────────────────────────────── */
.tbf-sheet-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    z-index: 99; opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
}
.tbf-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.tbf-sheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; z-index: 100;
    max-height: 90vh; overflow-y: auto;
    border-radius: 16px 16px 0 0;
    padding: 22px 18px 24px;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 -10px 30px rgba(0,0,0,.3);
}
.tbf-sheet.open { transform: translateY(0); }
.tbf-sheet::before {
    content: ""; display: block;
    width: 40px; height: 4px; background: #ccc; border-radius: 99px;
    margin: -10px auto 16px;
}
.tbf-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.tbf-sheet-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.tbf-sheet-head button {
    background: transparent; border: 0; font-size: 28px;
    cursor: pointer; color: #666; padding: 0 8px; line-height: 1;
}
.tbf-sheet-field { margin-bottom: 14px; }
.tbf-sheet-field label {
    display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--tbf-text); font-weight: 700; margin-bottom: 6px;
}
.tbf-sheet-field input, .tbf-sheet-field select {
    width: 100%;
    padding: 12px 14px; border: 1px solid var(--tbf-border);
    border-radius: var(--tbf-radius); font: inherit; font-size: 14px;
    background: #fff;
}
.tbf-sheet-actions {
    display: flex; gap: 10px; margin-top: 22px; padding-top: 18px;
    border-top: 1px solid var(--tbf-border);
    position: sticky; bottom: 0; background: #fff; padding-bottom: 4px;
}
.tbf-sheet-actions .tbf-sheet-apply, .tbf-sheet-actions .tbf-sheet-clear {
    flex: 1; padding: 14px;
    font: inherit; font-weight: 600; font-size: 14px;
    border-radius: var(--tbf-radius); cursor: pointer;
    text-align: center; text-decoration: none; display: inline-flex;
    align-items: center; justify-content: center;
}
.tbf-sheet-actions .tbf-sheet-apply { background: var(--tbf-black); color: #fff; border: 0; }
.tbf-sheet-actions .tbf-sheet-clear { background: #fff; color: var(--tbf-black); border: 1.5px solid var(--tbf-black); }

/* ── Ongoing events (tbf_ongoing / [tbf_ongoing_events]) ───────────────
   Fair-long exhibitions and tributes. No time-slot structure — cards sit
   in a responsive grid. Date range replaces the usual "HH:MM – HH:MM"
   line. Programme badge kept so visitors can tell which strand an
   entry belongs to. */
.tbf-ongoing { margin: 28px 0; }
.tbf-ongoing-title { font-size: 20px; font-weight: 700; margin: 0 0 14px; }
.tbf-ongoing-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}
/*
 * Horizontal card: left column holds the "who/when/where" (date, title,
 * speakers, badges, venue), right column holds the descriptive "what"
 * (description body + organizer footer). Mobile collapses back to a
 * single column (see media query below).
 */
.tbf-ongoing-card {
    background: #fff;
    border: 1px solid var(--tbf-border);
    border-left: 4px solid var(--tbf-accent);
    border-radius: var(--tbf-radius);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) 2fr;
    grid-template-areas:
        "head body"
        "head org";
    gap: 12px 24px;
    align-items: start;
}
.tbf-ongoing-card-head { grid-area: head; display: flex; flex-direction: column; gap: 6px; }
.tbf-ongoing-desc      { grid-area: body; }
.tbf-ongoing-org       { grid-area: org; align-self: end; }
.tbf-ongoing-date {
    font-size: 11px; color: var(--tbf-text); font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.tbf-ongoing-name { font-size: 15px; font-weight: 700; margin: 0; line-height: 1.3; }
.tbf-ongoing-speaker { color: var(--tbf-text); font-size: 12px; }
.tbf-ongoing-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.tbf-ongoing-venue {
    font-size: 12px; color: #333;
    border-top: 1px dashed var(--tbf-border);
    padding-top: 8px;
}
.tbf-ongoing-venue.tbf-ongoing-venue--off {
    background: #FEE; color: #991b1b; padding: 6px 8px; border-radius: 3px;
    font-style: italic; border: 0;
}
.tbf-ongoing-desc { font-size: 13px; line-height: 1.5; color: #333; margin: 0; }
.tbf-ongoing-desc p { margin: 0 0 8px; }
.tbf-ongoing-desc p:last-child { margin-bottom: 0; }
.tbf-ongoing-desc ul, .tbf-ongoing-desc ol { margin: 0 0 8px 1.25em; padding: 0; }
.tbf-ongoing-desc a { color: var(--tbf-accent, #195afe); text-decoration: underline; }
.tbf-ongoing-org  {
    font-size: 11px; color: var(--tbf-text);
    border-top: 1px dashed var(--tbf-border);
    padding-top: 8px;
}

/* Mobile: horizontal layout doesn't fit — collapse back to a single
   column per card, head → body → org stacked vertically. */
@media (max-width: 720px) {
    .tbf-ongoing-card {
        grid-template-columns: 1fr;
        grid-template-areas: "head" "body" "org";
        gap: 10px;
        padding: 14px 16px;
    }
}

/* ── AJAX loading state on results ───────────────────────────────────── */
.tbf-programme-results.is-loading { opacity: .35; transition: opacity .12s ease; pointer-events: none; }

.tbf-results-wrap { position: relative; }
.tbf-loader-overlay {
    position: absolute;
    top: 40px; left: 0; right: 0;
    display: flex; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity .18s ease;
    z-index: 2;
}
.tbf-programme-results.is-loading + .tbf-loader-overlay {
    opacity: 1;
}
@media (max-width: 720px) {
    .tbf-loader-overlay { top: 20px; }
}

/* ── Flipping book loader ────────────────────────────────────────────── */
/*
   Four stacked "pages" anchored at the spine (left edge = center of the book)
   rotate around the Y axis. Staggered animation-delays keep at least one
   page visibly flipping at all times. Pages fade out at -180deg so the
   instant reset from -180 back to 0 is hidden.
*/
.tbf-book-loader {
    --tbf-book-w: 84px;
    --tbf-book-h: 60px;
    display: inline-flex;
    width: var(--tbf-book-w);
    height: var(--tbf-book-h);
    perspective: 220px;
}
.tbf-book-loader .tbf-book {
    position: relative;
    width: 100%; height: 100%;
    transform-style: preserve-3d;
}
/* Left + right hard covers */
.tbf-book-loader .tbf-book::before,
.tbf-book-loader .tbf-book::after {
    content: "";
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: #000;
    z-index: 1;
}
.tbf-book-loader .tbf-book::before {
    left: 0;
    border-radius: 3px 0 0 3px;
    border-right: 1px solid var(--tbf-yellow, #FEFF06);
}
.tbf-book-loader .tbf-book::after {
    right: 0;
    border-radius: 0 3px 3px 0;
    border-left: 1px solid var(--tbf-yellow, #FEFF06);
}
/* Flipping pages */
.tbf-book-loader .tbf-book-page {
    position: absolute;
    top: 6%;
    left: 50%;
    width: 46%;
    height: 88%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
    transform-origin: left center;
    backface-visibility: hidden;
    animation: tbf-page-flip 2.4s infinite ease-in-out;
    will-change: transform, opacity;
    z-index: 2;
}
.tbf-book-loader .tbf-book-page:nth-child(1) { animation-delay: 0s;   }
.tbf-book-loader .tbf-book-page:nth-child(2) { animation-delay: 0.3s; }
.tbf-book-loader .tbf-book-page:nth-child(3) { animation-delay: 0.6s; }
.tbf-book-loader .tbf-book-page:nth-child(4) { animation-delay: 0.9s; }

@keyframes tbf-page-flip {
    0%   { transform: rotateY(0deg);    opacity: 0; }
    5%   { opacity: 1; }
    40%  { transform: rotateY(-180deg); opacity: 1; }
    60%  { opacity: 0; }
    100% { transform: rotateY(-180deg); opacity: 0; }
}

/* Reduced motion: replace the flip with a gentle yellow pulse on the book itself */
@media (prefers-reduced-motion: reduce) {
    .tbf-book-loader .tbf-book-page { animation: none; opacity: 0; }
    .tbf-book-loader .tbf-book { animation: tbf-book-pulse 1.8s infinite ease-in-out; }
    @keyframes tbf-book-pulse {
        0%, 100% { box-shadow: 0 0 0 0   rgba(254,255,6,.5); }
        50%      { box-shadow: 0 0 0 8px rgba(254,255,6,0);  }
    }
}

/* Modal loading state */
.tbf-modal-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px;
    padding: 50px 10px;
}
.tbf-modal-loading .tbf-loading-label {
    font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: #7a7a7a;
}

/* ── Detail modal (Phase 5a) ─────────────────────────────────────────── */
.tbf-modal-root {
    position: fixed; inset: 0; z-index: 100000;
    display: none;
    font-family: var(--tbf-font, "Roboto Mono", monospace);
}
.tbf-modal-root.open { display: block; }
.tbf-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.6);
    animation: tbf-modal-fade .18s ease both;
}
@keyframes tbf-modal-fade { from { opacity: 0; } to { opacity: 1; } }

.tbf-modal {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: min(680px, calc(100vw - 24px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0,0,0,.4);
    padding: 28px 28px 24px;
    /* Append `box-sizing: border-box` so the mobile override (width:100vw)
       stays inside the viewport once we add the 18px side padding below. */
    box-sizing: border-box;
    animation: tbf-modal-pop .22s cubic-bezier(.2,.8,.2,1) both;
}
.tbf-modal *, .tbf-modal *::before, .tbf-modal *::after { box-sizing: border-box; }
@keyframes tbf-modal-pop {
    from { opacity: 0; transform: translate(-50%, -48%) scale(.97); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.tbf-modal-close {
    position: absolute; top: 10px; right: 12px;
    width: 36px; height: 36px;
    background: transparent; border: 0; font-size: 28px; line-height: 1;
    cursor: pointer; color: #666; padding: 0;
    border-radius: 50%;
}
.tbf-modal-close:hover { background: #f0f0f0; color: #000; }

/* Second close button under the modal content. Always visible even if the
   theme's sticky header obscures the top × on mobile. */
.tbf-modal-foot {
    margin-top: 18px; padding-top: 16px;
    border-top: 1px solid var(--tbf-border, #e5e5e5);
    text-align: center;
}
.tbf-modal-close-bottom {
    display: inline-block; padding: 10px 22px;
    background: var(--tbf-black, #000); color: #fff;
    border: 0; border-radius: 4px;
    font: inherit; font-weight: 600; font-size: 13px;
    cursor: pointer;
    transition: opacity .15s ease;
}
.tbf-modal-close-bottom:hover { opacity: .85; color: #fff; }

.tbf-modal-error { padding: 40px 10px; text-align: center; color: var(--tbf-text, #7a7a7a); }

/* Detail content */
.tbf-detail-header {
    padding-bottom: 14px; margin-bottom: 14px;
    border-bottom: 1px solid #e5e5e5;
}
.tbf-detail-date { font-size: 12px; color: #7a7a7a; text-transform: uppercase; letter-spacing: .04em; }
.tbf-detail-time { font-size: 18px; font-weight: 700; margin-top: 4px; }
.tbf-detail-title { font-size: 20px; font-weight: 700; margin: 10px 0 8px; line-height: 1.25; }
.tbf-detail-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.tbf-detail-venue { font-size: 13px; color: #333; }
.tbf-detail-venue.tbf-detail-venue--off {
    background: #FEE; color: #991b1b;
    padding: 6px 10px; border-radius: 4px; font-style: italic;
    display: inline-block;
}

.tbf-detail-body .tbf-detail-section { margin-bottom: 14px; }
.tbf-detail-body .tbf-detail-section:last-child { margin-bottom: 0; }
.tbf-detail-body h4 {
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: #7a7a7a; font-weight: 700; margin: 0 0 4px;
}
.tbf-detail-body p { margin: 0; font-size: 14px; line-height: 1.55; color: #222; }
.tbf-detail-rich p { margin: 0 0 10px; }
.tbf-detail-rich p:last-child { margin-bottom: 0; }
.tbf-detail-rich ul, .tbf-detail-rich ol { margin: 0 0 10px 1.25em; padding: 0; }
.tbf-detail-rich li { margin-bottom: 4px; }
.tbf-detail-rich a { color: var(--tbf-accent, #195afe); text-decoration: underline; }
.tbf-detail-rich strong { font-weight: 700; }
.tbf-detail-rich em { font-style: italic; }
.tbf-detail-rich h1, .tbf-detail-rich h2, .tbf-detail-rich h3, .tbf-detail-rich h4 {
    font-size: 14px; font-weight: 700; margin: 10px 0 4px;
}

.tbf-detail-footer {
    margin-top: 22px; padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    display: flex; justify-content: center;
}
.tbf-detail-ics {
    display: inline-flex; align-items: center; gap: 8px;
    background: #000; color: var(--tbf-yellow, #FEFF06);
    padding: 10px 18px; border-radius: 4px;
    text-decoration: none; font-weight: 600; font-size: 13px;
    transition: background .15s ease;
}
.tbf-detail-ics:hover { background: #1a1a1a; color: var(--tbf-yellow, #FEFF06); }
.tbf-detail-ics svg { flex-shrink: 0; }

/* Mobile: full-height modal */
@media (max-width: 720px) {
    .tbf-modal {
        top: 0; left: 0; transform: none;
        width: 100vw; max-height: 100vh; height: 100vh;
        border-radius: 0; padding: 52px 18px 24px;
    }
    @keyframes tbf-modal-pop {
        from { opacity: 0; transform: translateY(20px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .tbf-modal-close { top: 6px; right: 6px; }
    .tbf-detail-title { font-size: 18px; }
    .tbf-detail-time  { font-size: 16px; }
}
