/* home.css (U-HOME): Home layout (band on top, hero, flush rail, cards), tiles, rails, ad slots. View styles: app/components/pages.css (lazy). */

:root {
  --home-drop: 33px;
  --home-rail-top: max(var(--s-4), calc(var(--band-h) - var(--topbar-h, 72px) - var(--tile) * .87));
  --hero-title-size: var(--fs-display);
  --tile-text-gap: var(--s-2);
}

/*  */
.chip--new { position: absolute; top: -6px; right: -10px; background: var(--accent); color: #FFFFFF; }

/* the big action pill (hero Resume / Play, artist and release Play): 5.3 */
.pill-btn {
  display: inline-flex; align-items: center; gap: var(--s-3);
  min-height: 48px; padding: 0 var(--s-5) 0 var(--s-2);
  border: 0; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 600; font-size: var(--fs-label);
  text-decoration: none;
  transition: transform var(--dur-press) var(--ease-out), filter var(--dur-ui) var(--ease-out);
}
.pill-btn:hover { color: var(--accent-ink); filter: brightness(.97); }
.pill-btn:active { transform: scale(.97); }
.pill-btn:not(:has(.pill-dot)) { padding-left: var(--s-5); }
.pill-dot { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #FFFFFF; }

/* equalizer (hero label, playing track row): static under reduced motion */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 14px; height: 12px; color: var(--accent); }
.eq i { display: block; width: 2px; height: 40%; background: currentColor; border-radius: 1px; }
.eq i:nth-child(2) { height: 100%; }
.eq i:nth-child(3) { height: 65%; }
.eq i:nth-child(4) { height: 85%; }
.eq--on i { animation: eq-bounce 900ms ease-in-out infinite alternate; }
.eq--on i:nth-child(2) { animation-delay: -300ms; }
.eq--on i:nth-child(3) { animation-delay: -600ms; }
.eq--on i:nth-child(4) { animation-delay: -150ms; }
@keyframes eq-bounce { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.eq i { transform-origin: bottom; }

/* images */
.img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.img--empty { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--surface-2), var(--line)); }

