/* sol · web: the repertoire (docs/ESPEC.md 4.3). Owner: pages. Shared parts are in paginas.css. */

/* ---------- hero: title, numbers, the level split and a hand of featured cards ----------
   Wide screens: the copy and the numbers on the left, the fanned hand on the right. Narrower: the copy, then the three
   featured pieces as a strip (so a phone's first screen already shows pieces), then the numbers. */
.rp-hero-grid {
  position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "fan" "figures";
  column-gap: clamp(32px, 4vw, 72px); align-items: center;
}
.rp-copy { grid-area: copy; }
.rp-fan { grid-area: fan; }
.rp-figures { grid-area: figures; }
@media (min-width: 1180px) {
  .rp-hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); grid-template-areas: "copy fan" "figures fan"; }
  .rp-copy { align-self: end; }
  .rp-figures { align-self: start; }
  .rp-hero .ph-staff { opacity: .5; }
}
.rp-levels { margin-top: clamp(24px, 2.6vw, 36px); max-width: 560px; }
.rp-levels-t { margin: 0 0 10px; font: 600 var(--fs-eyebrow)/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
/* the bar is an SVG (baked at build time without inline styles): three rounded segments with a soft glow */
.rp-levels-bar { display: block; width: 100%; height: 14px; overflow: visible; }
.rp-seg.lv-b { filter: drop-shadow(0 0 5px rgba(159, 210, 176, .45)); }
.rp-seg.lv-i { filter: drop-shadow(0 0 5px rgba(201, 169, 97, .45)); }
.rp-seg.lv-a { filter: drop-shadow(0 0 5px rgba(134, 169, 222, .45)); }
.rp-levels-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--text-2); font-size: .9375rem; }
.rp-levels-legend li { display: inline-flex; align-items: center; gap: 8px; }
.rp-levels-legend .num { color: var(--text); font-weight: 600; }
.lv-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lv-dot.lv-b { background: var(--ok); box-shadow: 0 0 8px rgba(159, 210, 176, .6); }
.lv-dot.lv-i { background: var(--gold); box-shadow: 0 0 8px rgba(201, 169, 97, .6); }
.lv-dot.lv-a { background: var(--blue); box-shadow: 0 0 8px rgba(134, 169, 222, .6); }

/* the featured cards */
.fan-card {
  display: flex; flex-direction: column; overflow: hidden; padding: 0; text-align: left; cursor: pointer; color: var(--text); font: inherit;
  border: 1px solid var(--line-2); border-radius: var(--radius-card); background: var(--surface);
}
.fan-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.fan-art { display: block; aspect-ratio: 2.1 / 1; }
.fan-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
.fan-t { font: 600 1.06rem/1.25 var(--font-display); letter-spacing: -.01em; }
.fan-c { color: var(--text-2); font-size: .9375rem; }
.fan-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.fan-row .chip { font-size: .875rem; height: 28px; }
.fan-play { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--gold-hi); font-weight: 600; font-size: .9375rem; }
.fan-t, .fan-c { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fan-play .ic { width: 14px; height: 14px; }
@media (max-width: 1179px) {
  .rp-fan {
    display: flex; gap: 12px; margin: clamp(24px, 4vw, 36px) calc(-1 * var(--gutter)) 0; padding: 2px var(--gutter) 6px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none;
  }
  .rp-fan::-webkit-scrollbar { display: none; }
  .fan-card { flex: 0 0 min(250px, 62vw); scroll-snap-align: start; transition: border-color .3s var(--ease); }
  .fan-card:hover { border-color: rgba(201, 169, 97, .45); }
}
@media (min-width: 1180px) {
  .rp-fan { display: block; position: relative; height: clamp(340px, 31vw, 520px); }
  .fan-card {
    --r: 0deg; --x: 0%; --y: 0%;
    position: absolute; left: 50%; top: 50%; width: clamp(244px, 20.5vw, 300px);
    box-shadow: 0 40px 80px -36px rgba(0, 0, 0, .95), 0 24px 60px -48px rgba(201, 169, 97, .5);
    transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r));
    transition: transform .55s var(--ease-out), border-color .35s var(--ease), box-shadow .35s var(--ease);
  }
  .fan-0 { --r: -8deg; --x: -50%; --y: 6%; z-index: 1; }
  .fan-1 { --r: 1.5deg; --x: 0%; --y: -5%; z-index: 3; }
  .fan-2 { --r: 9deg; --x: 50%; --y: 8%; z-index: 2; }
  .fan-card:hover, .fan-card:focus-visible { z-index: 6; border-color: rgba(201, 169, 97, .5); transform: translate(-50%, -50%) translate(var(--x), calc(var(--y) - 6%)) rotate(calc(var(--r) * .35)); }
}
@media (min-width: 1180px) and (prefers-reduced-motion: no-preference) {
  .fan-card { animation: rp-float 7s var(--ease) infinite; }
  .fan-0 { animation-delay: -2.2s; } .fan-2 { animation-delay: -4.6s; }
  .fan-card:hover, .fan-card:focus-visible { animation-play-state: paused; }
  .rp-hero .pl-motion { display: inline-grid; } /* the hand floats: its pause control (paginas.css) */
}
@keyframes rp-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

