/* ============================================================
   Schedule timeline (/schedule, /schedule-full-screen)
   Markup: resources/views/schedule/. Colours are variables so a brand's
   css.css can retune them; config brand.schedule.theme picks the palette.

   The defaults follow the shared site style (app_new.css): square corners,
   solid showtime buttons in the availability colours, and dark buttons that
   invert on hover. Besides the palette below, a brand can set (defaults in
   brackets):
     --sch-frame         the panel's border        [none]
     --sch-radius        panel corners             [0]
     --sch-date-on       the chosen day's button   [text colour]
     --sch-date-on-text                            [panel colour]
     --sch-book          the booking button        [text colour]
     --sch-book-text                               [panel colour]
     --sch-kind-bg       the popup's category label, as the brand's
     --sch-kind-text     .spectacle-kind label     [plain muted text]
     --sch-kind-pad                                [0]
   ============================================================ */

.schedule-theme-light {
    --sch-page:      #f1f1f1;
    --sch-page-text: #141414;
    --sch-panel:     #fff;
    --sch-text:      #141414;
    --sch-muted:     #6b6b6b;
    --sch-line:      #e6e6e6;
    --sch-label-bg:  #fafafa;
    --sch-chip:      #f1f1f1;
    --sch-venue-bg:  #141414;
    --sch-venue-text:#fff;
    /* the site's showtime colours: green, orange, red */
    --sch-ok:        #008000;
    --sch-ok-bg:     #e6f2e6;
    --sch-low:       #ffa500;
    --sch-low-bg:    #fff4e0;
    --sch-low-text:  #a86400;
    --sch-no:        #e65043;
    --sch-no-bg:     #fce9e7;
    --sch-no-text:   #c0392b;
    --sch-past:      #b9b9b9;
    --sch-now:       #d32f2f;
}
.schedule-theme-dark {
    --sch-page:      #111113;
    --sch-page-text: #f2f2f2;
    --sch-panel:     #1e2024;
    --sch-text:      #f2f2f2;
    --sch-muted:     #a9a49b;
    --sch-line:      #33363b;
    --sch-label-bg:  #25282d;
    --sch-chip:      #2c2f34;
    --sch-venue-bg:  #000;
    --sch-venue-text:#f2f2f2;
    --sch-ok:        #3fb950;
    --sch-ok-bg:     #1f3326;
    --sch-low:       #f0a020;
    --sch-low-bg:    #3a2f1a;
    --sch-low-text:  #f5b84a;
    --sch-no:        #ef5a4c;
    --sch-no-bg:     #3d2322;
    --sch-no-text:   #ff8577;
    --sch-past:      #5d6066;
    --sch-now:       #ff4b4b;
}

/* ---------- panel, heading, dates ---------- */
/* the room column, hour axis and lines line up on --sch-label, padding
   included; the full-screen page has no bootstrap to set this */
.schedule,
.schedule *,
.schedule *::before,
.schedule *::after { box-sizing: border-box; }

.schedule {
    --sch-label: 190px;
    margin: 30px 0;
    padding: 20px 24px 22px;
    border: var(--sch-frame, 0);
    border-radius: var(--sch-radius, 0);
    background: var(--sch-panel);
    color: var(--sch-text);
    font-family: 'PFBagueSlabPro-Regular', Georgia, serif;
    font-size: 16px;
    line-height: 1.3;
}
.schedule .sch-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 20px;
    margin-bottom: 14px;
}
.schedule .sch-head h1 {
    margin: 0;
    color: var(--sch-text);
    font: 32px/1.1 'PFBagueSlabPro-Black', Georgia, serif;
    text-transform: none;
}
.schedule .sch-day {
    color: var(--sch-muted);
    font-size: 18px;
}
.schedule .sch-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.schedule .sch-dates a {
    padding: 7px 14px;
    border-radius: 0;
    background: var(--sch-chip);
    color: var(--sch-text);
    font: 16px/1.2 'PFBagueSlabPro-Bold', Georgia, serif;
    text-decoration: none;
    white-space: nowrap;
}
.schedule .sch-dates a:hover,
.schedule .sch-dates a:focus { color: var(--sch-text); text-decoration: none; filter: brightness(.94); }
.schedule .sch-dates a.is-active,
.schedule .sch-dates a.is-active:hover,
.schedule .sch-dates a.is-active:focus {
    background: var(--sch-date-on, var(--sch-text));
    color: var(--sch-date-on-text, var(--sch-panel));
}
.schedule .sch-dates .sch-arrow { padding-left: 12px; padding-right: 12px; }

