/* Competition schedule ("Програма") on the public Live page - desktop and
   mobile. Markup: application/views/live/partials/_schedule.tpl (+
   _schedule_card.tpl), behaviour: js/live-schedule.js. Desktop polish pass;
   the dedicated mobile layout is a later step. Everything is scoped under
   .schedule-live. */
.schedule-live {
    padding: 20px 0 4px;
    color: #0f172a;
    /* #program anchor (mobile menu) lands below the fixed Live header. */
    scroll-margin-top: 64px;
}

.schedule-live [hidden] {
    display: none !important;
}

.schedule-live__container {
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 15px;
}

.schedule-live__panel {
    padding: 18px 22px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.schedule-live__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
}

.schedule-live__title .fa {
    color: #2563eb;
}

/* ---- A) compact summary ---- */
.schedule-live__block {
    padding: 12px 16px;
    border-radius: 12px;
    background: #f8fafc;
}

.schedule-live__block--now {
    background: #ecfdf5;
}

/* NEXT is the primary block only while nothing is running. */
.schedule-live__block--next {
    display: none;
    background: #eff6ff;
}

.schedule-live.has-next:not(.has-current) .schedule-live__block--next {
    display: block;
}

.schedule-live__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.schedule-live__block--now .schedule-live__label {
    color: #047857;
}

.schedule-live__pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .5);
    animation: schedule-live-pulse 2s infinite;
}

@keyframes schedule-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .schedule-live__pulse {
        animation: none;
    }
}

