/* ============================================================================
   Ranking editorial — Las 21 de Uno
   Estilo tipo telemetría / tabla de posiciones de competencia
   (sin votaciones)
============================================================================ */

.ranking-lead {
  margin: 0;
  text-align: left;
  font-size: clamp(0.68rem, 1.1vh, 0.82rem);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  max-width: none;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ranking-date {
  margin: 0;
  font-size: clamp(0.7rem, 1.2vh, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amarillo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

/* Título + director + nota en una sola fila (se pliega si no cabe) */
.cabecera--inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px 14px;
  text-align: left;
  width: 100%;
  padding: 0 0 6px;
  margin: 0;
}

.cabecera--inline h1 {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vh, 1.45rem);
  line-height: 1.1;
  white-space: nowrap;
  flex-shrink: 0;
}

.cabecera--inline h3,
.cabecera--inline .ranking-director {
  margin: 0;
  font-size: clamp(0.78rem, 1.5vh, 0.95rem);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.95;
}

.cabecera--inline .ranking-lead {
  flex: 1 1 140px;
  align-self: center;
  border-left: 1px solid var(--border-subtle);
  padding-left: 12px;
}

.cabecera--inline .ranking-date {
  align-self: center;
}

@media (max-width: 640px) {
  .cabecera--inline {
    gap: 4px 10px;
  }

  .cabecera--inline h1 {
    font-size: clamp(0.98rem, 4.8vw, 1.2rem);
  }

  .cabecera--inline h3,
  .cabecera--inline .ranking-director {
    font-size: 0.78rem;
  }

  .cabecera--inline .ranking-lead {
    flex: 1 1 100%;
    border-left: none;
    padding-left: 0;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .cabecera--inline .ranking-date {
    flex: 1 1 100%;
    white-space: normal;
  }
}

@media (max-width: 400px) {
  .cabecera--inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .cabecera--inline .ranking-lead {
    flex-basis: auto;
  }
}

.lista-canciones--race {
  /* hereda grid de .lista-canciones */
}

.race-item {
  cursor: default;
}

.race-item .vote-icon {
  display: none;
}

/* Posición grande tipo dorsal / clasificación */
.race-pos {
  font-variant-numeric: tabular-nums;
  font-size: clamp(1rem, 1.8vh, 1.35rem) !important;
  min-width: 1.6em !important;
  line-height: 1.1 !important;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--amarillo);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.race-item--podium .race-pos {
  color: #ffd700;
}

.race-item--leader {
  border-color: rgba(255, 215, 0, 0.55);
  background: linear-gradient(145deg, rgba(255, 215, 0, 0.12) 0%, var(--bg-surface) 55%);
  box-shadow: inset 3px 0 0 #ffd700;
}

.race-item--podium:nth-child(2) {
  box-shadow: inset 3px 0 0 #c0c0c0;
}

.race-item--podium:nth-child(3) {
  box-shadow: inset 3px 0 0 #cd7f32;
}

.race-item--recommended {
  grid-column: 1 / -1;
  border-color: rgba(0, 102, 255, 0.5);
  background: linear-gradient(120deg, rgba(0, 102, 255, 0.18) 0%, var(--bg-surface) 45%);
  box-shadow: inset 3px 0 0 var(--primary);
}

.race-badge {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blanco);
  background: linear-gradient(90deg, var(--primary), var(--primary-soft));
  border-radius: 4px;
  width: fit-content;
}

.race-telemetry {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.star-row {
  display: inline-flex;
  gap: 1px;
  font-size: clamp(0.65rem, 1.1vh, 0.78rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.star {
  color: rgba(255, 255, 255, 0.2);
}

.star--on {
  color: var(--amarillo);
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.45);
}

.race-interest-meta {
  justify-content: space-between;
  font-size: clamp(0.62rem, 1vh, 0.75rem) !important;
  opacity: 0.9;
}

.race-interest-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--amarillo);
}

.race-bar {
  height: 7px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.race-fill {
  border-radius: 999px !important;
}

.race-side-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.spotify-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(30, 215, 96, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
  color: #04140a;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(29, 185, 84, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.spotify-play-btn:hover {
  filter: brightness(1.06);
  transform: scale(1.04);
}

.spotify-play-btn.is-active {
  background: linear-gradient(135deg, #168f42 0%, #1db954 100%);
  color: #fff;
}

.spotify-play-label {
  font-size: 0.62rem;
}

.spotify-embed-mount {
  display: none;
  width: 100%;
  margin-top: 4px;
}

.song-item.song-playing {
  z-index: 30;
  overflow: visible;
  grid-column: 1 / -1;
  border-color: rgba(30, 215, 96, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.song-item.song-playing .spotify-embed-mount {
  display: block;
}

.spotify-embed {
  display: block;
  width: 100%;
  min-height: 152px;
  border: 0;
  background: #000;
}

.race-loading {
  grid-column: 1 / -1;
  text-align: center;
  opacity: 0.75;
  font-size: 0.9rem;
}

/* Quitar estados de votación si quedaran residuales */
.song-item.votable,
.song-item.no-votable,
.song-item.ya-votado {
  cursor: default;
  opacity: 1;
}

@media (max-width: 768px) {
  .lista-canciones--race {
    gap: 8px;
  }

  /* Filas tipo clasificación (pista / podio) */
  .race-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "pos text"
      "bar bar"
      "meta meta";
    column-gap: 10px;
    row-gap: 6px;
    align-items: center;
  }

  .race-item .song-header {
    display: contents;
  }

  .race-item .song-details {
    display: contents;
  }

  .race-item .race-pos {
    grid-area: pos;
    font-size: 1.45rem !important;
    min-width: 1.7em !important;
    align-self: center;
  }

  .race-item .song-text {
    grid-area: text;
    min-width: 0;
  }

  .race-item .race-telemetry {
    display: none;
  }

  .race-item .race-side-actions {
    grid-area: play;
    align-self: start;
  }

  .race-item:not(.has-spotify) .race-side-actions {
    display: none;
  }

  .race-item.has-spotify {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "pos text play"
      "bar bar bar"
      "meta meta meta"
      "embed embed embed";
  }

  .race-item.song-playing .spotify-embed-mount {
    grid-area: embed;
  }

  .spotify-play-btn {
    min-width: 40px;
    height: 36px;
  }

  .spotify-play-label {
    display: none;
  }

  .race-item .race-interest-meta {
    grid-area: meta;
    margin: 0;
    padding: 0;
  }

  .race-item .race-bar {
    grid-area: bar;
    height: 8px !important;
  }

  .race-item .song-title {
    font-size: 1rem;
    font-weight: 800;
  }

  .race-item .song-artist {
    font-size: 0.8rem;
  }

  .race-item--leader,
  .race-item--podium {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .race-item--recommended {
    grid-column: 1 / -1;
    margin-top: 4px;
  }

  .race-item--recommended .race-pos {
    font-size: 0.72rem !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .race-badge {
    font-size: 0.62rem;
    padding: 3px 8px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .race-item--recommended {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1025px) {
  .race-item--recommended {
    grid-column: 1 / -1;
  }
}

/* --------------------------------------------------------------------------
   SEO / GEO — contenido citable (bots, AI Overviews, asistentes)
-------------------------------------------------------------------------- */
.seo-ranking-ssr {
  margin: 0;
  padding: 12px 12px 12px 1.6rem;
  list-style: decimal;
  background: var(--bg-elevated, rgba(0, 0, 0, 0.25));
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--blanco, #fff);
}

.seo-ranking-ssr li {
  margin: 0.35em 0;
}

.seo-ranking-ssr a {
  color: var(--amarillo, #f0d000);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.seo-facts,
.seo-faq {
  margin-top: 18px;
  padding: 16px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
}

.seo-facts h2,
.seo-faq h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--amarillo, #f0d000);
}

.seo-facts h3,
.seo-faq h3 {
  margin: 12px 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.seo-facts p,
.seo-faq p {
  margin: 0 0 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.seo-facts-top {
  margin: 0 0 10px;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.seo-facts-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
}

.seo-edition-details {
  margin-top: 8px;
  font-size: 0.88rem;
}

.seo-edition-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #9ec1ff;
  list-style: none;
}

.seo-edition-details summary::-webkit-details-marker {
  display: none;
}

.seo-edition-details[open] summary {
  margin-bottom: 8px;
}

.seo-faq-item + .seo-faq-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.seo-faq a {
  color: #9ec1ff;
}

.site-footer p {
  margin: 0 0 6px;
}

.site-footer a {
  color: #9ec1ff;
  text-decoration: none;
}

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