/* The parts added on top of style.css's rows, buttons, sheets and menus: the Library (Save, Follow,
   playlists, the DJ page), the player's Identify card and tracklist, Search's way out of one station,
   and the empty square for a genre the sound map doesn't place. Square corners, 1px rules, no shadows. */

/* Save on an episode's page: the bookmark's two marks */
.bm { display: grid; place-items: center; }
/* the two marks cross-fade like play/pause: the leaving one shrinks and blurs out */
.bm > svg { grid-area: 1 / 1; transition: opacity 200ms var(--ease-icon), scale 200ms var(--ease-icon), filter 200ms var(--ease-icon); }
.bm .bm-on, [aria-pressed="true"] .bm .bm-off { opacity: 0; scale: .25; filter: blur(4px); }
[aria-pressed="true"] .bm .bm-on { opacity: 1; scale: 1; filter: none; }

/* Follow: a plain small button (ink is for playback), "Following" once followed */
.show-acts, .dj-acts { margin-top: 4px; }
.show-acts .follow-btn, .dj-acts .follow-btn { grid-column: 1 / -1; justify-self: start; width: auto; }

/* counts in the Library switcher */
#lib-seg .n { margin-left: 8px; font-variant-numeric: tabular-nums; color: var(--text-3); }
#lib-seg [aria-pressed="true"] .n { color: inherit; opacity: .7; }
#lib-seg > * { flex: 1 1 0; min-width: 0; }   /* three equal parts, whatever their counts */
.lib-new { padding: 0 var(--gut) 12px; display: flex; }
.sub-sec + .sub-sec { margin-top: 28px; }

/* a playlist's cover: its first four pictures, or the first one alone */
.mosaic {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1; overflow: hidden; flex: none;
  background: var(--well); outline: 1px solid var(--line-faint); outline-offset: -1px;
}
.mosaic > .art { width: 100%; }
.mosaic:not(.none) { gap: 1px; background: var(--page); }   /* the pictures cut apart by a page-coloured hairline */
.mosaic.one { grid-template-columns: 1fr; }
.mosaic.two, .mosaic.three { grid-template-rows: minmax(0, 1fr); }
.mosaic.three { grid-template-rows: repeat(2, minmax(0, 1fr)); grid-template-areas: "a b" "a c"; }
.mosaic.two > .art, .mosaic.three > .art { aspect-ratio: auto; height: 100%; }
.mosaic.three > .art:first-child { grid-area: a; }
.mosaic.none { grid-template-columns: 1fr; place-items: center; color: var(--text-3); }
.mosaic.none svg { width: 40%; height: 40%; }
.row > .mosaic { width: 48px; }

/* a DJ has no picture of their own */
.dj-art { display: grid; place-items: center; background: var(--well); color: var(--text-2); width: 56px; flex: none; aspect-ratio: 1; }
.dj-art::before, .dj-art::after { display: none; }
.dj-art svg { width: 24px; height: 24px; }

/* playlist page */
.pl-head { gap: 10px; }
.pl-head .mosaic { width: min(176px, 48vw); margin-bottom: 6px; }
.pl-acts { margin-top: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
.pl-acts .icon-btn { width: 44px; padding: 0; }
.pl-acts .icon-btn:only-child { grid-column: auto; }
.pl-acts .icon-btn svg { margin: 0; }

/* sheets: a title, a name field, a list of playlists to tick */
.sheet-title { padding: 4px 0 0; display: grid; gap: 4px; }
.sheet-title p { color: var(--text-2); font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; }
.name-form input {
  flex: 1 1 0; min-width: 0; height: 48px; padding: 0 14px; border-radius: 0;
  border: 1px solid var(--line); background: var(--page); color: var(--text-1);
  font: inherit; font-family: var(--font-sans); font-size: 16px;           /* 16px: no zoom on iOS */
}
.name-form input::placeholder { color: var(--text-3); }
.name-form input:focus-visible { outline: 2px solid var(--text-1); outline-offset: -2px; }
.name-form input[aria-invalid="true"] { border-color: var(--fail); }
.name-form .btn { flex: none; height: 48px; }
.field-err { flex: 1 1 100%; color: var(--fail); font-size: 13px; line-height: 18px; }

.pick-list { display: grid; }
.pick-list button { justify-content: flex-start; min-height: 60px; }
.pick-list .pk-art { width: 40px; flex: none; }
.pick-list .pk-art .mosaic { width: 40px; }
.pick-list .pk-t { flex: 1; min-width: 0; display: grid; }
.pick-list .pk-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-list .pk-t small { font-size: 13px; line-height: 18px; color: var(--text-2); }
.pick-list .pk-check {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line-control); background: var(--page); transition: background-color 120ms ease-out;
}
.menu.pick-list .pk-check svg { width: 16px; height: 16px; color: var(--ink-fg); opacity: 0; }
.pick-list [aria-checked="true"] .pk-check { background: var(--ink-bg); border-color: var(--ink-bg); }
.menu.pick-list [aria-checked="true"] .pk-check svg { opacity: 1; }

