/* schema.css — Beacon programme page (/schema)

   Layered on top of home5.css: the tokens (--h5-*), nav, footer, buttons,
   eyebrow, section shell, dot-bg and .h5-chip all come from there. Only the
   day tabs, the time rail and the event cards live here.

   The page renders every day panel. schema.js adds .is-tabbed to
   .h5-schema-board and only then do the inactive panels hide — with JS off
   the whole programme is one readable list.                                */

/* .h5-nav-inner's height, which the sticky day tabs park under. It shrinks
   with the nav at 768px (home5.css:1918), so it lives in a token rather than
   being written twice. */
:root { --h5-nav-h: 68px; }
@media (max-width: 768px) { :root { --h5-nav-h: 60px; } }

/* ─────────── Preliminary-programme banner ─────────── */
.h5-schema-status {
    display: block;
    max-width: 720px;
    margin: 0 0 2.5rem;
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--h5-mid);
    background: rgba(36,155,215,0.07);
    border: 1px solid rgba(36,155,215,0.28);
    border-left-width: 3px;
    border-radius: 6px;
}
.h5-schema-status b {
    font-family: var(--h5-font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--h5-blue);
    margin-right: 0.6rem;
}

/* ─────────── Day tabs ─────────── */
/* Four tabs, so they share the row evenly and never need to scroll — which
   is what lets the bar be sticky without fighting a horizontal scroller.
   The negative inline margin cancels .h5-container's gutter so the sticky
   background is full-bleed instead of leaving two transparent strips. */
.h5-schema-days {
    position: sticky;
    top: var(--h5-nav-h);
    z-index: 3;
    display: flex;
    gap: 0.5rem;
    margin: 0 calc(-1 * clamp(1.25rem, 4vw, 4rem)) 1.5rem;
    padding: 0.75rem clamp(1.25rem, 4vw, 4rem);
    background: rgba(9,14,26,0.88);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid var(--h5-border);
}

