/*
 * Team Roster (oct-2026), reconstrucción propia para el sitio Marca.
 *
 * Cada letra de un nombre es una ventana de una línea con la letra dos veces:
 * la tenue y una copia oscura debajo (::after). La fila activa sube cada letra
 * una línea, escalonada por su índice. El retrato apila capas: la nueva entra
 * con una cortina desde arriba (clip-path) mientras se achica a su tamaño, y
 * la de abajo se hunde un poco.
 *
 * Escritorio: lista a la izquierda, retrato grande pegado a la derecha.
 * Celular (bajo 760 px): el retrato se vuelve una franja compacta (foto +
 * ficha) pegada bajo el encabezado, y la lista corre debajo; se elige tocando.
 */
.tr {
  --tr-tinta: var(--navy, #0b2578);
  --tr-tenue: #8d8ea3;
  --tr-linea: var(--linea, #e6e4ec);
  --tr-acento: var(--magenta, #9d0067);
  --tr-top: 96px;
  container-type: inline-size;
  color: var(--tr-tinta);
}
.tr__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- cabeza: cuántos y filtros --------------------------------------------- */
.tr__cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.tr__cuenta { margin: 0; font-size: 15px; font-weight: 600; color: var(--texto, #3a3b4c); }
.tr__cuenta b { font-size: 22px; font-weight: 700; color: var(--tr-tinta); margin-right: 4px; }
.tr__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr__chips button {
  min-height: 40px; padding: 8px 14px; border: 0; border-radius: 99px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--tr-tinta);
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--tr-linea); cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.tr__chips button:hover { box-shadow: inset 0 0 0 1.5px var(--tr-tinta); }
.tr__chips button[aria-pressed="true"] { color: #fff; background: var(--tr-tinta); box-shadow: none; }
.tr__chips button[data-filtro="maximo"][aria-pressed="true"] { background: var(--tr-acento); }
.tr__chips sup { margin-left: 3px; font-size: 0.72em; opacity: 0.6; }

/* --- cuerpo ----------------------------------------------------------------- */
.tr__cuerpo { display: grid; grid-template-columns: 1fr 42%; column-gap: 5cqw; align-items: start; }
.tr__lista { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--tr-linea); counter-reset: none; }
.tr__lista > li[hidden] { display: none; }
.tr__lista.es-filtrada > li { animation: tr-entra 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--tr-k, 0) * 0.035s); }
@keyframes tr-entra { from { opacity: 0; translate: 0 10px; } }

.tr__fila {
  display: grid; grid-template-columns: 2.4em 1fr auto auto; align-items: baseline; gap: 0 12px;
  width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--tr-linea);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.3s ease;
}
.tr__fila.es-activa, .tr__fila[aria-pressed="true"] { border-bottom-color: var(--tr-tinta); }
.tr__fila:focus-visible { outline-offset: 2px; }
.tr__n, .tr__asig, .tr__pm { font-size: 13.5px; color: var(--tr-tenue); transition: color 0.3s ease; }
.tr__n { font-variant-numeric: tabular-nums; }
.tr__pm { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 2.6em; font-weight: 700; color: var(--tr-acento); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tr__pm svg { width: 15px; height: 15px; fill: var(--oro, #f4b300); }
.tr__fila[aria-pressed="true"] :is(.tr__n, .tr__asig) { color: var(--tr-tinta); }
.tr__quien { display: flex; align-items: center; min-width: 0; }
.tr__flecha {
  flex: none; width: 0; height: 0.8em; fill: none; stroke: var(--tr-acento); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; font-size: clamp(19px, 2.3cqw, 30px); opacity: 0;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, margin 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.tr__fila[aria-pressed="true"] .tr__flecha { width: 0.6em; margin-right: 0.25em; opacity: 1; }
.tr__nombre { display: inline-flex; font-size: clamp(19px, 2.3cqw, 30px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; white-space: nowrap; color: var(--tr-tenue); }
.tr--vivo .tr__nombre { color: inherit; }
.tr__fila[aria-pressed="true"] .tr__nombre { color: var(--tr-tinta); }
.tr__espacio { white-space: pre; }
/* La letra es una ventana de una línea; la letra y su copia oscura suben
   juntas por ella. */
.tr__letra { display: inline-block; overflow: hidden; vertical-align: top; }
.tr__glifo { position: relative; display: inline-block; color: var(--tr-tenue); transition: translate 0.5s cubic-bezier(0.65, 0, 0.35, 1); transition-delay: calc(var(--tr-i) * 0.018s); }
.tr__glifo::after { content: attr(data-ch); position: absolute; left: 0; top: 100%; color: var(--tr-tinta); }
.tr__fila[aria-pressed="true"] .tr__glifo { translate: 0 -100%; }

/* --- retrato ---------------------------------------------------------------- */
.tr__lado { position: sticky; top: var(--tr-top); }
.tr__marco { position: relative; aspect-ratio: 6 / 5; overflow: hidden; border-radius: 4px; background: #eeeef2; }
.tr__capa { position: absolute; inset: 0; overflow: hidden; }
.tr__capa img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.tr__capa.es-nueva { animation: tr-cortina 1s cubic-bezier(0.16, 1, 0.3, 1) both; }
.tr__capa.es-nueva > img { animation: tr-zoom 1s cubic-bezier(0.16, 1, 0.3, 1) both; }
.tr__capa.es-bajo > img { animation: tr-hunde 1s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes tr-cortina { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes tr-zoom { from { scale: 1.22; } }
@keyframes tr-hunde { to { scale: 0.96; translate: 0 6%; } }
.tr__ficha { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 16px; padding-top: 14px; }
.tr__ficha.es-nueva .tr__f-texto { animation: tr-entra 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.tr__f-texto { display: grid; gap: 6px; min-width: 0; }
.tr__f-nombre { margin: 0; font-size: clamp(20px, 2.2cqw, 26px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.tr__f-asig { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--texto, #3a3b4c); }
/* La cifra va en Inter gruesa (nunca en Pirulen). */
.tr__cifra { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--texto, #3a3b4c); }
.tr__cifra b { font-family: 'Inter', system-ui, sans-serif; font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 0.9; color: var(--tr-acento); font-variant-numeric: tabular-nums; }
.tr__cifra svg { flex: none; width: 30px; height: 30px; fill: var(--oro, #f4b300); }
.tr__cifra.es-maximo span { color: var(--tr-acento); }
.tr__pie { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tr__pos { font-size: 13px; color: var(--tr-tenue); font-variant-numeric: tabular-nums; }
.tr__flechas { display: flex; gap: 6px; }
.tr__flechas button {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: #fff; color: var(--tr-tinta); box-shadow: inset 0 0 0 1.5px var(--tr-linea); cursor: pointer;
  transition: background-color 0.25s ease;
}
.tr__flechas button:hover { background: var(--tr-linea); }
.tr__flechas svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tr:not(.tr--vivo) .tr__flechas { visibility: hidden; }

/* --- celular: franja compacta pegada arriba, lista debajo ------------------- */
@container (max-width: 759px) {
  .tr__cuerpo { grid-template-columns: 1fr; row-gap: 14px; }
  .tr__lado {
    order: -1; z-index: 2; display: grid; grid-template-columns: 38% 1fr; gap: 12px; align-items: center;
    padding: 10px; margin-inline: -10px; background: #fff; border-radius: 6px;
    box-shadow: 0 8px 20px rgba(20, 22, 58, 0.1);
  }
  .tr__ficha { grid-template-columns: 1fr; padding-top: 0; gap: 8px; }
  .tr__f-nombre { font-size: 18px; }
  .tr__f-asig { font-size: 13px; }
  .tr__cifra b { font-size: 32px; }
  .tr__cifra svg { width: 22px; height: 22px; }
  .tr__cifra { font-size: 12px; }
  .tr__pie { flex-direction: row; align-items: center; justify-content: space-between; }
  .tr__flechas button { width: 36px; height: 36px; }
  .tr__fila { grid-template-columns: 2em 1fr auto; padding: 11px 0; }
  .tr__fila .tr__asig { display: none; }
  .tr__nombre { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .tr *, .tr *::after { animation-duration: 0.01s !important; animation-delay: 0s !important; transition-duration: 0.01s !important; transition-delay: 0s !important; }
}
