/* /distro - long catalogue table.
   Wide screens: a real table with a sticky header and right-aligned figures.
   Phones: every row reflows into a compact entry (no horizontal page scroll, no inner scroll). */

/* ---------- alphabet index (distro) ------------------------------------- */
.letters { margin-bottom: var(--s-6); scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.letters ul { display: flex; flex-wrap: wrap; gap: .25rem; }
.letters a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 .5rem;
  font-weight: 600; font-size: var(--fs-sm); line-height: 1;
  color: var(--text-muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.letters a:hover { color: var(--accent-hot); border-color: var(--accent); }

/* ---------- table ------------------------------------------------------- */
.catalog__table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.45; }
.catalog__table th, .catalog__table td { text-align: left; vertical-align: top; overflow-wrap: break-word; }

.catalog__table thead th {
  position: sticky; top: calc(var(--header-h) + 3px);
  padding: .8rem .5rem;
  background: var(--header-bg); /* same translucent token as the site header: follows a background picture */
  color: var(--text-muted); font-weight: 600; white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
}
.catalog__table thead th:first-child { padding-left: 0; }
.catalog__table thead th:last-child { padding-right: 0; }

.catalog__row > * { padding: .7rem .5rem; border-top: 1px solid var(--line); }
.catalog__row > :first-child { padding-left: 0; }
.catalog__row > :last-child { padding-right: 0; }
.catalog__row:hover > * { background: var(--hover-wash); }

.catalog__table .num { text-align: right; }
.catalog__artist { font-weight: 600; color: var(--text); }
.catalog__title { color: var(--text); }
.catalog__style, .catalog__label, .catalog__format { color: var(--text-muted); }
.catalog__amount { color: var(--text); font-weight: 600; }
.catalog__cur { color: var(--text-faint); font-size: var(--fs-xs); }

.catalog__sold {
  display: inline-block; padding: .05rem .5rem;
  color: var(--danger); border: 1px solid var(--danger); border-radius: var(--radius);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
}
/* Sold out: no opacity (it would pull the text under AA). Quieter tokens plus a strike-through on artist and title,
   so the state does not rely on colour alone; the "Sold out" chip in the price cell names it in words. */
.is-soldout .catalog__artist, .is-soldout .catalog__title {
  color: var(--text-muted);
  text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--text-faint);
}
.is-soldout .catalog__style, .is-soldout .catalog__label, .is-soldout .catalog__format { color: var(--text-faint); }

/* letter row */
.catalog__group th {
  padding: var(--s-6) 0 0;
  border-bottom: 1px solid var(--line-strong);
  scroll-margin-top: calc(var(--header-h) + 5rem);
}
.catalog tbody:first-of-type .catalog__group th { padding-top: 0; }
.catalog__grouphead { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.catalog__letter { font-family: var(--font-brand); font-size: var(--fs-xl); line-height: 1; color: var(--accent); font-weight: var(--fw-display); font-synthesis: none; }
.catalog__groupmeta { display: inline-flex; align-items: baseline; gap: var(--s-4); color: var(--text-faint); font-weight: 400; font-size: var(--fs-sm); }
.catalog__groupmeta { align-items: center; }
.catalog__groupmeta a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-muted); } /* 44px touch target */
.catalog__groupmeta a:hover { color: var(--accent-hot); }
.catalog__table tbody[id] { scroll-margin-top: calc(var(--header-h) + 5rem); }
.catalog__group + .catalog__row > *, tbody > .catalog__row:first-child > * { border-top: 0; }

/* column widths: distro */
.distro .c-artist { width: 20%; }
.distro .c-title  { width: 25%; }
.distro .c-style  { width: 16%; }
.distro .c-label  { width: 17%; }
.distro .c-format { width: 11%; }
.distro .c-price  { width: 11%; }
@media (min-width: 64em) {
  .distro .c-artist { width: 22%; }
  .distro .c-title  { width: 27%; }
  .distro .c-style  { width: 17%; }
  .distro .c-label  { width: 17%; }
  .distro .c-format { width: 9%; }
  .distro .c-price  { width: 8%; }
}
/* two currencies: the main price on the first line, the second one under it */
.distro .catalog__price .catalog__amount { white-space: nowrap; }
.distro .catalog__price .catalog__cur { display: block; }

@media (min-width: 64em) {
  .catalog__row > * { padding-inline: .75rem; }
  .catalog__table thead th { padding-inline: .75rem; }
  .catalog__row > :first-child, .catalog__table thead th:first-child { padding-left: 0; }
  .catalog__row > :last-child, .catalog__table thead th:last-child { padding-right: 0; }
}

/* ---------- phones and small tablets: reflow ----------------------------- */
@media (max-width: 44.99em) {
  .catalog__table, .catalog__table tbody, .catalog__table tr, .catalog__table th, .catalog__table td { display: block; }
  .catalog__table colgroup { display: none; }
  .catalog__table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  }
  .catalog__table { font-size: var(--fs-sm); }

  .catalog__row { position: relative; min-height: 5.45rem; padding: .85rem 6.25rem .85rem 4.5rem; border-top: 1px solid var(--line); }
  .catalog__group + .catalog__row, tbody > .catalog__row:first-child { border-top: 0; }
  .catalog__row > * { padding: 0; border: 0; }
  .catalog__row:hover > * { background: none; }

  .catalog__artist { font-size: var(--fs-base); }
  .catalog__title { margin-bottom: .2rem; }
  .catalog__table .catalog__style, .catalog__table .catalog__label, .catalog__table .catalog__format {
    display: inline; font-size: var(--fs-sm);
  }
  .catalog__style::after, .catalog__label::after { content: "\00a0/ " / ""; color: var(--text-faint); }

  .distro .catalog__price { position: absolute; top: .85rem; right: 0; width: 6rem; text-align: right; }
  .catalog__table .catalog__row > .catalog__pic { position: absolute; top: .85rem; left: 0; width: 3.75rem; padding: 0; }

  .catalog__group th { padding-top: var(--s-4); }
}
