
/* Graphical theatre programme */
.theatre-program-section {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.theatre-program-heading,
.theatre-program-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.theatre-program-heading > div,
.theatre-program-agenda-heading {
    display: grid;
    gap: 5px;
}

.theatre-program-heading h2,
.theatre-program-heading p,
.theatre-program-agenda-heading h3,
.theatre-program-agenda-heading p {
    margin: 0;
}

.theatre-program-month-nav {
    display: grid;
    grid-template-columns: 36px auto 36px;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.theatre-program-month-step,
.theatre-program-today {
    display: inline-grid;
    place-items: center;
    min-height: 36px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}

.theatre-program-month-step {
    width: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
}

.theatre-program-today {
    padding: 0 11px;
    border-radius: 6px;
    font-size: 0.82rem;
}

.theatre-program-month-step:hover,
.theatre-program-today:hover,
.theatre-program-month-step:focus-visible,
.theatre-program-today:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

.theatre-program-filters {
    display: flex;
    flex-wrap: wrap;
    flex: 1 1 auto;
    align-items: end;
    justify-content: flex-end;
    gap: 8px;
}

.theatre-program-filters label {
    display: grid;
    gap: 4px;
    flex: 0 1 190px;
    min-width: min(165px, 100%);
    margin: 0;
}

.theatre-program-filters label > span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.theatre-program-filters select,
.theatre-program-filters button {
    min-height: 38px;
}

.theatre-program-weekdays,
.theatre-program-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.theatre-program-weekdays {
    gap: 1px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-align: center;
}

.theatre-program-weekdays span {
    padding: 0 4px 6px;
}

.theatre-program-calendar {
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--border);
}

.theatre-program-day {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 7px;
    min-width: 0;
    min-height: 118px;
    padding: 8px;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.theatre-program-day:hover,
.theatre-program-day:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.theatre-program-day.is-outside {
    background: color-mix(in srgb, var(--soft-bg) 72%, transparent);
    color: var(--muted);
    opacity: 0.68;
}

.theatre-program-day.is-past:not(.is-selected) {
    opacity: 0.76;
}

.theatre-program-day.is-selected {
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    box-shadow: inset 0 0 0 2px var(--accent);
}

.theatre-program-day-number {
    display: inline-grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    font-size: 0.84rem;
    font-weight: 900;
}

.theatre-program-day.is-today .theatre-program-day-number {
    background: var(--accent);
    color: #fff;
}

.theatre-program-day-items {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
}

.theatre-program-day-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 5px;
    min-width: 0;
    padding: 4px 5px;
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--soft-bg) 82%, transparent);
    font-size: 0.68rem;
    line-height: 1.2;
}

.theatre-program-day-item.status-limited {
    border-left-color: #c48a10;
}

.theatre-program-day-item.status-sold_out,
.theatre-program-day-item.status-cancelled {
    border-left-color: #bd3d4a;
}

.theatre-program-day-item strong,
.theatre-program-day-item span,
.theatre-program-day-item small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theatre-program-day-item small {
    grid-column: 2;
    color: var(--muted);
}

.theatre-program-day-more {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
}

.theatre-program-mobile-days {
    display: none;
}