/* ---------- the search bar (sticks under the header) and the filters ---------- */
.rp-sentinel { height: 1px; margin-top: -1px; }
.rp-bar {
  position: sticky; top: var(--header-h); z-index: 30;
  display: flex; align-items: center; gap: 12px;
  margin-inline: calc(-1 * var(--gutter)); padding: 12px var(--gutter);
  background: rgba(5, 5, 6, .82); -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease);
}
.rp-bar.is-stuck { border-bottom-color: var(--line); }
@media (max-height: 500px) { .rp-bar { position: static; } }
.rp-search { position: relative; flex: 1 1 320px; max-width: 680px; min-width: 0; }
.rp-search > .ic { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--gold); pointer-events: none; }
.rp-q {
  width: 100%; min-height: 54px; padding: 0 50px 0 50px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-2); background: rgba(244, 241, 234, .05); color: var(--text);
  font: 400 1.0625rem/1 var(--font-body); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.rp-q::placeholder { color: var(--text-3); }
.rp-q:focus { border-color: var(--gold); background: rgba(244, 241, 234, .07); box-shadow: 0 0 0 4px rgba(201, 169, 97, .14); }
.rp-q::-webkit-search-cancel-button, .rp-q::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.rp-q-clear { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--text-2); }
.rp-q-clear:hover { color: var(--text); background: rgba(244, 241, 234, .08); }
.rp-bar .seg { margin-left: auto; flex: none; }
.rp-filters-btn { display: none; --h: 48px; padding: 0 16px; gap: 8px; flex: none; position: relative; }
.rp-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--gold-grad); color: var(--on-gold); font-size: .875rem; font-weight: 700; }

