/* rohin.me - page 2, Radio (js/scenes/radio.js): the parts added on 11-14. The schedule and the antennas are two views of
   the right-hand panel; an antenna channel plays in the same player as the station, with its level where the cover is. */

/* the two views */
.radio-tabs { display: flex; gap: var(--s-1); min-width: 0; }
.radio-tab { min-height: var(--tap); padding: 0 .7rem; margin-left: -.7rem; border-radius: var(--r-pill); font: inherit; font-size: var(--t-body); font-weight: 600; color: var(--ink-2); transition: color var(--fast), background var(--fast); }
.radio-tab + .radio-tab { margin-left: 0; }
.radio-tab:hover { color: var(--ink); }
.radio-tab[aria-selected="true"] { color: var(--ink); }
.radio-tabs:has(.radio-tab:not([hidden]) + .radio-tab:not([hidden])) .radio-tab[aria-selected="true"] { background: var(--accent-soft); }
.radio-tab[hidden] { display: none; }
.radio-day-head { align-items: center; }
.radio-sched { display: grid; gap: var(--s-3); min-width: 0; }
.radio-sched[hidden], .radio-ant[hidden], .radio-back[hidden], .radio-prog[hidden], .radio-count[hidden] { display: none; }

/* the antennas: a row per kind (Air, Sea, Weather, Ham), a button per channel; lit while someone is talking */
.radio-ant { display: grid; gap: var(--s-1); align-content: start; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; }
.ant-group { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); gap: var(--s-2); align-items: start; }
.ant-group h4 { margin: 0; min-height: var(--tap); display: flex; align-items: center; font-size: var(--t-small); font-weight: 500; color: var(--ink-2); }
.ant-list { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-1); min-width: 0; }
.ant { display: inline-flex; align-items: center; gap: .45rem; min-height: var(--tap); max-width: 100%; padding: 0 .75rem 0 .6rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--glass); color: var(--ink); font: inherit; font-size: var(--t-small); transition: border-color var(--fast), background var(--fast), transform var(--fast) var(--ease); }
.ant:hover { border-color: var(--line-strong); }
.ant:active { transform: scale(.97); }
.ant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ant-mhz { display: none; }   /* the frequency shows in the player once a channel plays */
.ant-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); opacity: .55; }
.ant[data-quiet] .ant-dot { opacity: .25; }
.ant[data-now] .ant-dot { background: var(--accent); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.ant[data-on] { border-color: var(--accent); background: var(--accent-soft); }

/* the player with a channel: the level of the last minutes instead of the cover, "Station" to go back */
.radio-art { position: relative; }
.radio-wave { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.radio-player[data-ant] .radio-wave { display: block; }
.radio-player[data-ant] .radio-art-img, .radio-player[data-ant] .radio-glow { visibility: hidden; }
.radio-back { min-height: var(--tap); }

@media (max-width: 720px) {
  .ant-group { grid-template-columns: 3.6rem minmax(0, 1fr); gap: var(--s-1); }
  .ant { padding: 0 .65rem 0 .6rem; }
  .radio-controls .play { width: auto; flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .ant { transition: none; } }

/* ---- 15 Nov: two more views, "Played" (the station's time machine) and "New" (the newest albums on the air) */
@media (min-width: 901px) { .radio { height: min(100%, 36rem); } }
.radio[data-view="past"] .radio-day, .radio[data-view="new"] .radio-day { grid-template-rows: auto minmax(0, 1fr); align-content: stretch; }
@media (max-width: 900px) { .radio[data-view="past"], .radio[data-view="new"] { grid-template-rows: auto minmax(0, 1fr); align-content: stretch; } }
.radio-tabs { flex-wrap: nowrap; }
.radio-past[hidden], .radio-new[hidden], .past-axis[hidden], .past-note[hidden] { display: none; }
.past-note { flex: none; align-self: center; font-size: var(--t-tiny); color: var(--ink-2); }

/* Played: a strip of days ("Today" at the right end), a strip of the day's 24 hours (each a show, the now line on
   today), then the hour's songs with their covers, scrolling inside the panel */
.radio-past { display: grid; grid-template-rows: auto auto auto auto auto minmax(0, 1fr); gap: var(--s-1); min-height: 0; min-width: 0; }
.past-top { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.past-days, .past-hours { position: relative; display: flex; height: var(--tap); touch-action: none; min-width: 0; flex: 1 1 auto; }
.past-days .slot, .past-hours .slot { position: relative; flex: 1 1 0; min-width: 0; height: 100%; }
.past-hours .slot[data-edge] { margin-left: 3px; }
.radio .radio-day .past-days .slot[disabled]::before, .radio .radio-day .past-hours .slot[disabled]::before { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.radio .radio-day .past-hours .slot[data-future]::before { background: none; border: 1px dashed var(--line); }
.radio .radio-day .past-days .slot[aria-pressed="true"]::before, .radio .radio-day .past-hours .slot[aria-pressed="true"]::before { background: var(--accent); }
.past-days[data-few] .slot span { display: flex; align-items: center; justify-content: center; position: relative; height: 100%; padding: 0 2px; font-size: var(--t-tiny); font-weight: 600; color: var(--ink); overflow: hidden; white-space: nowrap; }
.radio .radio-day .past-days[data-few] .slot[aria-pressed="true"] span { color: var(--accent-ink); }
.past-days[data-few] .slot[disabled] span { color: var(--ink-2); font-weight: 500; }
.past-axis { display: flex; justify-content: space-between; font-size: .6875rem; color: var(--ink-2); }
.past-hours-wrap { position: relative; padding-top: 8px; margin-top: var(--s-1); }
.past-hours-wrap .ribbon-now[hidden] { display: none; }
.past-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); min-width: 0; padding-top: var(--s-2); font-size: var(--t-small); color: var(--ink-2); }
.past-head b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.past-head span { flex: none; font-variant-numeric: tabular-nums; }
.past-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; display: grid; align-content: start; margin: 0 calc(-1 * var(--s-2)); padding: 0 var(--s-2); }
.past-list li { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: .4rem 0; border-top: 1px solid var(--line); }
.past-list li:first-child { border-top: 0; }
.pl-text { display: grid; min-width: 0; font-size: var(--t-small); line-height: 1.3; }
.pl-text b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-text span { color: var(--ink-2); font-size: var(--t-tiny); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.past-list time { font-size: var(--t-tiny); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* covers: the station's own, fading in; an empty square while one loads or when there is none */
.cov { display: block; aspect-ratio: 1; border-radius: var(--r-1); overflow: hidden; background: var(--bg-sunk); border: 1px solid var(--line); }
.cov img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--med) var(--ease); }
.cov img.is-in { opacity: 1; }

/* New: the newest albums now in a show, on shelves by the day they came */
.radio-new { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; min-width: 0; }
.nw-top { position: absolute; top: 0; right: 0; z-index: 1; line-height: 1.4; }
.nw-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; display: grid; align-content: start; gap: var(--s-4); }
.nw-group h4 { margin: 0 0 var(--s-2); font-size: var(--t-small); font-weight: 500; color: var(--ink-2); }
.nw-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr)); gap: var(--s-4) var(--s-3); margin: 0; padding: 0; list-style: none; }
.nw-album { display: grid; gap: .1rem; min-width: 0; align-content: start; font-size: var(--t-tiny); line-height: 1.3; }
.nw-album .cov { margin-bottom: .35rem; box-shadow: 0 10px 18px -12px var(--shade); }
.nw-album b { font-size: var(--t-small); font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw-album span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw-none { color: var(--ink-2); font-size: var(--t-small); }

@media (max-width: 720px) {
  .radio-tab { padding: 0 .55rem; margin-left: -.55rem; }
  .radio-tabs { gap: 0; }
  .radio-day-head:has(.radio-tab:nth-child(4):not([hidden])) .radio-count { display: none; }
  .nw-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3) var(--s-2); }
  .past-list li { grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: var(--s-2); }
}
@media (prefers-reduced-motion: reduce) { .cov img { transition: none; } }

