/* ============================================================
   schedule-up-next.css
   The public schedule header's "Up next" strip
   (templates/public/_schedule_up_next.html).

   Wide screens fit every tile in one row. Narrow screens scroll the
   row sideways, and js/schedule-up-next.js marks that with classes on
   .schedule-up-next: .is-scrollable (page dots, and arrow buttons for
   mouse users) plus .has-more-left / .has-more-right (edge fades).
   Phones show about one and a half tiles so the cut-off one reads as
   "there's more", never as a layout bug.

   Colors come from the schedule theme variables in schedule.html.
   ============================================================ */

.schedule-up-next-slot {
    grid-column: 1 / -1;
    min-width: 0;
}

.schedule-up-next {
    /* Same as .schedule-hero's padding, so the row can run to the card's edges. */
    --up-next-bleed: clamp(1rem, 2.5vw, 1.5rem);
    --up-next-gap: 0.6rem;
    --up-next-fade: 2.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--schedule-border);
}

.schedule-up-next__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 1.75rem;
    margin-bottom: 0.6rem;
}

.schedule-up-next__title {
    margin: 0;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--schedule-primary) 8%, var(--schedule-surface));
    color: var(--schedule-primary-text);
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.schedule-up-next__meta {
    color: var(--schedule-muted);
    font-size: 0.8rem;
}

/* ---------- Scroll cues: dots, arrows, edge fades ---------- */

.schedule-up-next__nav {
    display: none;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.schedule-up-next.is-scrollable .schedule-up-next__nav {
    display: inline-flex;
}

/* The dots say how many there are, so the count would only repeat them. */
.schedule-up-next.is-scrollable .schedule-up-next__meta {
    display: none;
}

.schedule-up-next__dots {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.schedule-up-next__dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--schedule-border-strong);
    transition: background-color 0.2s ease;
}

.schedule-up-next__dot.is-active {
    background: var(--schedule-heading);
}

.schedule-up-next__arrow {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--schedule-border);
    border-radius: 999px;
    background: var(--schedule-surface);
    color: var(--schedule-heading);
    cursor: pointer;
}

.schedule-up-next__arrow:not(:disabled):hover {
    border-color: color-mix(in srgb, var(--schedule-primary) 42%, transparent);
}

.schedule-up-next__arrow:focus-visible {
    outline: 2px solid var(--schedule-primary);
    outline-offset: 2px;
}

.schedule-up-next__arrow:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Touch screens swipe; arrows are for mouse and trackpad users. */
@media (hover: hover) and (pointer: fine) {
    .schedule-up-next__arrow {
        display: inline-flex;
    }

    .schedule-up-next__dots {
        margin-right: 0.25rem;
    }
}

.schedule-up-next__list {
    display: flex;
    gap: var(--up-next-gap);
    /* Run edge to edge inside the card; the block padding keeps focus rings unclipped. */
    margin: -3px calc(-1 * var(--up-next-bleed));
    padding: 3px var(--up-next-bleed);
    position: relative;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--up-next-bleed);
    scrollbar-width: none;
}

.schedule-up-next__list::-webkit-scrollbar {
    display: none;
}

.schedule-up-next.has-more-right .schedule-up-next__list {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - var(--up-next-fade)), transparent);
    mask-image: linear-gradient(to right, black calc(100% - var(--up-next-fade)), transparent);
}

.schedule-up-next.has-more-left .schedule-up-next__list {
    -webkit-mask-image: linear-gradient(to right, transparent, black var(--up-next-bleed));
    mask-image: linear-gradient(to right, transparent, black var(--up-next-bleed));
}

.schedule-up-next.has-more-left.has-more-right .schedule-up-next__list {
    -webkit-mask-image: linear-gradient(to right, transparent, black var(--up-next-bleed), black calc(100% - var(--up-next-fade)), transparent);
    mask-image: linear-gradient(to right, transparent, black var(--up-next-bleed), black calc(100% - var(--up-next-fade)), transparent);
}

/* Five tiles fill a wide row; fewer keep that width instead of stretching.
   Tiles never squeeze below 12.25rem; past that the row scrolls. */
.schedule-up-next__item {
    display: flex;
    flex: 0 0 max(12.25rem, (100% - 4 * var(--up-next-gap)) / 5);
    min-width: 0;
    scroll-snap-align: start;
}