.schedule .sch-message {
    padding: 60px 20px;
    color: var(--sch-muted);
    font-size: 20px;
    text-align: center;
}

/* ---------- availability: one edge colour and tint per state ---------- */
.schedule .sch-ok  { --edge: var(--sch-ok);  --bg: var(--sch-ok-bg); }
.schedule .sch-low { --edge: var(--sch-low); --bg: var(--sch-low-bg); --tag: var(--sch-low-text); }
.schedule .sch-no  { --edge: var(--sch-no);  --bg: var(--sch-no-bg);  --tag: var(--sch-no-text); }

/* ---------- timeline ---------- */
.schedule .sch-timeline {
    border: 1px solid var(--sch-line);
    border-radius: 0;
    overflow: hidden;
}
.schedule .sch-scroll { overflow-x: auto; }
.schedule .sch-grid {
    position: relative;
    min-width: 1000px;
}
.schedule .sch-hours {
    display: flex;
    height: 34px;
    border-bottom: 1px solid var(--sch-line);
    background: var(--sch-label-bg);
}
.schedule .sch-hours::before {
    content: '';
    flex: none;
    width: var(--sch-label);
    border-right: 1px solid var(--sch-line);
}
.schedule .sch-hours-lane {
    position: relative;
    flex: 1;
}
.schedule .sch-hours-lane span {
    position: absolute;
    top: 7px;
    transform: translateX(-50%);
    color: var(--sch-muted);
    font: 14px/20px 'PFBagueSlabPro-Bold', Georgia, serif;
    white-space: nowrap;
}
.schedule .sch-body { position: relative; }

/* hour lines and the now-line: over the lanes only, not the room names */
.schedule .sch-layer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--sch-label);
    right: 0;
    pointer-events: none;
}
.schedule .sch-gridline {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--sch-line);
}
.schedule .sch-layer--now { z-index: 3; }
.schedule .sch-now {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--sch-now);
}
.schedule .sch-now span {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--sch-now);
    color: #fff;
    font: 13px/18px 'PFBagueSlabPro-Bold', Georgia, serif;
}

.schedule .sch-venue {
    position: relative;
    z-index: 1;
    padding: 6px 14px;
    background: var(--sch-venue-bg);
    color: var(--sch-venue-text);
    font: 14px/18px 'PFBagueSlabPro-Bold', Georgia, serif;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.schedule .sch-row {
    display: flex;
    height: 96px;
    border-bottom: 1px solid var(--sch-line);
}
.schedule .sch-row:last-child { border-bottom: 0; }
.schedule .sch-room {
    position: relative;
    z-index: 1;
    flex: none;
    display: flex;
    align-items: center;
    width: var(--sch-label);
    padding: 0 14px;
    border-right: 1px solid var(--sch-line);
    background: var(--sch-label-bg);
    font: 16px/1.2 'PFBagueSlabPro-Bold', Georgia, serif;
}
.schedule .sch-lane {
    position: relative;
    flex: 1;
}

/* one showtime: as long as the show, ads included */
.schedule .sch-show {
    position: absolute;
    z-index: 1;
    top: 7px;
    bottom: 7px;
    display: flex;
    gap: 8px;
    padding: 5px;
    border-left: 4px solid var(--edge);
    border-radius: 0;
    background: var(--bg);
    color: var(--sch-text);
    text-decoration: none;
    overflow: hidden;
    /* lets the contents drop the poster and details when a block is small */
    container-type: size;
}
.schedule a.sch-show:hover,
.schedule a.sch-show:focus {
    color: var(--sch-text);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.schedule div.sch-show { cursor: default; }
/* Posters keep their own shape: 'contain' in a poster-shaped box, so a
   poster that isn't 2:3 gets a margin instead of losing its edges. */
.schedule .sch-show img {
    flex: none;
    height: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 2px;
    object-fit: contain;
}
.schedule .sch-show-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.schedule .sch-show b,
.schedule .sch-show-text > span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.schedule .sch-show b {
    font: 15px/1.2 'PFBagueSlabPro-Bold', Georgia, serif;
}
.schedule .sch-time { font-size: 14px; line-height: 1.25; }
.schedule .sch-meta { color: var(--sch-muted); font-size: 12px; line-height: 1.3; }
.schedule .sch-tag  { color: var(--tag); font: 12px/1.3 'PFBagueSlabPro-Bold', Georgia, serif; }
.schedule .sch-now-tag { color: var(--sch-now); font-family: 'PFBagueSlabPro-Bold', Georgia, serif; }

.schedule .sch-running { box-shadow: inset 0 0 0 2px var(--edge); }
.schedule .sch-show.sch-past {
    --edge: var(--sch-past);
    opacity: .45;
    filter: grayscale(1);
}

@container (max-width: 170px) {
    .sch-show img { display: none; }
}
@container (max-width: 95px) {
    .sch-meta, .sch-tag { display: none; }
}
@container (max-height: 62px) {
    .sch-show img, .sch-meta { display: none; }
}

/* ---------- legend ---------- */
.schedule .sch-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 12px;
    color: var(--sch-muted);
    font-size: 14px;
}
.schedule .sch-legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 2px;
    vertical-align: -1px;
    background: var(--edge);
}
.schedule .sch-legend .sch-past { --edge: var(--sch-past); }