/* a genre the sound map doesn't place: an empty square, so the line still reads as genres */
.gdot.none, .mark.none { background: none; border: 1px solid var(--line-control); }

/* DJ page: the stations as one plain line, "WWFM 240 · NTS 104 · Refuge 7" */
.dj-st-line { margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 18px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.dj-st-line .n { color: var(--text-3); font-variant-numeric: tabular-nums; }
/* one-off guest spots, folded under the DJ's own shows */
.dj-also > summary {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 var(--gut);
  list-style: none; cursor: pointer; color: var(--text-2); border-bottom: 1px solid var(--line-faint);
}
.dj-also > summary::-webkit-details-marker { display: none; }
.dj-also > summary .n { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dj-also > summary svg { margin-left: auto; width: 16px; height: 16px; color: var(--text-3); rotate: 90deg; }
.dj-also[open] > summary svg { rotate: -90deg; }
.dj-also > summary:focus-visible { outline: 2px solid var(--text-1); outline-offset: -2px; }

/* Search scoped to one station: the way out under the results */
.s-all { padding-top: 16px; }

/* What's this? under the transport: a plain button, then what Shazam heard (or didn't) in its place */
.np-id { position: relative; display: grid; gap: 8px; margin: -8px 0 16px; }
.np-id-ask { width: 100%; }
.np-id-ask.on { color: var(--text-2); cursor: default; }
.np-id-ask.on:active { scale: none; background-image: none; }
.np-id-bar { position: absolute; left: 1px; right: 1px; top: 41px; height: 2px; overflow: hidden; visibility: hidden; }
.np-id-bar.on { visibility: visible; }
.np-id-bar i { position: absolute; inset: 0 auto 0 0; width: 30%; background: var(--text-3); }
.np-id-bar.on i { animation: indet 1.2s var(--ease-sheet) infinite; }
.np-id:has(.np-id-card) { border-top: 1px solid var(--line); padding-top: 12px; }
.np-id-card { display: grid; grid-template-columns: auto minmax(0, 1fr) 44px; gap: 12px; align-items: start; }
.np-id-art { position: relative; width: 56px; aspect-ratio: 1; overflow: hidden; background: var(--well); }
.np-id-art:empty { display: none; }
.np-id-art::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px var(--art-edge); pointer-events: none; }
.np-id-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 200ms ease; }
.np-id-art img.ok { opacity: 1; }
.np-id-card:not(:has(.np-id-art)) { grid-template-columns: minmax(0, 1fr) 44px; }
.np-id-t { display: grid; gap: 2px; min-width: 0; padding-top: 2px; }
.np-id-t .label { color: var(--text-3); }
.np-id-t b { font-size: 16px; line-height: 22px; color: var(--text-1); overflow-wrap: break-word; }
.np-id-t span:not(.label) { font-size: 14px; line-height: 20px; color: var(--text-2); overflow-wrap: break-word; }
.np-id-t small { font-size: 13px; line-height: 18px; color: var(--text-3); overflow-wrap: break-word; }
.np-id-x { margin: -8px -12px 0 0; justify-self: end; color: var(--text-2); }
.np-id-x svg { width: 16px; height: 16px; }
.np-id-links { display: flex; flex-wrap: wrap; column-gap: 20px; }
.np-id-links a {
  display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; line-height: 20px; color: var(--text-1);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line-control);
}
.np-id-links a:active { color: var(--text-2); }
.np-id-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* The tracklist in the player, under Up next. The sheet already has its own side padding. */
.np-tl { margin-top: 24px; }
.np-tl .sec-head { margin-inline: -24px; padding-inline: 24px; }   /* the band runs edge to edge, like on pages */

@media (prefers-reduced-motion: reduce) {
  .bm > svg { scale: 1 !important; filter: none !important; }
  .pick-list .pk-check { transition: none; }
  .np-id-bar.on i { animation: none; width: 100%; opacity: .5; }
  .np-id-art img { transition: none; }
}