.theatre-program-agenda {
    display: grid;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.theatre-program-day-panel {
    display: grid;
    gap: 7px;
}

.theatre-program-day-panel > h4 {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.theatre-program-row-list {
    display: grid;
}

.theatre-program-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 11px 0;
    border-top: 1px solid var(--border);
}

.theatre-program-row:first-child {
    border-top: 0;
}

.theatre-program-row.is-cancelled {
    opacity: 0.72;
}

.theatre-program-row > time {
    font-size: 1rem;
    font-weight: 900;
}

.production-upcoming-row > time {
    display: grid;
    gap: 1px;
}

.production-upcoming-row > time span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.theatre-program-row-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.theatre-program-row-main h5,
.theatre-program-row-main p {
    margin: 0;
}

.theatre-program-row-main h5 {
    font-size: 0.98rem;
}

.theatre-program-row-main p {
    color: var(--muted);
    font-size: 0.8rem;
}

.theatre-program-row-states,
.theatre-program-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.theatre-program-row-states .status-pill {
    font-size: 0.68rem;
}

.theatre-program-row-actions {
    justify-content: flex-end;
}

.theatre-program-row-actions .ghost-link {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 0.76rem;
}

.theatre-program-day-empty[hidden] {
    display: none;
}

.theatre-scene-program-link {
    width: max-content;
    max-width: 100%;
}

.profile-production-card-compact {
    align-items: stretch;
}

.profile-repertoire-search {
    display: grid;
    gap: 6px;
    margin: 12px 0 16px;
}

.profile-repertoire-search > label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.profile-repertoire-search > div {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.profile-repertoire-search button,
.profile-repertoire-search .ghost-link {
    min-height: 44px;
}

.production-media-picker {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 0;
    border: 0;
}

.production-media-picker > legend {
    padding: 0;
    font-weight: 800;
}

.production-media-picker-grid,
.production-media-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.production-media-choice {
    position: relative;
    display: grid;
    grid-template-rows: 112px minmax(44px, auto);
    gap: 6px;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.production-media-choice input {
    position: absolute;
    z-index: 1;
    top: 8px;
    left: 8px;
    width: 22px;
    height: 22px;
    margin: 0;
}

.production-media-choice img,
.production-media-gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.production-media-choice span {
    align-self: center;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.82rem;
}

.production-media-gallery-grid figure {
    display: grid;
    grid-template-rows: 180px auto;
    gap: 7px;
    min-width: 0;
    margin: 0;
}

.production-media-gallery-grid figure > a {
    min-height: 44px;
}

.production-media-gallery-grid figcaption {
    display: grid;
    gap: 2px;
    color: var(--muted);
    font-size: 0.78rem;
}

.production-media-gallery-grid figcaption strong {
    color: var(--text);
}

.profile-production-next {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 3px 8px;
    margin-top: 8px;
}

.profile-production-next > span,
.profile-production-next > small {
    color: var(--muted);
    font-size: 0.76rem;
}

.profile-production-next > small {
    grid-column: 2;
}

@media (max-width: 820px) {
    .theatre-program-heading,
    .theatre-program-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .theatre-program-month-nav {
        width: max-content;
        max-width: 100%;
    }

    .theatre-program-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }

    .theatre-program-filters button {
        align-self: end;
    }
}

@media (max-width: 680px) {
    .profile-repertoire-search > div {
        grid-template-columns: 1fr 1fr;
    }

    .profile-repertoire-search input {
        grid-column: 1 / -1;
    }

    .production-media-picker-grid,
    .production-media-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .theatre-program-weekdays,
    .theatre-program-calendar {
        display: none;
    }

    .theatre-program-mobile-days {
        display: flex;
        gap: 5px;
        max-width: 100%;
        padding: 2px 0 8px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    .theatre-program-mobile-day {
        position: relative;
        display: grid;
        place-items: center;
        flex: 0 0 47px;
        min-width: 47px;
        min-height: 59px;
        padding: 5px 4px;
        border: 1px solid var(--border);
        border-radius: 6px;
        background: color-mix(in srgb, var(--surface) 86%, transparent);
        color: var(--text);
    }

    .theatre-program-mobile-day span,
    .theatre-program-mobile-day small {
        color: var(--muted);
        font-size: 0.65rem;
    }

    .theatre-program-mobile-day small {
        min-height: 8px;
    }

    .theatre-program-mobile-day.has-program::after {
        content: '';
        position: absolute;
        bottom: 4px;
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: var(--accent);
    }

    .theatre-program-mobile-day.is-selected {
        border-color: var(--accent);
        background: color-mix(in srgb, var(--accent) 12%, var(--surface));
        box-shadow: inset 0 0 0 1px var(--accent);
    }

    .theatre-program-filters {
        grid-template-columns: 1fr;
    }

    .theatre-program-row {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 8px;
    }

    .theatre-program-row-actions {
        grid-column: 2;
        justify-content: flex-start;
    }

    .theatre-program-row > time {
        align-self: start;
        padding-top: 2px;
        font-size: 0.9rem;
    }
}
