/* v2 theme — supplemental styles not covered by app.css (pagination, player
   reveal). Loaded after app.css. */

/* The HTML `hidden` attribute must always win — several design classes set an
   explicit `display` (grid/flex/...) that otherwise overrides the UA
   [hidden]{display:none} rule. Force it globally so JS hidden-toggling works. */
[hidden] { display: none !important; }

/* Hide the docked player until a station is selected. */
.player[hidden] { display: none !important; }

/* ===== Ads never block clicks (global) =====
   The negative-margin spacing can pull content over an ad, and a collapsed /
   unfilled AdSense slot can leave a 0-height-but-present iframe. Put every ad
   on a lower stacking layer than the content so clicks always reach the page,
   anywhere on the site. */
main > .ad-slot,
main > .ad { position: relative; z-index: 0; }
main > section,
main > .crumbs,
main > .page-head,
main > .st-hero,
main > .st-layout,
main > .fb-cols,
main > .as-main,
main > .prose,
main > .form-card,
main > .appband,
main > .flash,
main > #shazamBox { position: relative; z-index: 1; }

/* About stats: fit however many stats we have (3) without a trailing gap, and
   a smaller bottom margin (the design's 40px felt too big before the text). */
.info-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-bottom: var(--space-5); }

/* Podcast episodes hidden until "Load more". */
.eplist .ep.is-hidden { display: none; }

/* Podcast favorite button (analogous to the station heart). */
[data-act="podfav"] { transition: color .15s ease; }
[data-act="podfav"]:hover,
[data-act="podfav"].on { color: var(--accent-500, #2b4df2); }
[data-act="podfav"].on svg { fill: currentColor; }

/* Podcast episode artwork (image) with a play overlay. */
.ep { grid-template-columns: 56px 1fr; }
.ep-art {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  background: var(--bg-sunken);
  align-self: start;
}
.ep-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-art[data-act="play"] { cursor: pointer; }
.ep-ov {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  transition: opacity .15s ease;
}
.ep-art:hover .ep-ov,
.ep.playing .ep-ov,
.ep.loading .ep-ov { opacity: 1; }
.ep-ov .ic-pause,
.ep-ov .player-spinner { display: none; }
.ep.playing .ep-ov .ic-play { display: none; }
.ep.playing .ep-ov .ic-pause { display: inline-block; }
.ep.loading .ep-ov .ic-play,
.ep.loading .ep-ov .ic-pause { display: none; }
.ep.loading .ep-ov .player-spinner { display: inline-block; }

/* Favorites page empty state. */
.fav-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 56px 20px;
  color: var(--text-secondary);
}
.fav-empty svg { color: var(--text-tertiary); }
.fav-empty-t { font-size: var(--text-lg); font-weight: 600; color: var(--text-heading); margin: 0; }
.fav-empty .btn { text-decoration: none; }
/* display:flex above beats the UA [hidden] rule — re-assert it. */
.fav-empty[hidden] { display: none; }

/* ===== Text / form pages (privacy, terms, add-radio, feedback) ===== */
/* Tight gap (the base <main> uses a big 48px flex gap) + full-width content. */
main.doc-page { gap: var(--space-3); }
main.doc-page .page-head { margin-bottom: 0; }
main.doc-page .prose { max-width: none; }
/* The shared ad negative-margin (-28px) is tuned for the big 48px main gap; on
   doc-page the gap is only 12px, so it would yank the content 16px up OVER the
   banner — and a collapsed/residual ad iframe then eats the clicks. Neutralise
   it here and keep the content above the ad in the stacking order. */
main.doc-page > .ad-slot:first-child,
main.doc-page > .ad:first-child { margin-top: 0; margin-bottom: 0; }
/* Stack the add-radio 2-column layout on small screens. */
@media (max-width: 860px) { .fb-cols { grid-template-columns: 1fr; } }
.prose {
  max-width: 760px;
  color: var(--text-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed, 1.7);
}
.prose p { margin: 0 0 1em; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display);
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.25;
  margin: 1.6em 0 .5em;
}
.prose h2 { font-size: var(--text-h3, 1.4rem); }
.prose h3 { font-size: var(--text-lg, 1.2rem); }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.35em; }
.prose li { margin: .35em 0; }
.prose a { color: var(--text-accent); text-decoration: underline; }
.prose a.btn { text-decoration: none; }
.prose strong { color: var(--text-heading); }

