/* Urban Jamz Radio — player.css (clean + Last5 modal, compact + read more)
   Version: 2025-10-16 modal6
*/

:root{
  --bg:#0b0b0b; --fg:#e9eef3; --muted:#b8c2cc;
  --brand:#8fd3ff; --brand-2:#a6f0ff;
  --card:#141414; --soft:#1a1a1a; --ring:#2a3f55;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px; --radius-sm: 12px; --radius-lg: 12px;
  --slider-track:#213142; --slider-track-hi:#1a2633;
  --slider-thumb:#aee6ff; --slider-thumb-bd:#5aaad0;
  --panel-minh-desktop: 520px;

  /* Modal settings */
  --modal-maxvh: 60vh;                 /* <— pas aan: b.v. 56vh of 64vh */
  --thumb-modal-size-desktop: 56px;
  --thumb-modal-size-mobile: 48px;
  --thumb-radius-modal: 10px;
}

*{ box-sizing:border-box }
html,body{ height:100%; overflow-x:hidden }
body{
  margin:0; padding:24px;
  background:var(--bg); color:var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Helvetica, Arial, sans-serif;
  line-height:1.5; text-rendering: optimizeLegibility;
}

/* Background */
#pageBg{ position:fixed; inset:0; z-index:-2; background-size:cover; background-position:center; filter:blur(14px) saturate(1.15) brightness(1.08); transform:scale(1.04); }
#pageShade{ position:fixed; inset:0; z-index:-1; background: radial-gradient(1100px 700px at 20% 10%, rgba(0,0,0,.28), rgba(0,0,0,.62) 60%, rgba(0,0,0,.85)); pointer-events:none; }

/* Layout */
.wrap{ max-width:1100px; margin:0 auto }
.site-header h1{
  margin:0 0 22px; font-size:32px; letter-spacing:.2px; text-align:center;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.35));
}

/* Grid */
.grid{ display:grid; grid-template-columns: 1fr 1fr; gap:24px; align-items: stretch; }

/* Cards */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)), var(--card);
  border:1px solid var(--soft); border-radius:var(--radius); padding:16px 16px 18px;
  box-shadow: var(--shadow); backdrop-filter: saturate(1.05);
}

/* Player-card */
.player-card{ text-align:center; padding:22px; min-height: var(--panel-minh-desktop); display:flex; flex-direction:column; }

