/* MB Release Viewer – cleaned CSS (cover width hugs nav)
   - Tabs: hug content (text + equal L/R padding), variable widths
   - Cover: square, width follows the combined width of the 3 buttons (+ gaps)
*/

/* ------------------------------------------------------------
   0) Variables + base
------------------------------------------------------------ */
:root{
  --wrap: 980px;

  --bg: #0b0c10;
  --panel: #141823;
  --panel-2: #0f1220;

  --border: #242a3a;
  --border-2: #2b3247;

  --text: #e9eef5;
  --link: #8ab4ff;
  --muted: rgba(233,238,245,.70);

  --tabs-gap: 8px;
  --tab-pad-y: 7px;
  --tab-pad-x: 9px;

  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

*, *::before, *::after{
  box-sizing: border-box;
}

body{
  margin: 0;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
}

.wrap{
  max-width: var(--wrap);
  margin: 24px auto 0;
}

a{ color: var(--link); text-decoration: none; }
a:hover{ text-decoration: underline; }

.muted{ opacity: .7; }
.err{ color:#ffb4b4; margin-top:10px; }

[hidden]{ display:none !important; }

/* ------------------------------------------------------------
   1) Header (sticky search bar)
------------------------------------------------------------ */
.top{
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;

  /* background: rgba(15, 18, 32, 0.72); */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.top-inner{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 15px 5px;

  display: flex;
  align-items: center;
  gap: 38px;
}

.top .brand{
  font-weight: 600;
  opacity: 0.8;
  white-space: nowrap;
  font-size: 20px;
}

.top .search{
  flex: 1;
  display: flex;
  gap: 8px;
}

/* Inputs */
input{
  width: 100%;
  padding: 12px 0px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--link);
  outline: none;
  box-shadow: none;
  transition: color 120ms ease, caret-color 120ms ease;
  caret-color: var(--muted);
}

input:hover{
  color: #ffffff;
  caret-color: #ffffff;
}

input:focus,
input:focus-visible{
  outline: none;
  box-shadow: none;
}

button{
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--border-2);
  background: #1a2140;
  color: var(--text);
  cursor: pointer;
}
button:hover{ filter: brightness(1.08); }

.go-btn{
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  transition: filter 120ms ease, transform 80ms ease;
}

.go-btn img{
  width: 25px;
  height: 25px;
  display: block;
  transition: transform 120ms ease, filter 120ms ease;
}

.go-btn:hover{
  filter: brightness(1.15);
}

.go-btn:hover img{
  transform: scale(1.06);
  filter: brightness(1.08);
}

.go-btn:active{
  transform: scale(0.98);
}

/* ------------------------------------------------------------
   2) Layout blocks
------------------------------------------------------------ */
.row{
  display:flex;
  gap:30px;
  align-items:flex-start;
}

.main{ flex: 1; min-width: 0; }

h1{
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 8px;
}

/* ------------------------------------------------------------
   3) Cover + cover navigation
   IMPORTANT: cover width is NOT fixed.
   It shrink-wraps to the nav width.
------------------------------------------------------------ */
.cover{
  flex: 0 0 auto;
  display: inline-block;     /* shrink-wrap */
  max-width: 100%;
}

/* Square cover that follows the cover container width */
.cover-box{
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.cover-box img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-nav-row{
  margin-top: 20px;
  width: fit-content;        /* hug the buttons row */
  max-width: 100%;
}

/* ------------------------------------------------------------
   4) Tabs
------------------------------------------------------------ */
.tabs{
  display: flex;
  gap: var(--tabs-gap);
  flex-wrap: wrap;
}

/* “tab” button look */
.tab{
  padding: var(--tab-pad-y) var(--tab-pad-x);
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.tab:hover{ filter: brightness(1.08); }

.tab.is-active{
  background: #1a2140;
}

/* Cover tabs: MUST hug content (no width:100%) */
.cover-tabs{
  display: flex;
  gap: var(--tabs-gap);
  align-items: center;
  width: fit-content;        /* hug content so cover can hug this */
  max-width: 100%;
}

.cover-tabs .tab{
  flex: 0 0 auto;
  width: auto;
  text-align: center;
}

/* MusicBrainz link: exactly the same “tab” metrics */
.mb-link{
  flex: 0 0 auto;
  width: auto;

  padding: var(--tab-pad-y) var(--tab-pad-x);
  line-height: 1;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.mb-link:hover{ filter: brightness(1.08); }

/* ------------------------------------------------------------
   5) Meta block
------------------------------------------------------------ */
.meta{
  opacity: .9;
  line-height: 1.45;
}

.artist{
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 6px;
}

.meta-list{
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.75;
}

.meta-list > div{ margin-bottom: 2px; }

.meta-k{
  font-weight: 400;
  color: #9aa4c7;
}

/* ------------------------------------------------------------
   6) Track table
------------------------------------------------------------ */
.tracks{ margin-top:16px; }

table{
  width:100%;
  border-collapse: collapse;
  font-size: 14px;
}

td{
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.35;
}

td.num{
  width:42px;
  opacity:.7;
  font-variant-numeric: tabular-nums;
}

td.len{
  width:70px;
  text-align:right;
  opacity:.8;
  font-variant-numeric: tabular-nums;
}

td.title{ word-break: break-word; }

tr:hover td{ background: rgba(255,255,255,0.03); }

tr.track{ cursor: pointer; }
tr.track:hover td{ background: rgba(255,255,255,0.05); }
tr.track.is-open td{ background: rgba(255,255,255,0.04); }

/* details rows should not add extra borders/padding */
tr.details td{
  padding-top: 0;
  padding-bottom: 0;
  border-top: none;
}

/* ------------------------------------------------------------
   7) Track details (smooth open/close)
------------------------------------------------------------ */
.details-wrap{
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 260ms ease, opacity 180ms ease;
  will-change: max-height, opacity;
}

tr.details.is-open .details-wrap{
  opacity: 1;
}

/* three-column details layout */
.detail-cols{
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1.6fr;
  gap: 12px;
  align-items: start;
}

.detail-col{
  min-width: 0;
}

/* ------------------------------------------------------------
   8) Performer/Creator blocks
------------------------------------------------------------ */
.perf{
  padding: 10px 10px 12px;
  margin-left: 10px;
  overflow: hidden;

  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 320ms ease, transform 320ms ease;
}

tr.track.is-open + tr.details .perf{
  opacity: 1;
  transform: translateY(0);
}

.perf .grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
}

.perf .inst{
  opacity: .65;
  font-size: 12px;
  letter-spacing: .02em;
}

.perf .artists a{
  margin-right: 8px;
  opacity: 0.9;
}

/* ------------------------------------------------------------
   9) Cards (Credits view)
------------------------------------------------------------ */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.view .card{ background:#111626; }
.view h2{ margin-top: 0; }

.stack{ margin-top: 12px; }
.stack:first-of-type{ margin-top: 10px; }

.card-title{
  margin-bottom: 8px;
}

.kv{ margin: 2px 0; }
.kv .k{ color:#9aa4c7; font-weight: 400; }

.link-group{ margin: 8px 0; }
.link-group-title{ margin-bottom: 6px; }

.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border-2);
  background:#101426;
  font-size:12px;
  margin-right:8px;
}

/* ------------------------------------------------------------
   10) Annotation (Tracklist view only)
------------------------------------------------------------ */
.annotation{
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #b9c0d0;
}

.annotation .body{
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
  opacity: .92;
}

/* ------------------------------------------------------------
   11) Responsive
------------------------------------------------------------ */
@media (max-width: 640px){
  body{ padding: 16px; }

  .top-inner{
    flex-direction: column;
    align-items: stretch;
  }

  .row{ flex-direction: column; }

  /* on mobile let cover take full width nicely */
  .cover{ width: 100%; }
  .cover-nav-row,
  .cover-tabs{ width: 100%; justify-content: center; }

  td.num{ width: 34px; }
  td.len{ width: 56px; }

  .detail-cols{ flex-direction: column; }
}

/* Recordings (2-col "role → value" table) */
.rc-table{
  display: grid;
  grid-template-columns: 220px 1fr;
  column-gap: 16px;
  row-gap: 6px;
  margin-top: 10px;
}

.rc-role{ font-size: 13px; }
.rc-val{ font-size: 13px; line-height: 1.35; }

.footer{
  /* a header alá üljön szépen */
  margin-top: 10px;
  padding: 0;                 /* a paddinget a .top-inner adja */
  font-size: 12px;            /* kisebb betű */
  line-height: 1.25;
}

.footer a{
  color: inherit;             /* ne legyen "link-kék", maradjon szöveg */
  text-decoration: none;
}

.footer a:hover{
  text-decoration: underline;
}

/* a footerben ugyanaz a rács, mint fent: brand oszlop + search oszlop */
.footer-inner{
  display: grid;
  grid-template-columns: auto 1fr; /* ugyanaz az arány mint a headerben */
  column-gap: 16px;
  align-items: start;
}

/* a szöveg maradjon a brand alatti (bal) oszlopban */
.footer-text{
  grid-column: 1;
  opacity: 0.85;              /* finomabb */
  white-space: nowrap;        /* ettől “pont akkora” marad, nem törik le */
  overflow: hidden;
  text-overflow: ellipsis;    /* ha nagyon keskeny a kijelző, ne essen szét */
}