.form-card {
  max-width: 640px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 14px);
  padding: 24px;
}
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-weight: 600;
  color: var(--text-heading);
  font-size: var(--text-sm);
  margin-bottom: 6px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 10px);
  background: var(--surface-page, var(--surface-card));
  color: var(--text-body);
  font: inherit;
  transition: border-color var(--dur-fast);
}
.form-field input:focus,
.form-field textarea:focus { outline: none; border-color: var(--accent-500); }
.form-field textarea { resize: vertical; min-height: 140px; }
.form-err { color: #e5342b; font-size: 13px; margin-top: 4px; }
.form-fine { margin: 12px 0 0; font-size: 12px; color: var(--text-tertiary); }
.flash {
  max-width: 640px;
  padding: 14px 16px;
  border-radius: var(--radius-md, 10px);
  margin-bottom: 20px;
  font-size: var(--text-sm);
}
.flash.ok { background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .4); color: #0f766e; }
.flash.err { background: rgba(229, 52, 43, .1); border: 1px solid rgba(229, 52, 43, .4); color: #b42318; }

/* Pagination (the Wave mockup ships no pager markup). */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: 22px 0 4px;
}
.pager-link {
  display: inline-flex;
  align-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(0,0,0,.12));
  background: var(--card, #fff);
  color: var(--ink, #1a1a1a);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.pager-link:hover { border-color: var(--accent, #2b4df2); }
.pager-link.is-active {
  background: var(--accent, #2b4df2);
  border-color: var(--accent, #2b4df2);
  color: #fff;
}
.pager-gap { padding: 0 4px; opacity: .6; }

/* Site logo from settings, used in place of the mockup's animated mark. */
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}

/* "All stations" link in the stations section head. */
.sect-head a.more { text-decoration: none; cursor: pointer; }

/* H1 in a section head should match the section heading (.sect-head h2) look. */
.sect-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h2);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}

/* Real ad container — a plain block with a real width. Must NOT be flex:
   responsive AdSense reads the parent's width, and a flex item collapses to
   content width (0) → "adsbygoogle.push() error: No slot size for availableWidth=0". */
.ad-slot {
  display: block;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}
.ad-slot ins.adsbygoogle { display: block; width: 100%; }
.ad-slot :is(ins, iframe, img) { max-width: 100%; }

/* <main> puts a 48px flex gap between children; pull ad blocks in so the
   banners don't have huge empty space above/below them (~20px effective). */
main > .ad-slot,
main > .ad {
  margin-top: -28px;
  margin-bottom: -28px;
}
/* The top ad is the first child: above it there is only main's 24px padding
   (no 48px gap), so a negative top margin would glue it to the header. */
main > .ad-slot:first-child,
main > .ad:first-child {
  margin-top: 0;
}

/* FAQ accordion — native <details>/<summary> (semantic, works without JS). */
.faq-q { list-style: none; cursor: pointer; }
.faq-q::-webkit-details-marker { display: none; }
.faq-item[open] .faq-a { display: block; }

/* Plus icon that turns into a minus when the item is open. */
.faqic {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--text-tertiary, #888);
}
.faqic::before,
.faqic::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
  transition: opacity .2s ease, transform .2s ease;
}
.faqic::before { left: 2px; right: 2px; top: 50%; height: 2px; transform: translateY(-50%); }
.faqic::after  { top: 2px; bottom: 2px; left: 50%; width: 2px; transform: translateX(-50%); }
.faq-item[open] .faqic::after { opacity: 0; transform: translateX(-50%) rotate(90deg); }

/* ===== v2 player: card click target, buffering spinner, equalizer ===== */

/* Card art triggers playback; the name is the link to the station page. */
.scard-art { cursor: pointer; }
.scard-name { text-decoration: none; color: var(--text-heading); }
.scard-name:hover { text-decoration: underline; }

/* Buffering spinner, shared by the card overlay button and the docked player. */
.player-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: v2spin .7s linear infinite;
}
@keyframes v2spin { to { transform: rotate(360deg); } }

/* Card play / pause / spinner icon states. */
.scard .ic-pause { display: none; }
.scard.playing .ic-play { display: none; }
.scard.playing .ic-pause { display: inline-block; }
.scard.loading .player-spinner { display: inline-block; }
.scard.loading .ic-play,
.scard.loading .ic-pause { display: none; }
/* Keep the overlay button visible while buffering (app.css shows it on hover / .playing). */
.scard.loading .scard-ov .playbtn { opacity: 1; transform: scale(1); }
.scard.loading .scard-art { box-shadow: 0 0 0 1.5px var(--accent-500); }

/* Docked player buffering spinner. */
#player .player-spinner {
  width: 18px;
  height: 18px;
  border-color: rgba(0, 0, 0, .25);
  border-top-color: currentColor;
}
#player.loading [data-act="toggle"] svg { display: none; }
#player.loading [data-act="toggle"] .player-spinner { display: inline-block; }