/* Now Playing */
.player-card #np-title{ margin-bottom:16px; min-height:2.8em; }
.player-card .np-artist{ display:block; font-size:1.35em; font-weight:800; color:#ffd8a6; text-shadow:0 0 10px rgba(255,180,120,.25),0 2px 14px rgba(0,0,0,.35); margin-bottom:4px; }
.player-card .np-track{ display:block; font-size:1.05em; font-weight:500; color:#e9e2d8; opacity:.95; }

/* Cover */
.player-card .cover-card{ position:relative; overflow:hidden; border-radius:var(--radius-lg); max-width: clamp(240px, 62%, 320px); margin:28px auto; }
#coverBg{ position:absolute; inset:0; pointer-events:none; background-size:cover; background-position:center; filter:blur(24px) saturate(1.1); opacity:.2; border-radius:var(--radius-lg); }
#coverImg{ display:block; width:100%; aspect-ratio:1/1; object-fit:cover; border-radius:var(--radius-lg); margin:0 auto; border:1px solid rgba(255,255,255,.08); box-shadow:0 14px 34px rgba(0,0,0,.55); transition:opacity 180ms ease; }
/* Stabilize cover slot and prevent subpixel jiggle */

.player-card .cover-card{
  aspect-ratio: 1 / 1;          /* reserve height even while image swaps */
}
#coverImg{
  height: 100%;                  /* fill reserved slot */
  will-change: opacity;          /* smoother fade */
  transform: translateZ(0);      /* avoid subpixel jump on swap */
}

/* Controls */
.controls{ display:flex; align-items:center; justify-content:center; gap:14px; margin-top:16px; flex-wrap:wrap }
.btn{ appearance:none; border:0; cursor:pointer; padding:12px 18px; border-radius:999px; font-weight:700; letter-spacing:.2px; transition: transform .06s ease, box-shadow .2s ease, background .2s ease; box-shadow:0 6px 16px rgba(0,0,0,.35); }
.btn:active{ transform: translateY(1px) }
.btn-primary{ color:#0b1824; background: linear-gradient(180deg,#bfe9ff,#93d3ff); border:1px solid rgba(255,255,255,.35); }
.btn-primary:hover{ background: linear-gradient(180deg,#c9efff,#a2dfff); box-shadow:0 10px 24px rgba(0,0,0,.45); }

/* Volume slider */
.vol-wrap{ display:flex; align-items:center; gap:10px }
.vol-label{ color:var(--muted); font-size:14px }
.vol{ width:220px; height:34px; background:transparent; outline:0; }
.vol::-webkit-slider-runnable-track{ height:6px; border-radius:999px; background:linear-gradient(90deg,var(--slider-track),var(--slider-track-hi)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.vol::-webkit-slider-thumb{ -webkit-appearance:none; appearance:none; width:18px; height:18px; margin-top:-6px; border-radius:50%; background: radial-gradient(circle at 30% 30%, #fff, var(--slider-thumb)); border:1px solid var(--slider-thumb-bd); box-shadow:0 4px 10px rgba(0,0,0,.45); }
.vol::-moz-range-track{ height:6px; border-radius:999px; background:linear-gradient(90deg,var(--slider-track),var(--slider-track-hi)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.vol::-moz-range-thumb{ width:18px; height:18px; border-radius:50%; background: radial-gradient(circle at 30% 30%, #fff, var(--slider-thumb)); border:1px solid var(--slider-thumb-bd); box-shadow:0 4px 10px rgba(0,0,0,.45); }

/* Last 5 */
.last5-card{ min-height: var(--panel-minh-desktop); display:flex; flex-direction:column; }
.card-title{ margin:6px 0 14px 2px; font-size:18px; color:#dfe6ee; letter-spacing:.2px }
#last5{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; overflow:auto; }
#last5 li.last5-item{ display:grid; grid-template-columns: 40px 1fr auto; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--radius-sm); background:#1a1a1a; border:1px solid #1f1f1f; transition: background .2s ease, border-color .2s ease, transform .06s ease, box-shadow .18s ease; cursor:pointer; position:relative; }
#last5 li.last5-item:nth-child(even){ background:#202020 }
#last5 li.last5-item:hover{ background:#2a2a2a; border-color:#2a2a2a; transform: translateY(-1px); box-shadow:0 4px 12px -4px rgba(0,0,0,.55); }
#last5 li.last5-item:active{ transform: translateY(0); }
#last5 li.last5-item:focus-visible{ outline:3px solid #7AA7FF; outline-offset:2px; box-shadow:0 0 0 2px #141414, 0 0 0 4px rgba(122,167,255,.55); transform:translateY(-1px); }

#last5 img.last5-cover{ width:40px; height:40px; border-radius:8px; object-fit:cover; flex-shrink:0; box-shadow:0 4px 10px rgba(0,0,0,.35); border:1px solid rgba(255,255,255,.06); }
#last5 .last5-text{ display:flex; flex-direction:column; gap:2px; flex:1; min-width:0; }
#last5 .last5-text .artist{ font-size:15px; font-weight:600; color:#f1dfc9; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#last5 .last5-text .track{ font-size:13px; font-weight:500; color:#b9c3cf; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#last5 .time{ margin-left:auto; flex-shrink:0; font-size:12px; color:#98a5b4; opacity:.85; white-space:nowrap; }

/* Bio */
.bio-card{ overflow:hidden }
.bio-head{ display:flex; align-items:center; gap:12px; margin-bottom:10px }
.artist-img{ width:68px; height:68px; flex:0 0 68px; border-radius:50%; object-fit:cover; background:#111; border:1px solid rgba(255,255,255,.06); box-shadow:0 6px 16px rgba(0,0,0,.45); }
.bio-headings{ display:flex; flex-direction:column; align-items:flex-start; gap:6px }
.bio-title{ margin:0; font-size:20px; letter-spacing:.2px }
.bio-source{ display:inline-flex; align-items:center; white-space:nowrap; padding:.25em .6em; font-size:.75em; border-radius:999em; background:#203246; color:#cfe8ff; border:.08em solid var(--ring); box-shadow: inset 0 0 0 .05em rgba(255,255,255,.04); line-height:1.2; }

.bio-text{ color:#dfe6ee; font-size:15px; line-height:1.7; padding:8px 2px; max-height:26rem; overflow:auto; scrollbar-width:thin; scrollbar-color:#334452 transparent; }
.bio-text a{ color:#8fd3ff; text-decoration:none }
.bio-text a:hover{ text-decoration:underline }
.bio-footer{ margin-top:12px; display:flex; gap:10px; align-items:center; flex-wrap:wrap }
.bio-footer a{ color:#8fd3ff; text-decoration:none; font-weight:600; border-bottom:1px dashed rgba(143,211,255,.5); }
.bio-footer a:hover{ border-bottom-color:transparent; text-decoration:underline }

/* Scrollbars */
.bio-text::-webkit-scrollbar,
.track-modal__body::-webkit-scrollbar{ width:10px; }
.bio-text::-webkit-scrollbar-track,
.track-modal__body::-webkit-scrollbar-track{ background:transparent; }
.bio-text::-webkit-scrollbar-thumb,
.track-modal__body::-webkit-scrollbar-thumb{ background:linear-gradient(180deg, #3a4d5f, #253543); border-radius:8px; border:2px solid transparent; background-clip:padding-box; }
.bio-text::-webkit-scrollbar-thumb:hover,
.track-modal__body::-webkit-scrollbar-thumb:hover{ background:linear-gradient(180deg, #4d6a82, #2f4558); }

/* =========================
   Modal (Last5) — compact + read more
   ========================= */
.track-modal.hidden { display:none; }
.track-modal {
  position:fixed; inset:0; z-index:4000;
  font: 14px/1.4 system-ui, Arial, sans-serif;
}
.track-modal__backdrop {
  position:absolute; inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(4px);
}

.track-modal__dialog {
  position:absolute; top:50%; left:50%;
  transform:translate(-50%,-50%);
  background:#141414; color:#eee;
  width:min(560px,92vw);
  max-height:var(--modal-maxvh);
  display:flex; flex-direction:column;
  overflow:hidden; /* alleen body scrolt */
  -webkit-overflow-scrolling:touch;
  border:1px solid #2a2a2a; border-radius:12px;
  box-shadow:0 8px 28px -4px rgba(0,0,0,.7);
  padding:18px 20px 22px;
}
.track-modal__close {
  position:absolute; top:6px; right:10px;
  background:none; border:0; color:#bbb;
  font-size:22px; line-height:1; cursor:pointer;
}
.track-modal__close:hover { color:#fff; }

.track-modal__header {
  display:flex; align-items:flex-start; gap:16px; margin-bottom:10px;
  flex: 0 0 auto; /* header blijft staan */
}
.track-modal__thumb {
  width:var(--thumb-modal-size-desktop) !important;
  height:var(--thumb-modal-size-desktop) !important;
  max-width:none !important;
  max-height:none !important;
  flex:0 0 var(--thumb-modal-size-desktop);
  border-radius:var(--thumb-radius-modal);
  object-fit:cover; background:#222; border:1px solid #222;
  box-shadow:0 2px 10px -2px rgba(0,0,0,.5);
  aspect-ratio:1/1; display:block;
}
.track-modal__meta { display:flex; flex-direction:column; gap:4px; min-width:0; flex:1; }
.track-modal__title { margin:0; display:block; text-align:left; line-height:1.25; }
.track-modal__title .tm-artist,
.track-modal__title .np-artist { display:block; font-size:1.12em; font-weight:800; color:#ffd8a6; margin-bottom:2px; text-shadow:0 0 8px rgba(255,180,120,.22),0 2px 7px rgba(0,0,0,.24); }
.track-modal__title .tm-title,
.track-modal__title .np-track { display:block; font-size:.98em; font-weight:700; color:#e9e2d8; opacity:.98; }
.track-modal__played-time { font-size:12px; font-weight:700; color:#7AA7FF; letter-spacing:.2px; }

.track-modal__body {
  margin-top:8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow:auto;                 /* scrollen binnen modal */
  -webkit-overflow-scrolling:touch;
  position: relative;
}
.track-modal__bio { font-size:14px; line-height:1.6; }
.track-modal__bio a { color:#8bc8ff; text-decoration:none; }
.track-modal__bio a:hover { text-decoration:underline; }
.track-modal__bio-loading,
.track-modal__bio-error { font-size:13px; color:#bbb; margin-bottom:6px; }

/* Subtiele 'read more' */
.track-modal__readmore{
  position: sticky;
  bottom: 0;
  display: none;                 /* JS toont/verbergt */
  width: 100%;
  text-align: right;
  padding: 10px 0 0;
  margin-top: -8px;
  background: linear-gradient(180deg, rgba(20,20,20,0), #141414 70%);
  border: 0;
  color: #8bc8ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  opacity: .9;
}
.track-modal__readmore:hover{ text-decoration:underline; }
.track-modal__readmore:focus-visible{ outline:2px solid #7AA7FF; border-radius:6px; }

/* Mobile tweaks */
@media (max-width: 520px){
  .track-modal__dialog{ padding:16px 16px 18px; width:min(94vw,560px); }
  .track-modal__thumb{
    width:var(--thumb-modal-size-mobile) !important;
    height:var(--thumb-modal-size-mobile) !important;
    flex:0 0 var(--thumb-modal-size-mobile);
  }
  .track-modal__title .tm-artist{ font-size:1.05em; }
}

/* Responsive utility */
@media (max-width: 1024px){
  :root{ --panel-minh-desktop: 480px; }
  .player-card .cover-card{ max-width: clamp(230px, 64%, 310px); }
}
@media (max-width: 900px){
  .grid { grid-template-columns: 1fr; }
  .grid > section.card.player-card { order:1; }
  .grid > section.card.bio-card    { order:2; }
  .grid > aside.card.last5-card    { order:3; }

  :root { --panel-minh-desktop: 420px; }

  .player-card, .bio-card, .last5-card {
    min-height: auto;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .player-card .cover-card{
    max-width: min(78vw, 360px); margin:24px auto;
  }

  .last5-card {
    grid-column: 1 / -1;
    /* width/max-width/margins hierboven voldoende */
  }
  #last5 {
    width: 100%;
    max-width: none;
  }

  body { padding:16px }
  .vol { width:100% }
  .wrap, .grid, .player-card, .last5-card, .bio-card {
    margin-left:auto; margin-right:auto;
  }
}

/* Bio card under the player: compact with internal scroll */
.bio-card {
  /* adjust this to your preference */
  --bio-text-max-h: 180px;
}

.bio-card .bio-head {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

/* TEST — Stijl 3: ronde avatar met subtiele ring (onder de player) */
.bio-card .artist-img {
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  /* neutrale ring als basis; wordt hieronder per viewport aangepast */
  outline: 2px solid rgba(255,255,255,.10);
  outline-offset: 0;
  box-shadow:
    0 6px 14px rgba(0,0,0,.35),
    0 0 0 2px rgba(255,255,255,.10),
    0 0 0 1px rgba(255,255,255,.06) inset;
  border: 0; /* overschrijft eerdere border */
}

.bio-card .bio-title {
  margin: 0;
  line-height: 1.2;
}

.bio-card .bio-text {
  /* cap the text height and scroll if needed */
  max-height: var(--bio-text-max-h);
  overflow: auto;
}

.bio-card .bio-footer {
  margin-top: 8px;
}

/* Optional: slightly smaller on mobile — hier gelijk aan desktop gehouden */
@media (max-width: 480px) {
  .bio-card { --bio-text-max-h: 140px; }
  .bio-card .artist-img { width: 64px; height: 64px; }
}

/* =========================
   Bio cover — unified fix (desktop ring vs. mobiel ring)
   ========================= */

/* Mobiel (Safari-veilig): geen outline (anders rechthoek), ronde ring via box-shadow */
@media (max-width: 480px){
  .bio-card .artist-img{
    outline: none !important;
    border-radius: 50%;
    clip-path: circle(50% at 50% 50%);
    box-shadow:
      0 6px 14px rgba(0,0,0,.35),
      0 0 0 2px rgba(143,211,255,.18),
      0 0 0 1px rgba(255,255,255,.06) inset !important;
  }
}

/* Desktop: jouw “lichtere ring” met merk-kleur outline */
@media (min-width: 481px){
  .bio-card .artist-img{
    outline: 2px solid rgba(143, 211, 255, .18) !important;
    outline-offset: 0;
    border-radius: 50%;
    box-shadow:
      0 6px 14px rgba(0,0,0,.35),
      0 0 0 2px rgba(143,211,255,.14),
      0 0 0 1px rgba(255,255,255,.06) inset !important;
    transition: box-shadow .18s ease, transform .06s ease;
  }
}

/* Bio — Step 1: baseline typography */
.bio-card{
  --bio-title-size: clamp(18px, 2.2vw, 22px);
  --bio-text-size: 13.5px;
  --bio-text-lh: 1.62;
}

/* Title: a bit more presence and nicer line breaks */
.bio-card .bio-title{
  font-size: var(--bio-title-size);
  font-weight: 800;
  letter-spacing: .2px;
  text-wrap: balance; /* nicer multi-line titles */
  color: #f3e6d8;
  text-shadow: 0 1px 0 rgba(0,0,0,.35), 0 0 18px rgba(255,200,140,.08);
}

/* Body: comfortable rhythm + resilient wrapping */
.bio-card .bio-text{
  font-size: var(--bio-text-size);
  line-height: var(--bio-text-lh);
  color: #dfe6ee;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: anywhere;
  text-rendering: optimizeLegibility;
}

/* Paragraph rhythm and a subtle lead for the first paragraph */
.bio-card .bio-text p{ margin: 0 0 .7em; }
.bio-card .bio-text p:first-child{
  color:#e9eff6;
  font-weight:600;
}

/* Links: tidy underline with better offset */
.bio-card .bio-text a{
  color:#8fd3ff;
  text-decoration: underline dotted rgba(143,211,255,.55);
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}
.bio-card .bio-text a:hover{
  text-decoration-style: solid;
  text-decoration-thickness: 2px;
}


/* Fallback overlay (also fine to keep alongside the mask) */
.bio-card .bio-text::after{
  content:'';
  position:absolute;
  left:0; right:0; bottom:0;
  height:var(--bio-fade-size);
  /* match your card bg (#141414) with a gentle fade */
  background: linear-gradient(180deg, rgba(20,20,20,0), #141414 90%);
  pointer-events:none; /* don’t block links/text */
}