/*  */
.tile-wrap { position: relative; }
.tile {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-tile);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}
.tile--round, .tile-wrap--round .tile { border-radius: 50%; }
.tile-img { width: 100%; height: 100%; object-fit: cover; }
.tile-img--empty { display: grid; place-items: center; font-size: 2.5rem; font-weight: 800; color: var(--ink-3); background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.tile-play {
  position: absolute; left: 50%; top: 50%;
  width: 56px; height: 56px; margin: -28px 0 0 -28px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: #111114;
  box-shadow: var(--sh-2);
  opacity: 0; transform: scale(.9);
  transition: opacity var(--dur-ui) var(--ease-out), transform var(--dur-ui) var(--ease-out);
  z-index: 3;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .tile-wrap:hover .tile-play { opacity: 1; transform: scale(1); pointer-events: auto; }
}
.tile-wrap--grid .tile-play { top: 0; margin-top: calc(50% - 28px); }
.tile--more {
  display: grid; place-content: center; justify-items: center; gap: var(--s-2);
  background: var(--surface); color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--line);
}
.tile--more:hover { color: var(--accent-ink); }
/*  */
.rail { margin-bottom: var(--s-7); }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-3); }
.rail-title { margin: 0; font-size: var(--fs-h2); }
.rail-title--quiet { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rail-seeall { color: var(--ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.rail-seeall:hover { color: var(--accent-ink); }
.rail-body { position: relative; }
.rail-list {
  display: flex;
  gap: var(--tile-gap);
  margin: 0 calc(-1 * var(--gutter)) 0 0;
  padding: var(--s-2) var(--gutter) var(--s-2) 0;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.rail-list::-webkit-scrollbar { display: none; }
.rail-item { flex: 0 0 var(--tile); width: var(--tile); scroll-snap-align: start; }
.tile-wrap--round .tile-img { border-radius: 50%; }
.rail-arrow {
  position: absolute; top: 50%; z-index: 4;
  width: 40px; height: 40px; margin-top: -20px;
  display: none; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-1), 0 4px 14px rgba(0, 0, 0, .18);
  opacity: 0;
  transition: opacity var(--dur-ui) var(--ease-out);
}
.rail-arrow--prev { left: -20px; }
.rail-arrow--next { right: calc(var(--s-4) - var(--gutter)); }
@media (min-width: 1024px) and (hover: hover) {
  .rail-arrow:not([hidden]) { display: grid; }
  .rail-body:hover .rail-arrow, .rail-body:focus-within .rail-arrow, .rail-arrow:focus-visible { opacity: 1; }
}
.rail-item--ad { position: relative; }

/*  */
.home { padding-top: 0; }
.home-top { display: grid; gap: var(--s-5); }
.home-hero-col, .home-main-col { min-width: 0; }
.home-more { margin-top: var(--s-7); }
.home-more .rail-title { font-size: var(--fs-h2); }

/* hero (5.3) */
.hero { display: grid; gap: var(--s-4); }
.hero-cover {
  display: block; width: var(--hero-cover); aspect-ratio: 1;
  border-radius: var(--r-tile);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--sh-3);
  view-transition-name: hero-cover;
}
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-img--empty { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.hero-text { min-width: 0; }
.hero-label { display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2); font-size: var(--fs-label); font-weight: 500; color: var(--ink); }
.hero-title {
  margin: 0 0 var(--s-2);
  font-size: var(--hero-title-size); font-weight: 800; line-height: 1.04; letter-spacing: -0.025em;
  color: var(--ink);
}
.hero-title a { color: inherit; text-decoration: none; }
.hero-title a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.hero-sub { margin: 0 0 var(--s-5); font-size: var(--fs-h3); font-weight: 500; color: var(--ink-2); }
.hero-sub a { color: inherit; text-decoration: none; }
.hero-sub a:hover { text-decoration: underline; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.hero-note { font-size: .875rem; opacity: .8; }
.hero--preview .hero-label { color: var(--accent-ink); }
@media (prefers-reduced-motion: no-preference) {
  .hero-text > * { animation: hero-in var(--dur-hero) var(--ease-out) both; }
}
@keyframes hero-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* lower cards (5.6) */
.home-cards { display: grid; gap: var(--s-4); margin-top: var(--s-5); }
.hc:empty { display: none; }
.hcard {
  position: relative;
  height: 100%;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.hcard-link { display: flex; height: 100%; color: inherit; text-decoration: none; }
.hcard-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.hcard-body { display: grid; align-content: start; gap: 2px; min-width: 0; }
.hcard-label { font-size: var(--fs-label); font-weight: 500; color: var(--ink-2); }
.hcard-title { font-size: var(--fs-h2); font-weight: 700; line-height: 1.15; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hcard-link:hover .hcard-title { color: var(--ink); }
.hcard-meta { font-size: var(--fs-small); color: var(--ink-3); margin-top: var(--s-1); }
.hcard-art { position: relative; display: block; flex: none; background: var(--surface-2); }
.hcard-art .img { width: 100%; height: 100%; object-fit: cover; }
.hcard-art--empty { background: linear-gradient(135deg, var(--surface-2), var(--bg)); }
.hcard-art--small { width: 72px; height: 72px; border-radius: var(--r-card); }
.hcard-art--small .img { border-radius: var(--r-card); }
.hcard-art--wide { width: 72px; height: 72px; border-radius: var(--r-card); overflow: hidden; }
.hcard-play {
  position: absolute; right: var(--s-3); bottom: var(--s-3);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--accent); color: #FFFFFF;
  box-shadow: var(--sh-1);
}
.hcard-play:hover { filter: brightness(1.08); }
.hcard--why .hcard-link { padding: var(--s-5); }
.hcard--why .hcard-title { color: var(--ink); }
.hcard-list { display: grid; gap: var(--s-1); margin: var(--s-3) 0 var(--s-4); color: var(--ink-2); font-size: var(--fs-small); }
.hcard-list span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 var(--s-2) 2px 0; border-radius: 50%; background: var(--accent); }
.hcard-cta { justify-self: start; display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill); background: var(--accent); color: #FFFFFF; font-weight: 600; }

/*  */
.adslot { margin: 0; }
.adslot-label { margin: 0 0 var(--s-2); font-size: var(--fs-micro); font-weight: 600; letter-spacing: var(--ls-micro); text-transform: uppercase; color: var(--ink-3); }
.adslot-frame { display: grid; place-items: center; }
.ad-box, .ad-own--card, .ad-own--row { position: relative; display: block; width: 300px; height: 250px; overflow: hidden; border-radius: var(--r-card); background: var(--surface-2); }
.ad-own { color: #FFFFFF; text-decoration: none; }
.ad-own-img { width: 100%; height: 100%; object-fit: cover; }
.ad-own-text {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; gap: 2px;
  padding: var(--s-6) var(--s-3) var(--s-3);
  background: linear-gradient(to top, rgba(8, 8, 12, .78), rgba(8, 8, 12, 0));
}
.ad-own-head { font-weight: 700; }
.ad-own-body { font-size: var(--fs-small); opacity: .9; }
.ad-own-meta { font-size: var(--fs-micro); opacity: .85; }
.ad-own-cta { text-decoration: underline; }
.ad-own:hover, .ad-own:focus-visible { color: #FFFFFF; }
.ad-placeholder { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, var(--bg) 12px 24px); color: var(--ink-3); font-weight: 600; border: 1px dashed var(--line); }
.ad-box--adsense ins.adsbygoogle { position: relative; z-index: 1; }
.house-promo { display: grid; align-items: end; color: #FFFFFF; text-decoration: none; position: relative; overflow: hidden; border-radius: var(--r-card); background: var(--ink); }
.house-promo--card, .house-promo--row { width: 300px; height: 250px; }
.house-promo--tile { width: 100%; aspect-ratio: 1; border-radius: var(--r-tile); }
.house-promo--behind { position: absolute; inset: 0; z-index: 0; }
.house-promo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.house-promo-text { position: relative; display: grid; gap: 2px; padding: var(--s-4); background: linear-gradient(to top, rgba(8, 8, 12, .8), rgba(8, 8, 12, 0)); }
.house-promo-title { font-weight: 700; }
.house-promo:hover { color: #FFFFFF; }
/* home-rail own ad: the same square tile, SPONSORED chip, thin outline, no play overlay */
.adslot--tile { position: relative; width: 100%; aspect-ratio: 1; }
.adslot--tile .ad-own--tile { display: block; width: 100%; height: 100%; box-shadow: inset 0 0 0 1px var(--line); }
.adslot--tile .ad-own--tile:focus-visible { outline: 3px solid #FFFFFF; outline-offset: -3px; box-shadow: 0 0 0 2px var(--ink); }
.ad-chip {
  position: absolute; top: var(--s-2); left: var(--s-2);
  padding: 2px var(--s-2);
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .45); color: #FFFFFF;
  font-size: var(--fs-micro); font-weight: 600; letter-spacing: var(--ls-micro); text-transform: uppercase;
}
.adslot--row { width: 100%; padding: var(--s-4) 0; border-block: 1px solid var(--line); display: grid; justify-items: center; }

/*  */

/* phone < 600 (6.2): horizontal hero inside the band, "Jump back in" rail with gaps, full-width cards,
   the ad card after two content cards */
@media (max-width: 599px) {
  .home-top { gap: var(--s-4); }
  .hero { grid-template-columns: var(--hero-cover) minmax(0, 1fr); column-gap: var(--s-4); row-gap: var(--s-1); align-items: center; padding-top: var(--s-4); }
  .hero-cover { grid-column: 1; grid-row: 1 / span 3; }
  .hero-text { display: contents; }
  .hero-label { grid-column: 2; grid-row: 1; align-self: end; margin: 0; }
  .hero-title { grid-column: 2; grid-row: 2; margin: 0; font-size: var(--fs-h1); }
  .hero-sub { grid-column: 2; grid-row: 3; align-self: start; margin: 0; font-size: var(--fs-body); }
  .hero-actions { grid-column: 1 / -1; grid-row: 4; margin-top: var(--s-3); }
  .hero-label, .hero-title, .hero-sub { color: var(--on-band); text-shadow: 0 1px 10px rgba(0, 0, 0, .3); }
  .hero-label .eq { color: var(--on-band); }
  .rail--primary .rail-title, .rail--primary .rail-seeall { color: var(--on-band); }
  .home-cards { grid-template-columns: 1fr; }
  .hc-1 { order: 1; }
  .hc-2 { order: 2; }
  .hc-ad { order: 3; }
  .hc-3 { order: 4; }
  .hcard-link { gap: var(--s-4); align-items: center; padding: var(--s-3); min-height: 96px; }
  .hcard-title { font-size: var(--fs-h3); -webkit-line-clamp: 1; }
  .hcard-play { top: 50%; bottom: auto; margin-top: -20px; }
  .hcard-body { padding-right: 48px; }
  .hcard--why .hcard-link { padding: var(--s-5); }
  .adslot--card { padding: var(--s-2) 0; }
}

/* tablet 600-1023: hero beside its text on the band, rail full width, two card columns */
@media (min-width: 600px) and (max-width: 1023px) {
  .hero { grid-template-columns: var(--hero-cover) minmax(0, 1fr); align-items: end; gap: var(--s-5); padding-top: var(--s-4); }
  .hero-label, .hero-title, .hero-sub { color: var(--on-band); text-shadow: 0 1px 12px rgba(0, 0, 0, .3); }
  .hero-label .eq { color: var(--on-band); }
  .hero-title { font-size: var(--fs-h1); }
  .home-cards { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
  .hcard-link { flex-direction: column; padding: var(--s-5); gap: var(--s-4); }
  .hcard-art--wide { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--r-card); }
}

/* desktop >= 1024 (6.1): the reference layout */
@media (min-width: 1024px) {
  .home-top {
    grid-template-columns: var(--hero-cover) minmax(0, 1fr);
    column-gap: var(--home-gap, 34px);
    row-gap: 0;
    align-items: start;
  }
  .home-hero-col { padding-top: max(0px, calc(var(--home-rail-top) - var(--home-drop))); position: relative; z-index: 2; }
  .home-main-col { padding-top: var(--home-rail-top); }
  .hero { gap: var(--s-5); }
  .hero-cover { width: var(--hero-cover); }
  .hero-label { margin-top: var(--s-2); }
  .rail--primary { margin-bottom: 0; }
  .rail--primary .rail-head { display: none; }
  .rail--primary .rail-list { overflow: auto hidden; padding-block: 8px; margin-top: -8px; }
  .home-hints { display: flex; align-items: center; margin: var(--s-5) 0 0; }
  .home-cards {
    display: flex;
    gap: var(--s-5);
    align-items: stretch;
    margin: var(--s-5) calc(-1 * var(--gutter)) 0 0;
    padding: var(--s-2) var(--gutter) var(--s-4) 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .home-cards::-webkit-scrollbar { display: none; }
  .hc { flex: 0 0 var(--card-w); width: var(--card-w); min-height: calc(var(--card-w) * .94); }
  .hc--wide { flex-basis: calc(var(--card-w) * 1.6); width: calc(var(--card-w) * 1.6); }
  .hc-ad { flex: 0 0 auto; width: auto; }
  .hcard-link { flex-direction: column; }
  .hcard--media .hcard-art--wide { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 0; }
  .hcard--media .hcard-body { padding: var(--s-4) var(--s-5) var(--s-5); }
  .hcard--badge .hcard-link { align-items: center; text-align: center; padding: var(--s-6) var(--s-5) var(--s-5); gap: var(--s-4); }
  .hcard--badge .hcard-art--small { width: 96px; height: 96px; }
  .hcard--badge .hcard-body { justify-items: center; }
  .hcard--why .hcard-title { font-size: var(--fs-h2); }
  .adslot--card { height: 100%; padding: 0; display: grid; align-content: start; }
  .adslot--card .adslot-frame { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .eq--on i { animation: none; }
}