/* Clickable volume + favorite active state in the docked/full players. */
.dp-mute, #v2-vol { cursor: pointer; }
#player.muted #v2-vol-icon { opacity: .45; }
[data-act="fav"] { transition: color .15s ease; }
[data-act="fav"]:hover { color: var(--accent-500, #2b4df2); }
[data-act="fav"].on { color: var(--accent-500, #2b4df2); }
[data-act="fav"].on svg,
[data-act="fav"]:hover svg { fill: currentColor; }

/* Equalizer next to the playing station's name (red bars). */
.eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  margin-left: 6px;
  flex: 0 0 auto;
}
.scard.playing .eq { display: inline-flex; }
/* Always-on equalizer (station hero "now playing") stays visible. */
.eq.on { display: inline-flex; }
.eq i {
  width: 3px;
  height: 100%;
  background: #ff3b30;
  border-radius: 1px;
  transform-origin: bottom;
  animation: v2eq .9s ease-in-out infinite;
}
.eq i:nth-child(1) { animation-delay: -.2s; }
.eq i:nth-child(2) { animation-delay: -.5s; }
.eq i:nth-child(3) { animation-delay: -.1s; }
.eq i:nth-child(4) { animation-delay: -.7s; }
@keyframes v2eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* List cards (.lcard on location/genre pages): same play/loading/equalizer states. */
.lcard .ic-pause { display: none; }
.lcard.playing .ic-play { display: none; }
.lcard.playing .ic-pause { display: inline-block; }
.lcard.loading .player-spinner { display: inline-block; }
.lcard.loading .ic-play,
.lcard.loading .ic-pause { display: none; }
.lcard.playing .eq { display: inline-flex; }
.lcard .player-spinner {
  width: 18px;
  height: 18px;
  border-color: rgba(0, 0, 0, .2);
  border-top-color: currentColor;
}

/* Catalog filter dropdown: hidden by default, shown when toggled open
   (app.css styles the panel/items but has no open/close visibility rule). */
/* Full-width page subtitle (drop the 70ch cap). */
.page-head .page-sub { max-width: none; }

/* Pager has no range text now — center the nav. */
.pager { justify-content: center; }

/* Station page: "Top songs" rows beyond 10 are hidden until "Show more". */
#topTracks .track.top-row.is-hidden { display: none; }
#topTracks.show-all .track.top-row.is-hidden { display: grid; }

/* Station page top ad: st-page uses a tighter gap/padding than the other
   pages, which threw off the shared ad negative-margin. Re-align it so the top
   banner sits exactly like on the home page. */
main.st-page { padding-top: var(--space-6); }
main.st-page > .ad-slot:first-child,
main.st-page > .ad:first-child { margin-bottom: -4px; }

/* Keep the hero/content above the banner ad and the sticky sidebar so a
   positioned element can never sit over the buttons/links and swallow clicks. */
main.st-page > .crumbs,
main.st-page > .st-hero { position: relative; z-index: 2; }
.st-main { position: relative; z-index: 1; }
.st-side { z-index: 0; }
/* Decorative live-dot ripple must not capture pointer events. */
.st-livedot .dot::before,
.st-livedot .dot::after { pointer-events: none; }

/* Hero line 2 (#stNow): city/frequency by default, swaps to the on-air song. */
.st-loc {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--text-secondary);
  font-size: var(--text-base);
}
.st-loc a,
.st-loc .freq { display: inline-flex; align-items: center; gap: 6px; }
.st-loc svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.st-loc a { color: var(--text-secondary); text-decoration: none; }
.st-loc a:hover { color: var(--text-accent); }
.st-loc .freq { font-family: var(--font-mono); }
.st-song { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
/* The display rules above beat the UA [hidden] rule, so re-assert it: only one
   of location / song is ever shown. */
.st-loc[hidden],
.st-song[hidden] { display: none; }
.st-song .nowt {
  color: var(--text-heading);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Station playlist / top-songs rows aren't links — no hover bg, no pointer. */
.st-main .track { cursor: default; }
.st-main .track:hover { background: transparent; }
/* YouTube brand icon in track rows — like the old top-songs icon: bare logo,
   muted by default, turns red and scales up on hover (no circular button). */
.st-main .yt-btn {
  color: var(--text-tertiary);
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
  transition: color var(--dur-fast), transform var(--dur-fast);
}
.st-main .yt-btn:hover { color: #ff0000; transform: scale(1.1); border: none; background: transparent; }
.st-main .yt-btn svg { width: 24px; height: 24px; }

/* Shazam button (old icon) + recognition result box. */
.btn.shazam img { width: 18px; height: 18px; display: block; }
.btn.shazam .player-spinner { display: none; border-color: rgba(0, 0, 0, .25); border-top-color: currentColor; }
.btn.shazam.loading .player-spinner { display: inline-block; }
.btn.shazam.loading img { display: none; }
/* Cooldown: button locked, label shows the live countdown. */
.btn.shazam:disabled,
.btn.shazam.is-cooldown { opacity: .55; cursor: default; pointer-events: none; }
.btn.shazam .shz-label { font-variant-numeric: tabular-nums; }
/* The .shz result card (scanning -> found) is styled by app.css; only add the
   bits the design CSS doesn't size (the icon images inside the pulse/links). */
.shz-pulse img { width: 22px; height: 22px; display: block; }
.shz-links img { width: 24px; height: 24px; display: block; }
.shz.adblock .shz-pulse { background: var(--fill-accent-soft); color: var(--accent-600); }

/* Full player: station logo as a small thumbnail over the song artwork. */
.full-art { position: relative; }
.full-stationart {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--surface-card, #fff);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}

/* Station hero "Listen live" button: play / loading / playing states. */
.st-playbtn .ic-pause,
.st-playbtn .player-spinner { display: none; }
.st-playbtn.playing .ic-play { display: none; }
.st-playbtn.playing .ic-pause { display: inline-block; }
.st-playbtn.loading .ic-play,
.st-playbtn.loading .ic-pause { display: none; }
.st-playbtn.loading .player-spinner { display: inline-block; }

/* Station description: drop the 62ch cap (full width). */
.st-desc { max-width: none; }

/* Social/app icons in the sidebar use brand <img> icons (from the old theme). */
.st-soc .soc img { width: 18px; height: 18px; flex: 0 0 auto; display: block; object-fit: contain; }

/* Song-art placeholder (no cover): keep the box, show a small centred note. */
.track .tart.ph { display: grid; place-items: center; }
.track .tart.ph svg { width: 20px; height: 20px; color: var(--text-tertiary); }

/* Favorites count badge in the header (shown only when > 0). */
.hd-actions .iconbtn { position: relative; }
.badge-count[hidden] { display: none; }

/* Station page: stack the sidebar UNDER the main content earlier so it never
   crowds the content on tablets / large phones; stack the hero on small phones. */
@media (max-width: 900px) {
  .st-layout { grid-template-columns: 1fr; }
  .st-side { position: static; }
}
@media (max-width: 560px) {
  .st-hero { flex-direction: column; align-items: flex-start; }
  .st-cover { width: 148px; height: 148px; }
}

/* Sort segment (server-side links styled like the design's .seg buttons). */
.catalog-sort { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.seg a {
  padding: 6px 14px;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--text-sm, 14px);
  font-weight: 600;
  color: var(--text-secondary, #666);
  text-decoration: none;
}
.seg a.sel {
  background: var(--surface-card, #fff);
  color: var(--text-heading, #161616);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0, 0, 0, .06));
}

/* City chips: show the first 8, the rest expand via the toggle button. */
.citychips { margin-bottom: var(--space-6, 24px); }
.citychips:not(.expanded) .cloud .pill:nth-child(n+9) { display: none; }
/* Restore the pill name layout (was tied to .relrow) and stop pills shrinking. */
.citychips .cloud .pill { flex: 0 0 auto; }
.citychips .pill .nm { display: inline-flex; align-items: center; gap: 6px; }
.citychips .pill .nm svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--text-tertiary); }
.citychips-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 2px 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-accent, #2b4df2);
  font-size: 14px;
  font-weight: 600;
}
.citychips-toggle svg { transition: transform .2s ease; }
.citychips.expanded .citychips-toggle svg { transform: rotate(180deg); }
.citychips-toggle .t-less { display: none; }
.citychips.expanded .citychips-toggle .t-more { display: none; }
.citychips.expanded .citychips-toggle .t-less { display: inline; }

.dd-opt { text-decoration: none; }

/* Inline full-width filter panels (region/city) that push the content down. */
.filter-panel {
  margin: 0 0 var(--space-5, 20px);
  padding: 14px;
  background: var(--bg-sunken, #f4f4f5);
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, .08));
  border-radius: var(--radius-lg, 14px);
}
.filter-panel .cloud .pill { flex: 0 0 auto; }
.filter-panel .pill .nm { display: inline-flex; align-items: center; gap: 6px; }
.filter-panel .pill .nm svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--text-tertiary); }
.filter-btn svg:last-child { transition: transform .2s ease; }
.filter-btn.open svg:last-child { transform: rotate(180deg); }
/* Open filter button highlighted so the panel reads as belonging to it. */
.filter-btn.open {
  background: var(--fill-accent-soft, rgba(43, 77, 242, .1));
  color: var(--text-accent, #2b4df2);
  border-color: var(--accent-300, #9db0fb);
}
/* Currently-selected option highlighted with the accent color. */
.filter-panel .pill.sel {
  background: var(--fill-accent-soft, rgba(43, 77, 242, .12));
  border-color: var(--accent-500, #2b4df2);
  color: var(--text-accent, #2b4df2);
  font-weight: 600;
}
.filter-panel .pill.sel .nm svg { color: var(--accent-500, #2b4df2); }
