/* Upcoming (SPEC 61): Home's Upcoming row and a channel's Upcoming section, the countdown pages (a premiere before its
   time, a scheduled stream before it starts), Remind me, a premiere on the watch page, and NoRep Studio's scheduled
   streams, schedule form and Calendar. Colours come from style.css's tokens, so light and dark both follow the system. */

/* The row of cards ---------------------------------------------------------- */

.upcoming-row { margin-bottom: 28px; }
.upcoming-row-title { display: flex; align-items: center; gap: 8px; }
/* position: relative keeps absolutely placed bits (screen-reader text) inside the scrolling row, not the page */
.upcoming-row-list {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 320px); gap: 18px;
  overflow-x: auto; margin: -4px; padding: 4px 4px 8px; scrollbar-width: thin;
}
.upcoming-card { min-width: 0; }
.upcoming-thumb, .upcoming-stage {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.10), transparent 60%),
    linear-gradient(135deg, hsl(var(--hue) 50% 28%), hsl(calc(var(--hue) + 50) 55% 12%));
}
.upcoming-thumb img, .upcoming-stage img { width: 100%; height: 100%; object-fit: cover; }
.upcoming-thumb-fallback, .upcoming-stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.upcoming-thumb-fallback .avatar, .upcoming-stage-fallback .avatar { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35); }
.upcoming-pill {
  display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 3px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.78); color: #fff; font: 800 12px/1.1 var(--font); letter-spacing: 0.06em; text-transform: uppercase;
}
.upcoming-pill .icon-play { fill: currentColor; }
.upcoming-thumb .upcoming-pill { position: absolute; left: 10px; top: 10px; }
.upcoming-card:hover .upcoming-thumb img { transform: scale(1.035); }
.upcoming-thumb img { transition: transform 0.35s ease; }
.upcoming-card .card-meta time { color: var(--text); font-weight: 600; }
.channel-upcoming { margin-top: 4px; }

/* Countdown pages --------------------------------------------------------- */

.upcoming-page { max-width: 1040px; }
.upcoming-stage-shade {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 14px; padding: 48px 16px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0)); color: #fff;
}
.upcoming-countdown {
  margin: 0; font-size: 17px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.upcoming-countdown-label { font-weight: 600; }
.upcoming-countdown-time { font-size: 26px; font-weight: 800; }
.upcoming-when { display: flex; align-items: center; gap: 6px; margin: -4px 0 14px; color: var(--text-2); font-weight: 600; }
.upcoming-when .icon { flex: none; }
.upcoming-waiting[hidden] { display: none; }
.upcoming-note { margin-top: 14px; max-width: 70ch; }
.upcoming-desc { margin-top: 14px; }

.btn-remind .remind-on-icon { display: none; }
.btn-remind[aria-pressed="true"] .remind-on-icon { display: inline-flex; }
.btn-remind[aria-pressed="true"] .remind-off-icon { display: none; }
.btn-remind .remind-on-icon, .btn-remind .remind-off-icon { align-items: center; }
.btn-remind[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.btn-remind[aria-busy="true"] { opacity: 0.7; cursor: progress; }

/* A premiere on the watch page ------------------------------------------- */

.premiere-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -2px 0 12px; font-size: 14px; color: var(--text-2); }
.premiere-bar.is-over .live-dot { animation: none; }
.premiere-bar.is-over .premiere-pill { background: var(--surface-2); color: var(--text); }
/* The live chat beside the player (chat.css's chat-replay slot): as tall as the player */
.premiere-chat > .chat { height: 100%; }

/* NoRep Studio: scheduled streams, the schedule form ------------------------ */

.scheduled-panel .panel-head { align-items: center; padding-bottom: 4px; }
.scheduled-list { list-style: none; margin: 0; padding: 4px 18px 10px; }
.scheduled-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.scheduled-item:first-child { border-top: 0; }
.scheduled-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 240px; }
.scheduled-title { font-weight: 700; overflow-wrap: anywhere; }
.scheduled-title:hover { text-decoration: underline; }
.scheduled-item.is-expired .scheduled-title { color: var(--text-2); }
.scheduled-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scheduled-text [data-reminder-count], .schedule-reminders { display: inline-flex; align-items: center; gap: 6px; }

.schedule-new { display: grid; gap: 10px; }
.scheduled-list + .schedule-new { border-top: 1px solid var(--line); padding-top: 16px; }
.schedule-new-title { font-size: 15px; font-weight: 700; }
.schedule-new .schedule-form { max-width: 640px; margin-top: 4px; }
.schedule-panel { display: grid; gap: 16px; max-width: 760px; padding: 18px; }
.schedule-reminders { font-weight: 600; }
.schedule-thumb {
  display: block; width: 100%; max-width: 360px; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  margin-bottom: 8px; border-radius: 10px; background: var(--surface-2);
}
.schedule-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* Nothing in the form is wider than the panel on a 320 px phone: grid items may shrink, and so may the date and file fields */
.schedule-new > *, .schedule-form > *, .schedule-panel > * { min-width: 0; }
.schedule-form input[type="datetime-local"], .schedule-form input[type="file"] { width: 100%; min-width: 0; max-width: 100%; }
.schedule-cancel { display: grid; gap: 6px; justify-items: start; padding-top: 16px; border-top: 1px solid var(--line); }

