/* hub.css — the Klonkt look: warm dark ground, Fraunces for the voice,
 * Plus Jakarta for the machinery, one purple accent. Desktop is three panes;
 * mobile is the SAME page collapsed to tabs (the panes hide, nothing unloads,
 * so the audio keeps playing while you browse). */

@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-latin-full-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-latin-full-italic.woff2') format('woff2');
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800; font-style: normal; font-display: swap;
}

:root {
  --bg: #17110c;
  --panel: #201812;
  --panel-2: #2a2018;
  --line: #3a2e22;
  --text: #f2ece3;
  --muted: #a89a88;
  --accent: #6d5ce8;
  --accent-2: #8f7ff2;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 'Plus Jakarta Sans', system-ui, sans-serif;
  min-height: 100vh;
}
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 560; margin: 0; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }
.empty { color: var(--muted); font-size: .92em; padding: .8rem 0; }

/* ── layout ─────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}
.pane { padding: 1.4rem 1.2rem 5rem; min-width: 0; }
.pane-left { border-right: 1px solid var(--line); }
.pane-right { border-left: 1px solid var(--line); }
.tabbar { display: none; }

/* ── left: hub head + directory ─────────────────────────────────── */
.hub-head h1 { font-size: 1.7rem; }
.hub-head .sub { color: var(--muted); margin: .2rem 0 1.2rem; }