/* ---- 15 Nov (r11): a phone with Safari's bars shows about 660 px: there the schedule keeps only the next show, so no
   row is cut in half at the panel's edge */
@media (max-width: 720px) and (max-height: 760px) { .radio-next li:nth-child(n+2) { display: none; } }

/* ---- 15 Nov (r12): talk hours. From 16 Nov the station has a talk hour at 07:00 and 22:00 (interviews, lectures,
   documentaries). It reads as itself: a calm "Talk" in small capitals, then the programme and its part. A programme
   without a picture shows its series in large type where the cover is. */
.talk-tag { font-style: normal; font-size: .6875rem; font-weight: 600; text-transform: uppercase; --ls: .12em; color: var(--ink-2); margin-right: .35rem; }
.radio-next li[data-talk] span { color: var(--ink); }
.ribbon-detail b .talk-tag { color: var(--ink-2); }
.radio-talkcard { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: flex-end; padding: 10%; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--bg-raise)), var(--bg-sunk)); }
.radio-player[data-card] .radio-talkcard { display: flex; }
.radio-player[data-card] .radio-art-img { visibility: hidden; }
.radio-talkcard span { display: none; font-size: .625rem; font-weight: 600; text-transform: uppercase; --ls: .14em; color: var(--ink-2); }
.radio-talkcard b { font-family: var(--font-serif); font-weight: 500; font-size: clamp(.95rem, .6rem + 1.2vw, 1.6rem); line-height: 1.1; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.radio-player[data-ant] .radio-talkcard { display: none; }
.ribbon .slot[data-talk] { z-index: 1; }
.ribbon .slot[data-talk]::before { inset: 0 2px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ink) 30%, transparent) 0 2px, color-mix(in srgb, var(--ink) 14%, transparent) 2px 6px); box-shadow: 0 0 0 2px var(--bg-raise); }
.ribbon .slot[data-talk][data-now]::before { background: var(--accent); }
.ribbon .slot[data-talk][data-picked]::before, .ribbon .slot[data-talk]:hover::before { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ink) 50%, transparent) 0 2px, color-mix(in srgb, var(--ink) 26%, transparent) 2px 6px); }
.cov-talk { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--bg-sunk)); }
.cov-talk span { font-size: .5625rem; font-weight: 600; text-transform: uppercase; --ls: .12em; color: var(--ink-2); }