/* ---------- Tile ---------- */

.up-next-tile {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--schedule-border);
    border-radius: var(--radius-sm, 12px);
    background: var(--schedule-surface);
    color: var(--schedule-ink);
    text-decoration: none;
    transition: border-color 0.2s ease;
}

a.up-next-tile:hover {
    border-color: color-mix(in srgb, var(--schedule-primary) 42%, transparent);
    color: var(--schedule-ink);
}

a.up-next-tile:focus-visible {
    outline: 2px solid var(--schedule-primary);
    outline-offset: 1px;
}

.up-next-tile.is-live {
    border-color: color-mix(in srgb, var(--schedule-accent) 42%, transparent);
}

.up-next-tile__when {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    color: var(--schedule-heading);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.up-next-tile__time {
    overflow: hidden;
    text-overflow: ellipsis;
}

.up-next-tile.is-live .up-next-tile__time {
    color: var(--schedule-muted);
}

.up-next-pill {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: var(--hub-surface-alt);
    color: var(--schedule-muted);
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Today and Tomorrow match the game cards' proximity pills. */
.up-next-pill--today {
    background: var(--hub-amber-light);
    color: var(--schedule-heading);
}

.up-next-pill--tomorrow {
    background: var(--hub-blue-light);
    color: var(--schedule-heading);
}

.up-next-pill--live {
    background: var(--hub-red-light);
    color: var(--schedule-accent-text);
}

.up-next-pill__dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--schedule-accent);
}

.up-next-tile__teams {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.up-next-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.up-next-team__name,
.up-next-tile__opponent,
.up-next-tile__event-title,
.up-next-tile__venue span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.up-next-team__name {
    flex: 1 1 auto;
    color: var(--schedule-heading);
    font-size: 0.875rem;
    font-weight: 700;
}

.up-next-team__score {
    flex: 0 0 auto;
    color: var(--schedule-heading);
    font-size: 0.95rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.up-next-team.is-loser :is(.up-next-team__name, .up-next-team__score) {
    color: var(--schedule-muted);
    font-weight: 600;
}

.up-next-badge {
    display: inline-flex;
    flex: 0 0 1.375rem;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    overflow: hidden;
    border: 1px solid var(--schedule-border);
    border-radius: 6px;
    background: var(--hub-surface-alt);
    color: var(--schedule-muted);
    font-size: 0.5625rem;
    font-weight: 800;
    line-height: 1;
}

.up-next-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.up-next-badge--lg {
    flex-basis: 1.6rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 7px;
    font-size: 0.6rem;
}

/* With a team picked: "vs Owls" / "at Herons". */
.up-next-tile__matchup {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.up-next-tile__prefix {
    color: var(--schedule-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.up-next-tile__opponent {
    color: var(--schedule-heading);
    font-size: 0.95rem;
    font-weight: 800;
}

.up-next-tile__event {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.up-next-tile__event-title {
    color: var(--schedule-heading);
    font-size: 0.875rem;
    font-weight: 700;
}

.up-next-tile__event-type {
    color: var(--schedule-muted);
    font-size: 0.75rem;
}

/* Bottom-aligned, so tiles with fewer lines still line up. */
.up-next-tile__venue {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    margin-top: auto;
    color: var(--schedule-muted);
    font-size: 0.75rem;
}

.schedule-up-next__empty {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.6rem;
    margin: 0;
    color: var(--schedule-muted);
    font-size: 0.9rem;
}

.schedule-up-next__empty strong {
    color: var(--schedule-heading);
}

/* Phones: about one and a half tiles, and the public pages' 12px text floor. */
@media (max-width: 575.98px) {
    .schedule-up-next__item {
        flex: 0 0 68%;
    }

    .schedule-up-next__title,
    .schedule-up-next__meta,
    .up-next-pill,
    .up-next-tile__when,
    .up-next-tile__prefix,
    .up-next-tile__event-type,
    .up-next-tile__venue {
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .schedule-up-next__dot,
    .up-next-tile {
        transition: none;
    }
}

/* The printed list already has every game. */
@media print {
    .schedule-up-next-slot {
        display: none;
    }
}