/* NoRep Studio > Calendar ------------------------------------------------- */

.cal { display: grid; gap: 10px; padding: 16px 18px 18px; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cal-title { font-size: 20px; font-weight: 700; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-step { width: 38px; padding: 0; }
.cal-step-next svg { transform: rotate(180deg); }
.cal-today[aria-current="date"] { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
.cal-status:empty { display: none; }
.cal[aria-busy="true"] .cal-grid { opacity: 0.6; }

.cal-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.cal-grid th { padding: 6px 6px; font-size: 12px; font-weight: 700; color: var(--text-2); text-align: left; }
.cal-grid th abbr { text-decoration: none; }
.cal-day {
  height: 112px; padding: 4px; vertical-align: top; min-width: 0;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.cal-grid tr > .cal-day:last-child { border-right: 1px solid var(--line); }
.cal-grid tbody tr:last-child .cal-day { border-bottom: 1px solid var(--line); }
.cal-grid tbody tr:first-child .cal-day:first-child { border-top-left-radius: 10px; }
.cal-grid tbody tr:first-child .cal-day:last-child { border-top-right-radius: 10px; }
.cal-grid tbody tr:last-child .cal-day:first-child { border-bottom-left-radius: 10px; }
.cal-grid tbody tr:last-child .cal-day:last-child { border-bottom-right-radius: 10px; }
.cal-day.is-other { background: color-mix(in srgb, var(--bg) 55%, var(--surface)); }
.cal-day.is-other .cal-day-num { color: var(--text-3); }
.cal-day-num {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cal-day.is-today .cal-day-num { background: var(--accent); color: #fff; }
.cal-day.is-drop { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -3px; }

.cal-items { display: grid; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; min-width: 0; }
.cal-item { min-width: 0; --kind: var(--text-3); }
.cal-link {
  display: grid; gap: 1px; min-width: 0; padding: 4px 6px; border-radius: 6px;
  background: var(--surface-2); box-shadow: inset 3px 0 0 var(--kind); font-size: 12px; line-height: 1.3;
}
.cal-link:hover { background: var(--hover); }
.cal-meta { display: flex; flex-wrap: wrap; gap: 0 5px; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-label { color: var(--text); font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.cal-item-title { overflow: hidden; color: var(--text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cal-note { color: var(--text); font-weight: 700; }
.cal-reminders { display: inline-flex; align-items: center; gap: 3px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-scheduled { --kind: var(--chart-1); }
.cal-premiere { --kind: var(--accent); }
.cal-stream, .cal-live { --kind: var(--chart-2); }
.cal-video { --kind: var(--chart-3); }
.cal-item.is-draggable .cal-link { cursor: grab; }
.cal-item.is-dragging { opacity: 0.5; }

.cal-list-wrap { display: none; }
.cal-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.cal-list-date { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 15px; font-weight: 700; }
.cal-list-today {
  padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.cal-list .cal-link { padding: 8px 10px; font-size: 14px; }
.cal-list .cal-label { font-size: 11px; }
.cal-list .cal-item-title { white-space: normal; overflow-wrap: anywhere; }
.cal-empty { padding: 8px 0; }

/* A scheduled stream's live chat beside its countdown (open from the moment it's announced) */
.upcoming-page:has(> .upcoming-chat .chat) {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; max-width: 1480px;
}
.upcoming-chat:empty { display: none; }

/* Narrow ------------------------------------------------------------------ */

@media (max-width: 1100px) {
  .premiere-chat > .chat, .upcoming-chat > .chat { height: auto; }
  .upcoming-page:has(> .upcoming-chat .chat) { grid-template-columns: minmax(0, 1fr); max-width: 1040px; }
}

@media (max-width: 720px) {
  .upcoming-row-list { grid-auto-columns: minmax(240px, 78%); }
  .upcoming-page { padding: 0 0 56px; }
  .upcoming-stage { border-radius: 0; }
  .upcoming-info, .upcoming-chat { padding: 0 16px; }
  .upcoming-stage-shade { padding: 36px 12px 10px; }
  .upcoming-countdown-time { font-size: 22px; }
  .cal { padding: 14px; }
  .cal-grid-wrap { display: none; }
  .cal-list-wrap { display: block; }
  .cal-drag-hint { display: none; } /* phones get the list: no dragging there */
  .schedule-panel { padding: 14px; }
  .scheduled-list { padding: 4px 14px 10px; }
}

@media (max-width: 380px) {
  .upcoming-stage-shade { flex-direction: column; align-items: flex-start; }
  .scheduled-actions .btn { flex: 1 1 auto; }
}