/* ---- 15 Nov (r12): closer to the station's own page (Rohin: "Make radio look more like radio.rohin.me"): the player
   takes on the cover's colour, the show in small spaced capitals, the title in the serif, a larger cover with a deep
   soft shadow, a plain 4 px progress line, and the lists under small capitals with a hairline. Soft look only; the
   other colour versions keep their own rules (css/look.css). */
:root[data-palette="classic"] {
  & .radio-player { background: linear-gradient(165deg, rgb(var(--cover-rgb, 128 128 128) / var(--cover-a, 0)) 0%, transparent 72%), var(--glass); transition: background var(--slow); }
  & .radio-player[style*="--cover-rgb"] { --cover-a: .30; }
  & .radio-show { font-size: .6875rem; font-weight: 600; text-transform: uppercase; --ls: .14em; color: var(--ink-2); display: flex; align-items: center; gap: .5rem; }
  & .radio-player[data-playing] .radio-show::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
  & .radio-title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.6rem, 1.05rem + 1.7vw, 2.5rem); line-height: 1.06; text-wrap: balance; }
  & .radio-by { font-size: var(--t-body); }
  & .radio-art { border-radius: 14px; border: 0; box-shadow: 0 24px 56px -22px var(--shade), 0 0 0 1px var(--line); }
  & .radio-track { height: 4px; border-radius: 2px; }
  & .radio-up { border-top: 0; padding-top: var(--s-2); }
  & .radio-up h3 { margin: 0; padding-bottom: var(--s-2); border-bottom: 1px solid var(--line); font-size: .6875rem; font-weight: 600; text-transform: uppercase; --ls: .14em; color: var(--ink-2); }
  & .radio-next { gap: 0 var(--s-5); }
  & .radio-next li { padding: .45rem 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  & .radio-next time { font-size: var(--t-tiny); color: var(--ink-2); align-self: center; }
  & .ribbon-detail b { font-family: var(--font-serif); font-weight: 500; font-size: 1.125rem; }
  & .ribbon-detail b .talk-tag, & .radio-talkcard span { font-family: var(--font); }
  & .past-head b { font-family: var(--font-serif); font-weight: 500; font-size: 1.0625rem; }
  & .nw-album .cov, & .past-list .cov { border-radius: 6px; border: 0; }
  & .nw-album .cov { border-radius: 10px; box-shadow: 0 14px 26px -16px var(--shade); }
}
:root[data-palette="classic"][data-theme="light"] .radio-player[style*="--cover-rgb"] { --cover-a: .20; }
@media (min-width: 901px) { :root[data-palette="classic"] .radio-player { grid-template-columns: clamp(10rem, 17vw, 15rem) minmax(0, 1fr); } }
@media (max-width: 720px) {
  :root[data-palette="classic"] .radio-player { grid-template-columns: 6.25rem minmax(0, 1fr); }
  :root[data-palette="classic"] .radio-title { font-size: 1.5rem; line-height: 1.08; }
  :root[data-palette="classic"] .radio-by { font-size: var(--t-small); }
  :root[data-palette="classic"] .radio-next li { padding: .3rem 0; }
}