.h5-schema-day {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.7rem 0.4rem;
    background: var(--h5-surface);
    border: 1px solid var(--h5-border);
    border-radius: 8px;
    color: var(--h5-mid);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.h5-schema-day:hover {
    color: var(--h5-white);
    border-color: var(--h5-border-2);
    background: var(--h5-surface-2);
}
.h5-schema-day.is-active {
    color: var(--h5-bg);
    background: var(--h5-yellow);
    border-color: var(--h5-yellow);
    box-shadow: var(--h5-glow-y);
}
.h5-schema-day-name {
    font-family: var(--h5-font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.h5-schema-day-date {
    font-family: var(--h5-font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

/* ─────────── Filter chips ─────────── */
/* .h5-bento-filters already owns the row layout and the phone edge-fade. */
.h5-schema-filters { margin-bottom: 2.5rem; }

/* ─────────── Day panels ─────────── */
.h5-schema-board.is-tabbed .h5-schema-panel:not(.is-active) { display: none; }

/* Without JS the panels stack, so each needs a visible separator. With JS
   only one is ever shown and the rule is harmless. */
.h5-schema-panel + .h5-schema-panel { margin-top: 3.5rem; }

.h5-schema-panel-heading {
    font-family: var(--h5-font-display);
    font-weight: 700;
    font-size: clamp(1.35rem, 2.6vw, 1.8rem);
    letter-spacing: -0.01em;
    color: var(--h5-white);
    margin: 0 0 0.4rem;
}
.h5-schema-panel-note {
    font-size: 0.92rem;
    color: var(--h5-dim);
    max-width: 620px;
    margin: 0 0 2rem;
}

/* ─────────── Time rail ─────────── */
.h5-schema-list {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
/* The rail itself. Faded at both ends so it reads as a continuing timeline
   rather than a box the first and last events are trapped in. */
.h5-schema-list::before {
    content: '';
    position: absolute;
    left: 5.35rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 1px;
    background: linear-gradient(180deg,
        transparent, var(--h5-border-2) 6%, var(--h5-border-2) 94%, transparent);
}

.h5-schema-item {
    position: relative;
    display: grid;
    grid-template-columns: 4.75rem 1fr;
    column-gap: 1.6rem;
    align-items: start;
    /* Per-category accent, used by the rail dot and the card's left edge. */
    --h5-cat: var(--h5-mid);
}
.h5-schema-item[data-category="scen"]      { --h5-cat: var(--h5-yellow); }
.h5-schema-item[data-category="turnering"] { --h5-cat: var(--h5-blue);   }
.h5-schema-item[data-category="prova"]     { --h5-cat: var(--h5-orange); }
.h5-schema-item[data-category="praktiskt"] { --h5-cat: var(--h5-mid);    }

/* Rail dot. The ring is painted in the page background so the dot sits on
   the rail rather than crossing it. */
.h5-schema-item::before {
    content: '';
    position: absolute;
    left: 5.35rem;
    top: 1.15rem;
    width: 7px;
    height: 7px;
    margin-left: -3px;
    border-radius: 50%;
    background: var(--h5-cat);
    box-shadow: 0 0 0 3px var(--h5-bg);
}

.h5-schema-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-top: 0.85rem;
    font-family: var(--h5-font-mono);
    line-height: 1.35;
}
.h5-schema-time b {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--h5-yellow);
    letter-spacing: 0.02em;
}
.h5-schema-time-end {
    font-size: 0.7rem;
    color: var(--h5-dim);
}
.h5-schema-tba {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--h5-dim);
    padding-top: 0.15rem;
}

/* ─────────── Event card ─────────── */
.h5-schema-card {
    position: relative;
    padding: 0.9rem 1.15rem 1rem;
    background: var(--h5-surface);
    border: 1px solid var(--h5-border);
    border-left: 3px solid var(--h5-cat);
    border-radius: 8px;
    transition: transform 0.25s ease, border-color 0.25s, background 0.25s;
}
.h5-schema-card:hover {
    transform: translateY(-2px);
    background: var(--h5-surface-2);
    border-top-color: var(--h5-border-2);
    border-right-color: var(--h5-border-2);
    border-bottom-color: var(--h5-border-2);
}

.h5-schema-title {
    font-family: var(--h5-font-display);
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.25;
    color: var(--h5-white);
    margin: 0;
}
.h5-schema-place {
    font-family: var(--h5-font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--h5-cat);
    margin: 0.35rem 0 0;
}
.h5-schema-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--h5-mid);
    margin: 0.55rem 0 0;
    max-width: 62ch;
}
.h5-schema-link {
    display: inline-block;
    margin-top: 0.7rem;
    font-family: var(--h5-font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--h5-yellow);
    text-decoration: none;
}
.h5-schema-link:hover { text-decoration: underline; }

/* Not-yet-scheduled. A designed gap, so a hole in the programme reads as
   deliberate rather than broken — same idea as .h5-act-status on the home page. */
.h5-schema-item.is-tba .h5-schema-card {
    background: transparent;
    border-style: dashed;
    border-left-style: solid;
}
.h5-schema-item.is-tba .h5-schema-title { color: var(--h5-mid); }
.h5-schema-item.is-tba::before { background: transparent; box-shadow: 0 0 0 3px var(--h5-bg), inset 0 0 0 1px var(--h5-dim); }

/* Happening right now — only ever set during the event itself, by schema.js. */
.h5-schema-item.is-now .h5-schema-card {
    border-color: rgba(255,186,83,0.5);
    box-shadow: 0 0 0 1px rgba(255,186,83,0.25), 0 0 24px rgba(255,186,83,0.12);
}
.h5-schema-item.is-now .h5-schema-title::after {
    content: 'Nu';
    display: inline-block;
    margin-left: 0.6rem;
    padding: 0.1rem 0.45rem;
    vertical-align: 0.1em;
    font-family: var(--h5-font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--h5-bg);
    background: var(--h5-yellow);
    border-radius: 3px;
}

/* Filtered out by the chips. Never removed from the DOM — the rail's
   geometry and the panel heading stay put either way. */
.h5-schema-item.is-filtered { display: none; }

.h5-schema-empty {
    margin: 0;
    font-family: var(--h5-font-mono);
    font-size: 0.78rem;
    color: var(--h5-mid);
}

.h5-schema-foot {
    margin: 3rem 0 0;
    font-size: 0.85rem;
    color: var(--h5-dim);
}
.h5-schema-foot a { color: var(--h5-blue); }

/* ─────────── Phones ─────────── */
/* The rail costs a fifth of the width on a narrow screen and buys nothing,
   so below 640px the time becomes a badge above the title instead. */
@media (max-width: 640px) {
    .h5-schema-list::before,
    .h5-schema-item::before { display: none; }

    .h5-schema-item {
        grid-template-columns: 1fr;
        row-gap: 0.35rem;
    }
    .h5-schema-time {
        flex-direction: row;
        align-items: baseline;
        gap: 0.3rem;
        padding: 0 0 0 0.15rem;
    }
    .h5-schema-time b { font-size: 0.85rem; }

    .h5-schema-days {
        gap: 0.35rem;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }
    .h5-schema-day { padding: 0.55rem 0.2rem; }
    .h5-schema-day-name { font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
    .h5-schema-day,
    .h5-schema-card { transition: none; }
    .h5-schema-card:hover { transform: none; }
}