.schedule-live__cards {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Primary entry: time column | title + description */
.schedule-live__card--primary {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 2px 16px;
    align-items: baseline;
}

.schedule-live__card-when {
    display: grid;
}

.schedule-live__card-time {
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.schedule-live__card-day {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.schedule-live__card-title {
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.schedule-live__type-icon {
    margin-right: 4px;
    color: #94a3b8;
    font-size: .8em;
}

.schedule-live__card-desc,
.schedule-live__row-desc {
    display: -webkit-box;
    margin: 2px 0 0;
    overflow: hidden;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.schedule-live__more {
    display: inline-block;
    margin: 6px 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: #047857;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.schedule-live__more:focus-visible {
    outline: 3px solid rgba(16, 185, 129, .45);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Secondary one-line preview: "Следва · 10:00 ..." / "След това · 07:30 ..." */
.schedule-live__after {
    display: none;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 8px 16px 0;
    font-size: 14px;
}

.schedule-live.has-current.has-next .schedule-live__after--next,
.schedule-live.has-following:not(.has-current) .schedule-live__after--following {
    display: flex;
}

.schedule-live__after-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.schedule-live__after-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.schedule-live__card--line {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.schedule-live__line-time {
    color: #0f172a;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.schedule-live__card--line .schedule-live__card-title {
    font-size: 14px;
    font-weight: 600;
}

.schedule-live__finished {
    margin: 0;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
}

.schedule-live__finished .fa {
    color: #16a34a;
}

/* ---- B) full program ---- */
.schedule-live__full {
    margin-top: 10px;
    border-top: 1px solid #eef2f7;
}

.schedule-live__summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 2px;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.schedule-live__summary::-webkit-details-marker {
    display: none;
}

.schedule-live__summary:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .45);
    outline-offset: 2px;
    border-radius: 6px;
}

.schedule-live__summary-close,
.schedule-live__summary-open-short,
.schedule-live__summary-open-finished,
.schedule-live.is-finished .schedule-live__summary-open,
.schedule-live__full[open] .schedule-live__summary-open,
.schedule-live__full[open] .schedule-live__summary-open-finished {
    display: none;
}

.schedule-live.is-finished .schedule-live__full:not([open]) .schedule-live__summary-open-finished,
.schedule-live__full[open] .schedule-live__summary-close {
    display: inline;
}

.schedule-live__chevron {
    display: inline-block;
    font-size: 12px;
    transition: transform .15s ease;
}

.schedule-live__full[open] .schedule-live__chevron {
    transform: rotate(180deg);
}

.schedule-live__timeline {
    padding-top: 4px;
}

.schedule-live__day-title {
    margin: 12px 0 2px;
    padding-left: 32px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Vertical rail + markers */
.schedule-live__list {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.schedule-live__list::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 10px;
    width: 2px;
    border-radius: 2px;
    background: #e2e8f0;
}

.schedule-live__row {
    position: relative;
    padding: 6px 10px 6px 32px;
    border-radius: 10px;
}

.schedule-live__marker {
    position: absolute;
    top: 10px;
    left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    background: #ffffff;
    box-sizing: border-box;
}

.schedule-live__row.is-completed .schedule-live__marker {
    border-color: #16a34a;
    background: #16a34a;
}

.schedule-live__row.is-completed .schedule-live__marker::after {
    content: "\2713";
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}

.schedule-live__row.is-current .schedule-live__marker {
    top: 9px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-color: #059669;
    background: #059669;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .2);
}

.schedule-live__row.is-current {
    background: #f0fdf4;
}

.schedule-live__row-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

.schedule-live__row-time {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* State text: screen readers only, except the visible "Сега" tag. */
.schedule-live__row-state {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.schedule-live__row.is-current .schedule-live__row-state {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: #d1fae5;
    color: #047857;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.schedule-live__row-title {
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.schedule-live__row.is-completed .schedule-live__row-title,
.schedule-live__row.is-completed .schedule-live__row-time {
    color: #64748b;
}

/* ---- Mobile (<= 767px): one compact card, vertical stacking, short
   toggle copy, 44px touch targets. Desktop rules above stay untouched. ---- */
@media (max-width: 767px) {
    .schedule-live {
        padding: 10px 0 2px;
    }

    .schedule-live__container {
        padding: 0 10px;
    }

    .schedule-live__panel {
        padding: 12px 14px 4px;
        border-radius: 12px;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    }

    .schedule-live__title {
        gap: 8px;
        margin: 0 0 8px;
        font-size: 16px;
    }

    .schedule-live__block {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .schedule-live__label {
        margin: 0 0 4px;
        font-size: 11px;
    }

    .schedule-live__cards {
        gap: 8px;
    }

    /* time, title and description stack - no narrow time column */
    .schedule-live__card--primary {
        display: block;
    }

    .schedule-live__card-when {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0 8px;
    }

    .schedule-live__card-time {
        color: #334155;
        font-size: 14px;
        font-weight: 700;
    }

    .schedule-live__card-title {
        display: block;
        margin-top: 1px;
        font-size: 16px;
    }

    .schedule-live__more {
        min-height: 44px;
        margin: 0;
        padding: 0 4px;
    }

    .schedule-live__after {
        gap: 2px 8px;
        padding: 8px 2px 0;
        font-size: 14px;
    }

    .schedule-live__after-label {
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0;
        text-transform: none;
    }

    .schedule-live__after-label::after {
        content: " \00B7";
    }

    .schedule-live__card--line .schedule-live__card-title {
        display: inline;
        margin: 0;
    }

    .schedule-live__finished {
        padding: 2px 0 4px;
    }

    .schedule-live__full {
        margin-top: 8px;
    }

    /* whole-width toggle row, 44px touch target, chevron on the right */
    .schedule-live__summary {
        display: flex;
        justify-content: space-between;
        min-height: 44px;
        padding: 0 2px;
    }

    .schedule-live__summary-open {
        display: none;
    }

    .schedule-live__summary-open-short {
        display: inline;
    }

    .schedule-live.is-finished .schedule-live__summary-open-short,
    .schedule-live__full[open] .schedule-live__summary-open-short {
        display: none;
    }

    .schedule-live__timeline {
        padding: 0 0 8px;
    }

    .schedule-live__day-title {
        margin: 8px 0 2px;
        padding-left: 24px;
    }

    .schedule-live__list::before {
        left: 7px;
    }

    .schedule-live__row {
        padding: 5px 6px 5px 24px;
    }

    .schedule-live__marker {
        left: 1px;
    }

    .schedule-live__row.is-current .schedule-live__marker {
        left: 0;
    }

    .schedule-live__row-time {
        color: #334155;
        font-size: 13px;
        font-weight: 700;
    }

    .schedule-live__row-desc {
        -webkit-line-clamp: 3;
    }
}