/* ---------- phones: the day as a list by film ---------- */
.schedule .sch-list { display: none; }

.schedule .sch-film {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--sch-line);
}
.schedule .sch-film:first-child { padding-top: 0; }
.schedule .sch-film > img {
    flex: none;
    align-self: flex-start;
    width: 76px;
    aspect-ratio: 2 / 3;
    border-radius: 3px;
    object-fit: contain;
}
.schedule .sch-film-info { min-width: 0; }
.schedule .sch-film h3 {
    margin: 0 0 2px;
    color: var(--sch-text);
    font: 18px/1.2 'PFBagueSlabPro-Black', Georgia, serif;
    text-transform: none;
}
.schedule .sch-film-meta {
    margin-bottom: 8px;
    color: var(--sch-muted);
    font-size: 13px;
}
.schedule .sch-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
/* showtime buttons, as the site's: solid in the availability colour */
.schedule .sch-chip {
    display: block;
    padding: 5px 10px;
    border: 0;
    border-radius: 0;
    background: var(--edge);
    color: #fff;
    font: 16px/1.2 'PFBagueSlabPro-Bold', Georgia, serif;
    text-decoration: none;
}
.schedule .sch-chips .sch-chip:hover,
.schedule .sch-chips .sch-chip:focus { color: #fff; text-decoration: none; filter: brightness(1.12); }
.schedule .sch-chip span {
    display: block;
    color: rgba(255, 255, 255, .85);
    font: 12px/1.3 'PFBagueSlabPro-Regular', Georgia, serif;
}
.schedule .sch-chips .sch-chip.sch-past,
.schedule .sch-chips .sch-chip.sch-past:hover {
    --edge: var(--sch-past);
    background: var(--sch-chip);
    color: var(--sch-text);
    opacity: .6;
    filter: none;
}
.schedule .sch-chip.sch-past span { color: var(--sch-muted); }

@media (max-width: 767px) {
    .schedule {
        margin: 16px 0;
        padding: 14px 12px 16px;
    }
    .schedule .sch-head h1 { font-size: 26px; }
    .schedule .sch-day { font-size: 16px; }
    /* the dates scroll sideways instead of wrapping */
    .schedule .sch-dates {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -12px 14px;
        padding: 0 12px 2px;
    }
    .schedule .sch-dates a { font-size: 15px; padding: 7px 12px; }
    .schedule .sch-timeline { display: none; }
    .schedule .sch-list { display: block; }
}

/* showtimes that only open the details (finished, sold out) are buttons:
   same look as the linked ones */
.schedule button.sch-show,
.schedule button.sch-chip {
    appearance: none;
    margin: 0;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    text-align: left;
    cursor: pointer;
}
.schedule button.sch-show:hover,
.schedule button.sch-show:focus-visible { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }

/* ---------- details popup (website page) ---------- */
html:has(.sch-dialog[open]) { overflow: hidden; }
.schedule .sch-dialog {
    width: min(880px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--sch-panel);
    color: var(--sch-text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
    overflow: auto;
    overscroll-behavior: contain;
}
.schedule .sch-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.schedule .sch-dlg-close {
    position: sticky;
    top: 8px;
    float: right;
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: 8px 8px -48px 0;
    border: 0;
    border-radius: 50%;
    background: var(--sch-chip);
    color: var(--sch-text);
    font: 28px/40px Arial, sans-serif;
    cursor: pointer;
}
.schedule .sch-dlg-close:hover { filter: brightness(.92); }

.schedule .sch-dlg {
    display: grid;
    grid-template-columns: 230px 1fr;
    grid-template-areas:
        "poster head"
        "poster when"
        "poster info";
    grid-template-rows: auto auto 1fr;
    gap: 16px 26px;
    padding: 26px;
}
.schedule .sch-dlg-poster {
    grid-area: poster;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 4px;
    object-fit: contain;
    object-position: top;
}
.schedule .sch-dlg-head  { grid-area: head; padding-right: 40px; }
.schedule .sch-dlg-when  { grid-area: when; }
.schedule .sch-dlg-info  { grid-area: info; }
.schedule .sch-dlg-kind {
    display: inline-block;
    padding: var(--sch-kind-pad, 0);
    background: var(--sch-kind-bg, transparent);
    color: var(--sch-kind-text, var(--sch-muted));
    font: 13px/1.3 'PFBagueSlabPro-Bold', Georgia, serif;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.schedule .sch-dlg-title {
    margin: 4px 0 6px;
    color: var(--sch-text);
    font: 28px/1.15 'PFBagueSlabPro-Black', Georgia, serif;
    text-transform: none;
}
.schedule .sch-dlg-sub { color: var(--sch-muted); font-size: 15px; }

/* the chosen showtime and its booking button */
.schedule .sch-dlg-pick {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2px 16px;
    padding: 12px 14px;
    border-left: 5px solid var(--edge, var(--sch-past));
    border-radius: 0;
    background: var(--bg, var(--sch-chip));
}
/* finished, sold out or started: no booking, so no availability colour
   (the note says why) */
.schedule .sch-dlg-pick.is-closed { --edge: var(--sch-past); --bg: var(--sch-chip); }
.schedule .sch-dlg-pick.sch-no.is-closed { --edge: var(--sch-no); --bg: var(--sch-no-bg); }
.schedule .sch-dlg-time { font: 17px/1.3 'PFBagueSlabPro-Bold', Georgia, serif; }
.schedule .sch-dlg-room { grid-column: 1; color: var(--sch-muted); font-size: 15px; }
.schedule .sch-dlg-note { grid-column: 1; color: var(--tag, var(--sch-muted)); font: 14px/1.3 'PFBagueSlabPro-Bold', Georgia, serif; }
.schedule .sch-dlg-book {
    grid-column: 2;
    grid-row: 1 / span 3;
    padding: 11px 20px;
    border: 2px solid var(--sch-book, var(--sch-text));
    border-radius: 0;
    background: var(--sch-book, var(--sch-text));
    color: var(--sch-book-text, var(--sch-panel));
    font: 17px/1.2 'PFBagueSlabPro-Bold', Georgia, serif;
    text-decoration: none;
    white-space: nowrap;
}
/* inverted on hover, as the site's buttons */
.schedule .sch-dlg-book:hover,
.schedule .sch-dlg-book:focus {
    background: var(--sch-panel);
    color: var(--sch-book, var(--sch-text));
    text-decoration: none;
}
.schedule .sch-dlg-book[hidden],
.schedule .sch-dlg-note[hidden] { display: none; }

.schedule .sch-dlg-shows { margin-top: 12px; }
.schedule .sch-dlg-shows.is-single { display: none; }
.schedule .sch-dlg-label {
    color: var(--sch-muted);
    font: 13px/1.3 'PFBagueSlabPro-Bold', Georgia, serif;
    letter-spacing: .04em;
    text-transform: uppercase;
}
/* the chosen one, as the site's chosen showtime: outlined in its colour */
.schedule .sch-dlg-shows .sch-chips .sch-chip.is-selected,
.schedule .sch-dlg-shows .sch-chips .sch-chip.is-selected:hover {
    background: var(--sch-panel);
    color: var(--edge);
    box-shadow: inset 0 0 0 2px var(--edge);
    opacity: 1;
    filter: none;
}
.schedule .sch-dlg-shows .sch-chips .sch-chip.is-selected span { color: var(--edge); }

.schedule .sch-dlg-desc {
    margin: 0 0 12px;
    /* the site's p rule sets a dark text colour, unreadable on the dark panel */
    color: var(--sch-text);
    font-size: 16px;
    line-height: 1.55;
    text-align: justify;
}
.schedule .sch-dlg-desc :where(p, span, div, li, b, strong, em, i) { color: inherit; }
.schedule .sch-dlg-credits {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    margin: 0 0 12px;
    font-size: 15px;
}
.schedule .sch-dlg-credits dt { color: var(--sch-muted); font-weight: normal; }
.schedule .sch-dlg-credits dd { margin: 0; }
.schedule .sch-dlg-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }
.schedule .sch-dlg-links a { color: var(--sch-text); text-decoration: underline; }

@media (max-width: 640px) {
    .schedule .sch-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }
    .schedule .sch-dlg {
        grid-template-columns: 92px 1fr;
        grid-template-areas:
            "poster head"
            "when when"
            "info info";
        gap: 14px;
        padding: 16px;
    }
    .schedule .sch-dlg-title { font-size: 21px; }
    /* justified, a phone-wide column opens wide gaps between words */
    .schedule .sch-dlg-desc { font-size: 15px; text-align: left; }
    .schedule .sch-dlg-pick { grid-template-columns: 1fr; }
    .schedule .sch-dlg-book {
        grid-column: 1;
        grid-row: auto;
        margin-top: 8px;
        text-align: center;
    }
}

/* ---------- full screen (/schedule-full-screen), a 1920x1080 stage ---------- */
html:has(body.sch-fs) { overflow: hidden; }
body.sch-fs {
    margin: 0;
    overflow: hidden;
    background: var(--sch-page);
}
.sch-fs #sch-stage {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    width: 1920px;
    height: 1080px;
    padding: 0;
    overflow: hidden;
    transform-origin: 0 0;
}
.sch-fs [data-schedule-live] {
    display: flex;
    flex-direction: column;
    height: 100%;
}
/* The header row is the board's (#all-movies, .page-title and
   .plsc-program-dates from board_1.css): the same 128px band, with the
   logo cap the board sets inline, and the page's text colour as the board
   uses on dark brand pages. The timeline starts where the board's first
   row does, with the same 10px side margins. */