.rp-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 16px 0 2px; }
/* wide screens: the selects say what they are ("Todos los estilos"), their labels stay for screen readers */
@media (min-width: 761px) {
  .rp-filters .tool-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rp-filters .tool-select .select { min-width: 0; }
}
.rp-filters .chips { gap: 8px; }
.rp-filters .pill { min-height: 44px; padding: 0 16px; font-size: .9375rem; gap: 9px; }
.rp-filters .pill[aria-pressed="true"] .lv-dot { background: var(--on-gold); box-shadow: none; }
.rp-in .ic { width: 16px; height: 16px; }
.rp-sort { margin-left: auto; }
.rp-status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; min-height: 48px; margin: 8px 0 clamp(12px, 1.6vw, 20px); }
.rp-views-m { display: none !important; }
@media (max-width: 760px) {
  .rp-views-bar { display: none !important; }
  .rp-views-m { display: inline-flex !important; margin-left: auto; }
}
.rp-status .count-line { margin: 0; }
.rp-reset { --h: 44px; gap: 6px; font-size: .9375rem; }
.rp-reset .ic { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .rp-bar { gap: 8px; padding-block: 10px; }
  .rp-search { flex-basis: 0; flex-grow: 1; }
  .rp-q { min-height: 48px; padding-left: 44px; padding-right: 44px; font-size: 1rem; }
  .rp-search > .ic { left: 15px; width: 18px; height: 18px; }
  .rp-filters-btn { display: inline-flex; }
  .rp-bar .seg { margin-left: 0; }
  .rp-filters { display: none; padding-top: 14px; }
  .rp-filters.is-open { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .rp-filters .chips { flex-wrap: wrap; }
  .rp-filters .tool-select { display: grid; gap: 6px; width: 100%; }
  .rp-filters .tool-select .tool-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .rp-filters .tool-select .select { width: 100%; min-width: 0; }
  .rp-sort { margin-left: 0; }
  .rp-in { justify-self: start; }
}
@media (max-width: 400px) {
  .rp-filters-btn span:not(.rp-badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rp-filters-btn { padding: 0 13px; }
}

/* ---------- piece cards (grid) ---------- */
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(12px, 1.4vw, 22px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 252px), 1fr)); }
@media (max-width: 599px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 2200px) { .pgrid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.pgrid > li { min-width: 0; }
.pcard {
  position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  container-type: inline-size;
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.pcard .art { aspect-ratio: 2.25 / 1; }
.pcard:not(.no-preview):hover { transform: translateY(-3px); border-color: rgba(201, 169, 97, .32); box-shadow: 0 28px 60px -32px rgba(0, 0, 0, .95), 0 18px 50px -40px rgba(201, 169, 97, .45); }
@media (prefers-reduced-motion: reduce) { .pcard:not(.no-preview):hover { transform: none; } }
.pc-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 14px; flex: 1; }
.pc-head { display: grid; gap: 3px; min-width: 0; }
.pc-title { font-size: 1.0625rem; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pc-composer { margin: 0; color: var(--text-2); font-size: .9375rem; }
.pc-notes { margin: 0; color: var(--text-3); font-size: .875rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; min-width: 0; }
.pc-meta .chip, .pc-foot .chip { font-size: .875rem; height: 28px; flex: none; }
/* when the duration and the style do not fit beside the level, they go to their own line, whole */
.pc-style { min-width: 0; max-width: 100%; color: var(--text-3); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-dur { white-space: nowrap; }
.pc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); min-height: 41px; }
.pc-listen { display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; color: var(--gold-hi); font-weight: 600; font-size: .9375rem; transition: color .2s var(--ease); }
.pc-listen .ic { width: 14px; height: 14px; }
.pcard:hover .pc-listen { color: var(--text); }
.pc-in { gap: 5px; }
.pc-in .ic { width: 14px; height: 14px; }
@container (max-width: 220px) {
  .pc-body { padding: 12px 12px 12px; gap: 10px; }
  .pc-title { font-size: 1rem; }
  .pc-composer { font-size: .875rem; }
  .pc-notes, .pc-style-name, .pc-style-sep { display: none; }
  .pc-listen span { display: none; }
  .pc-in { padding: 0 9px; }
}

/* ---------- list view ---------- */
.pgrid.is-list { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
.pgrid.is-list .pcard { flex-direction: row; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; container-type: normal; }
.pgrid.is-list .pcard:hover { transform: none; box-shadow: none; background: rgba(244, 241, 234, .035); }
.pgrid.is-list .art { display: none; }
.pgrid.is-list .pc-body { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: 8px 24px; padding: 14px 14px; }
.pgrid.is-list .pc-head { grid-template-columns: minmax(0, 1fr); }
.pgrid.is-list .pc-title { font-size: 1.02rem; }
.pgrid.is-list .pc-notes { display: none; }
.pgrid.is-list .pc-meta { margin: 0; flex-wrap: nowrap; }
.pgrid.is-list .pc-dur { margin-left: auto; }
.pgrid.is-list .pc-foot { border: 0; padding: 0; justify-content: flex-end; gap: 14px; flex-direction: row-reverse; min-height: 0; }
.pgrid.is-list .stretch::after { border-radius: 0; }
@media (max-width: 760px) {
  .pgrid.is-list .pc-body { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; padding: 12px 6px; }
  .pgrid.is-list .pc-meta { grid-column: 1; grid-row: 2; flex-wrap: wrap; }
  .pgrid.is-list .pc-dur { margin-left: 0; }
  .pgrid.is-list .pc-foot { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-end; gap: 8px; }
  .pgrid.is-list .pc-listen span { display: none; }
  .pgrid.is-list .pc-listen { width: 44px; height: 44px; justify-content: center; border-radius: 50%; border: 1px solid var(--line-2); }
  .pgrid.is-list .pc-listen .ic { width: 18px; height: 18px; }
}

/* the pieces baked in the page (before the script takes over, and without JavaScript): the browser lays out only
   the ones near the screen; without JavaScript nothing opens, so "Ver y escuchar" is not shown */
.pgrid.is-static > li { content-visibility: auto; contain-intrinsic-size: auto 300px; }
@media (max-width: 599px) { .pgrid.is-static > li { contain-intrinsic-size: auto 250px; } }
html:not(.js) .pc-listen { visibility: hidden; }

/* ---------- more pieces: the grid shows a batch at a time, so the page ends on its closing call ---------- */
.rp-more { display: grid; justify-items: center; gap: 10px; margin: clamp(28px, 3vw, 44px) 0 0; text-align: center; }
.rp-more-n { margin: 0; color: var(--text-3); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.rp-more-btn .ic { width: 18px; height: 18px; }

/* ---------- nothing matches ---------- */
.rp-empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: clamp(40px, 6vw, 96px) 16px; color: var(--text-3); }
.rp-rest { width: min(240px, 70vw); height: auto; color: var(--text-3); margin-bottom: 12px; }
.rp-empty-t { font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); color: var(--text); }
.rp-empty p { margin: 0 0 10px; color: var(--text-2); }
.rp-q:placeholder-shown { padding-right: 18px; }
