/**
 * NORDticker Festival Stage Program
 *
 * Styles for the multi-stage festival program block (e.g. Kieler Woche)
 * rendered by nordticker_render_festival_program(). The "Nach Tag / Nach
 * Bühne" toggle is CSS-only (hidden radio inputs + general sibling selector),
 * so no JavaScript is required. Collapsible days/stages use native <details>.
 *
 * @package NORDticker
 */

.nordticker-festival-program {
    margin: var(--nt-space-10) 0;
}

.nordticker-festival-program__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--nt-space-2) var(--nt-space-4);
    margin-bottom: var(--nt-space-5);
}

.nordticker-festival-program__title {
    font-family: var(--nt-font-display);
    font-size: var(--nt-text-2xl);
    font-weight: var(--nt-weight-bold);
    color: var(--nt-text-primary);
    margin: 0;
}

.nordticker-festival-program__meta {
    margin: 0;
    font-size: var(--nt-text-sm);
    color: var(--nt-text-muted);
}

/* ---- View toggle (CSS-only) ---------------------------------------------- */

.nordticker-fp-view-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.nordticker-festival-program__toggle {
    display: inline-flex;
    gap: var(--nt-space-1);
    padding: var(--nt-space-1);
    margin-bottom: var(--nt-space-6);
    background: var(--nt-gray-100);
    border-radius: var(--nt-radius-pill);
}

.nordticker-fp-view-label {
    display: inline-flex;
    align-items: center;
    gap: var(--nt-space-2);
    padding: var(--nt-space-2) var(--nt-space-5);
    border-radius: var(--nt-radius-pill);
    font-size: var(--nt-text-sm);
    font-weight: var(--nt-weight-medium);
    color: var(--nt-text-secondary);
    cursor: pointer;
    transition: background var(--nt-transition-base), color var(--nt-transition-base);
    user-select: none;
}

.nordticker-fp-view-label .nt-icon {
    width: 1em;
    height: 1em;
}

.nordticker-fp-view-label:hover {
    color: var(--nt-text-primary);
}

/* Active tab state driven by the checked radio. */
.nordticker-fp-view-input--day:checked ~ .nordticker-festival-program__toggle .nordticker-fp-view-label--day,
.nordticker-fp-view-input--stage:checked ~ .nordticker-festival-program__toggle .nordticker-fp-view-label--stage {
    background: var(--nt-bg-primary);
    color: var(--nt-accent-dark);
    box-shadow: var(--nt-shadow-xs);
}

/* Keyboard focus visibility for the hidden radios. */
.nordticker-fp-view-input--day:focus-visible ~ .nordticker-festival-program__toggle .nordticker-fp-view-label--day,
.nordticker-fp-view-input--stage:focus-visible ~ .nordticker-festival-program__toggle .nordticker-fp-view-label--stage {
    outline: 2px solid var(--nt-accent);
    outline-offset: 2px;
}

/* View visibility: day is default, stage shown only when its radio is checked. */
.nordticker-fp-view--stage {
    display: none;
}

.nordticker-fp-view-input--stage:checked ~ .nordticker-fp-view--stage {
    display: block;
}

.nordticker-fp-view-input--stage:checked ~ .nordticker-fp-view--day {
    display: none;
}

/* ---- Collapsible day / stage --------------------------------------------- */

.nordticker-fp-day,
.nordticker-fp-stage {
    border: 1px solid var(--nt-border-light);
    border-radius: var(--nt-radius-lg);
    margin-bottom: var(--nt-space-3);
    background: var(--nt-bg-primary);
    overflow: hidden;
}

.nordticker-fp-day--today {
    border-color: var(--nt-accent);
    box-shadow: var(--nt-shadow-accent);
}

.nordticker-fp-day__summary,
.nordticker-fp-stage__summary {
    display: flex;
    align-items: center;
    gap: var(--nt-space-3);
    padding: var(--nt-space-4) var(--nt-space-5);
    font-family: var(--nt-font-display);
    font-size: var(--nt-text-lg);
    font-weight: var(--nt-weight-semibold);
    color: var(--nt-text-primary);
    cursor: pointer;
    list-style: none;
    text-transform: capitalize;
}

.nordticker-fp-day__summary::-webkit-details-marker,
.nordticker-fp-stage__summary::-webkit-details-marker {
    display: none;
}

/* Chevron indicator. */
.nordticker-fp-day__summary::after,
.nordticker-fp-stage__summary::after {
    content: "";
    width: 0.6em;
    height: 0.6em;
    margin-left: auto;
    border-right: 2px solid var(--nt-gray-400);
    border-bottom: 2px solid var(--nt-gray-400);
    transform: rotate(45deg);
    transition: transform var(--nt-transition-base);
}

.nordticker-fp-day[open] .nordticker-fp-day__summary::after,
.nordticker-fp-stage[open] .nordticker-fp-stage__summary::after {
    transform: rotate(-135deg);
}

.nordticker-fp-day__summary:hover,
.nordticker-fp-stage__summary:hover {
    background: var(--nt-bg-secondary);
}

.nordticker-fp-badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: var(--nt-radius-pill);
    background: var(--nt-accent);
    color: var(--nt-text-inverse);
    font-family: var(--nt-font-primary);
    font-size: var(--nt-text-xs);
    font-weight: var(--nt-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.nordticker-fp-day__body,
.nordticker-fp-stage__body {
    padding: var(--nt-space-2) var(--nt-space-5) var(--nt-space-5);
    border-top: 1px solid var(--nt-border-light);
}

/* ---- Stage / day blocks -------------------------------------------------- */

.nordticker-fp-day__body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--nt-space-4) var(--nt-space-6);
}

.nordticker-fp-block {
    padding-top: var(--nt-space-3);
}

.nordticker-fp-block__name {
    display: flex;
    align-items: center;
    gap: var(--nt-space-2);
    margin: 0 0 var(--nt-space-2);
    font-size: var(--nt-text-sm);
    font-weight: var(--nt-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nt-accent-dark);
}

.nordticker-fp-block--today {
    border-left: 3px solid var(--nt-accent);
    padding-left: var(--nt-space-3);
    margin-left: calc(-1 * var(--nt-space-3));
}

/* ---- Program items ------------------------------------------------------- */

.nordticker-fp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nordticker-fp-item {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--nt-space-1) var(--nt-space-3);
    padding: var(--nt-space-2) 0;
    border-bottom: 1px solid var(--nt-gray-100);
    font-size: var(--nt-text-sm);
    line-height: var(--nt-leading-normal);
}

.nordticker-fp-item:last-child {
    border-bottom: 0;
}

.nordticker-fp-item__time {
    flex: 0 0 3.5em;
    font-family: var(--nt-font-mono);
    font-weight: var(--nt-weight-semibold);
    color: var(--nt-text-secondary);
    font-variant-numeric: tabular-nums;
}

.nordticker-fp-item__act {
    flex: 1 1 auto;
    color: var(--nt-text-primary);
    font-weight: var(--nt-weight-medium);
}

.nordticker-fp-item__note {
    flex: 0 0 auto;
    padding: 0.1em 0.55em;
    border-radius: var(--nt-radius-sm);
    background: var(--nt-accent-soft);
    color: var(--nt-accent-dark);
    font-size: var(--nt-text-xs);
    font-weight: var(--nt-weight-medium);
}

@media (max-width: 600px) {
    .nordticker-fp-day__body {
        grid-template-columns: 1fr;
    }

    .nordticker-fp-day__summary,
    .nordticker-fp-stage__summary {
        font-size: var(--nt-text-base);
        padding: var(--nt-space-3) var(--nt-space-4);
    }
}