.sch-fs .sch-fs-head {
    flex: none;
    box-sizing: border-box;
    height: 128px;
}
.sch-fs .sch-fs-head > div:first-child img {
    max-width: 520px;
    max-height: 118px;
    width: auto;
    height: auto;
}
.sch-fs .sch-fs-head .page-title,
.sch-fs .sch-fs-head .plsc-program-dates .plsc-start-date { color: var(--sch-page-text); }

/* The supplier's mark, as on the board: small, subtle, one colour, drawn
   from the file's shape. It takes the page's own text colour, so it suits
   a dark brand page on the light theme as well as the dark theme. */
.sch-fs .sch-fs-mark {
    position: absolute;
    right: 18px;
    bottom: 10px;
    width: 104px;
    height: 32px;
    opacity: .45;
    background-color: var(--sch-page-text);
    -webkit-mask: var(--vendor-mark) no-repeat right bottom / contain;
    mask: var(--vendor-mark) no-repeat right bottom / contain;
}
/* the panel and its rows share out the screen's height */
.sch-fs .schedule {
    --sch-label: 230px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0 10px 10px;
    padding: 0;
    border-radius: var(--sch-radius, 0);
    overflow: hidden;
    font-size: 18px;
}
.sch-fs .schedule .sch-timeline,
.sch-fs .schedule .sch-scroll,
.sch-fs .schedule .sch-grid,
.sch-fs .schedule .sch-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.sch-fs .schedule .sch-timeline { border: 0; border-radius: 0; }
.sch-fs .schedule .sch-scroll { overflow: hidden; }
.sch-fs .schedule .sch-grid { min-width: 0; }
.sch-fs .schedule .sch-hours { flex: none; height: 46px; }
.sch-fs .schedule .sch-hours-lane span { top: 10px; font-size: 20px; line-height: 26px; }
.sch-fs .schedule .sch-venue { flex: none; padding: 7px 18px; font-size: 18px; line-height: 22px; }
.sch-fs .schedule .sch-row { flex: 1 1 0; height: auto; min-height: 0; max-height: 170px; }
.sch-fs .schedule .sch-room { padding: 0 18px; font-size: 22px; }
.sch-fs .schedule .sch-show { top: 8px; bottom: 8px; gap: 10px; padding: 6px; border-left-width: 6px; }
.sch-fs .schedule .sch-show b { font-size: 22px; }
.sch-fs .schedule .sch-time { font-size: 19px; }
.sch-fs .schedule .sch-meta,
.sch-fs .schedule .sch-tag { font-size: 16px; }
.sch-fs .schedule .sch-now span { top: 11px; font-size: 18px; line-height: 24px; padding: 1px 8px; }
.sch-fs .schedule .sch-message { margin: auto; font-size: 34px; }
.sch-fs .schedule .sch-legend {
    flex: none;
    margin: 0;
    padding: 10px 18px;
    border-top: 1px solid var(--sch-line);
    font-size: 17px;
}