.instances { display: flex; flex-direction: column; gap: .25rem; }
.instance {
  display: flex; align-items: center; gap: .7rem;
  width: 100%; text-align: left;
  background: none; border: 0; border-radius: 10px;
  padding: .5rem .6rem;
}
.instance:hover { background: var(--panel); }
.instance.current { background: var(--panel-2); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px;
  background: var(--panel-2); object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 1.1rem; color: var(--accent-2);
}
.avatar.all { background: var(--accent); color: #fff; }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.who .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .domain { color: var(--muted); font-size: .82em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The left-pane search only exists in the collapsed (mobile) variant; on
 * desktop the middle pane already carries it. */
.search-left { display: none; }

/* MusicBrainz: the artist is registered in an external, public register —
 * that earns the "official" tick. */
.badge-mb {
  display: inline-flex; align-items: center; gap: .25em;
  background: var(--accent); color: #fff;
  border-radius: 999px; padding: 0 .45em;
  font-size: .62em; font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700; line-height: 1.7; vertical-align: middle; margin-left: .45em;
  text-decoration: none;
}
a.badge-mb:hover { background: var(--accent-2); text-decoration: none; }

.submit-form { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.submit-form label { font-family: 'Fraunces', serif; font-size: 1.05rem; display: block; margin-bottom: .5rem; }
.submit-form .row { display: flex; gap: .4rem; }
.submit-form input {
  flex: 1; min-width: 0;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem;
}
.submit-form button {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: .55rem .9rem;
}
.submit-form .ok { color: #9fd6a4; font-size: .88em; }
.submit-form .err { color: #e8a1a1; font-size: .88em; }

/* ── middle: search + timeline ──────────────────────────────────── */
.searchbar input {
  width: 100%;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .65rem 1.1rem; margin-bottom: 1.2rem;
}
.tl-head {
  display: flex; align-items: center; gap: .9rem;
  padding: .4rem 0 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.tl-head .avatar { width: 52px; height: 52px; flex-basis: 52px; }
.tl-head h2 { font-size: 1.35rem; }
.tl-head .domain { margin: 0; font-size: .85em; }
.tl-head .summary { margin: .2rem 0 0; color: var(--muted); font-size: .88em; }
.head-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.btn-play-all {
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: .5rem .95rem; white-space: nowrap;
}
.btn-shuffle { background: var(--panel-2); color: var(--accent-2); border: 1px solid var(--line); }
.btn-shuffle:hover { background: var(--panel); }

.tl-items { display: flex; flex-direction: column; gap: 1rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.card .byline { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.card .byline .avatar { width: 32px; height: 32px; flex-basis: 32px; }
.card .byline time { color: var(--muted); font-size: .8em; margin-left: auto; white-space: nowrap; }
.badge-boost {
  background: var(--accent); color: #fff; font-size: .72em;
  border-radius: 6px; padding: .1rem .45rem; white-space: nowrap;
}
.card .title { font-size: 1.15rem; margin: 0 0 .5rem; }
.card .content { overflow-wrap: break-word; }
.card .content p:first-child { margin-top: 0; }
.card .content p:last-child { margin-bottom: 0; }
.post-image { border-radius: 10px; margin-bottom: .5rem; }
.card footer { margin-top: .6rem; }
.card .orig { font-size: .82em; color: var(--muted); }

.track {
  display: flex; align-items: center; gap: .7rem;
  background: var(--panel-2); border-radius: 10px; padding: .5rem .7rem; margin: .4rem 0;
}
.play {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 0; font-size: .95rem;
}
.play:hover { background: var(--accent-2); }
.track .cover { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: 0 0 40px; }
.track-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.track-meta .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta .a { color: var(--muted); font-size: .82em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .dur { color: var(--muted); font-size: .85em; }

.load-more {
  align-self: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem 1.2rem; margin: .5rem auto; display: block;
}

/* ── search results ─────────────────────────────────────────────── */
.search-summary { color: var(--muted); margin: 0 0 .8rem; }
.search-results section { margin-bottom: 1.6rem; }
.search-results h3 { font-size: 1.15rem; margin-bottom: .6rem; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.album-card {
  position: relative; display: flex; align-items: center; gap: .7rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: .6rem;
}
.album-card .cover { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: 0 0 56px; }
.album-card .cover.ph { display: inline-flex; align-items: center; justify-content: center; background: var(--panel-2); color: var(--accent-2); font-size: 1.4rem; }
.album-meta { display: flex; flex-direction: column; min-width: 0; }
.album-meta .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-meta .a { color: var(--muted); font-size: .8em; }
.album-card .play { position: absolute; right: .6rem; bottom: .6rem; width: 34px; height: 34px; flex-basis: 34px; }

/* ── right: player ──────────────────────────────────────────────── */
.player { position: sticky; top: 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.player-now { display: flex; flex-direction: column; gap: .8rem; }
.player-cover {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius);
  background: var(--panel-2) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
}
.player-cover:not(.has-art)::after { content: '♪'; font-size: 3rem; color: var(--line); }
.player-title { font-family: 'Fraunces', serif; font-size: 1.2rem; }
.player-sub { color: var(--muted); font-size: .9em; }
#player-audio { width: 100%; }
.player-queue { border-top: 1px solid var(--line); padding-top: .8rem; }
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.queue li {
  display: flex; gap: .6rem; align-items: baseline;
  padding: .45rem .5rem; border-radius: 8px; cursor: pointer;
}
.queue li:hover { background: var(--panel); }
.queue li.current { background: var(--panel-2); color: var(--accent-2); }
.queue .n { color: var(--muted); font-size: .8em; min-width: 1.2em; text-align: right; }
.queue .qt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .qd { color: var(--muted); font-size: .8em; }

/* ── mobile: the collapsed variant ──────────────────────────────── */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .pane { display: none; border: 0 !important; padding-bottom: 6rem; }
  body[data-pane="klonkts"]  .pane-left  { display: block; }
  body[data-pane="tijdlijn"] .pane-mid   { display: block; }
  body[data-pane="speler"]   .pane-right { display: block; }
  .search-left { display: block; margin-bottom: 1rem; }
  .search-left input { margin-bottom: 0; }

  .tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
    display: flex; justify-content: space-around;
    background: color-mix(in srgb, var(--bg) 88%, black);
    border-top: 1px solid var(--line);
    padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom));
    backdrop-filter: blur(8px);
  }
  .tabbar button {
    background: none; border: 0; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: .1rem;
    font-size: .72rem; padding: .3rem .9rem; border-radius: 10px;
  }
  .tabbar button .ico { font-size: 1.15rem; }
  .tabbar button.active { color: var(--accent-2); }
}