/* ---- 11-16 (UX round): whose station it is, the talk hours named on the ribbon, the Data panel's jump row */
.radio-station { margin: 0; font-size: .6875rem; font-weight: 600; text-transform: uppercase; --ls: .14em; letter-spacing: var(--ls); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-player[data-ant] .radio-station { display: none; }      /* an antenna channel is not the station */
.ribbon-talks { position: relative; height: 1rem; margin-bottom: -.35rem; }
.ribbon-talks[hidden] { display: none; }
.ribbon-talk { position: absolute; bottom: 0; font-size: .6875rem; font-weight: 600; line-height: 1; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ribbon-talk::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: .3rem; vertical-align: -1px; border-radius: 2px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ink) 50%, transparent) 0 1.5px, color-mix(in srgb, var(--ink) 18%, transparent) 1.5px 4px); }
#radio .data-jump { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-2); }
@media (max-width: 720px) {
  .radio-art { grid-row: 1 / span 4; }
}
/* QA 11-16: the schedule card never cut off. Wide screens: the day starts at the card's top (no empty band over the tabs)
   and Next lists up to six. Upright tablets: up to six. Phones: the card takes what is left under the player and its
   schedule scrolls inside it (pan-y hands a sideways drag to the page swipe); Next keeps three there. */
.radio-day { align-content: start; }
@media (max-width: 720px) {
  .radio { grid-template-rows: auto minmax(0, 1fr); align-content: stretch; }
  .radio-day { grid-template-rows: auto minmax(0, 1fr); align-content: stretch; }
  .radio-sched { min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; align-content: start; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  .radio-next li:nth-child(n+4) { display: none; }
}
@media (max-width: 720px) and (max-height: 760px) { .radio-next li:nth-child(n+2) { display: grid; } .radio-next li:nth-child(n+4) { display: none; } }
/* a small phone (320 wide): smaller tabs, so four fit; the title on one line, cut short, never into the artist's line */
@media (max-width: 359px) {
  .radio-tab { padding: 0 .4rem; margin-left: -.4rem; font-size: var(--t-small); }
  .radio-title, :root[data-palette="classic"] .radio-title { font-size: 1.1875rem; -webkit-line-clamp: 1; line-clamp: 1; }
}
