/* WondarCore — código propio, no generado. Se puede modificar libremente. */
/* Adaptado de Gonzalo/ranking.css (paleta ya alineada con el sitio real: mismo degradé oscuro que
   usa versus-publico.css para su hero, mismo azul de hover que pais-publico.css en el breadcrumb).
   Sin contenido/imágenes hardcodeadas acá (ver regla de CLAUDE.md) — los thumbs de cada fila se
   setean desde JS (ranking-publico.js) vía background-image inline. */

.ranking-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* ── BREADCRUMB (mismo patrón que pais-publico.css / continente-publico.css) ── */
.destino-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.bc-link { font-size: 0.82rem; color: #666; text-decoration: none; transition: color 0.15s; }
.bc-link:hover { color: #2563eb; }
.bc-sep { font-size: 0.82rem; color: #bbb; }
.bc-current { font-size: 0.82rem; color: #1a1a2e; font-weight: 600; }

/* ── HERO ── */
.ranking-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 60%, #1a1a2e 100%);
  border-radius: 20px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  color: #fff;
  margin-bottom: 1.25rem;
}
.ranking-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.ranking-hero-sub {
  font-size: 0.88rem;
  color: #bfdbfe;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto;
}

/* ── TABS ── */
.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
}
.ranking-tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: #555;
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 50px;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.ranking-tab:hover { border-color: #16a34a; color: #16a34a; }
.ranking-tab--active {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}
.ranking-tab--active:hover { color: white; }

/* ── SECCIÓN (una sola visible a la vez, según la pestaña activa) ── */
.ranking-section {
  display: none;
  background: white;
  border-radius: 18px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  scroll-margin-top: 96px;
}
.ranking-section.is-active {
  display: block;
}

.ranking-section__head {
  margin-bottom: 1rem;
}
.ranking-section__head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1a2e;
  letter-spacing: -0.01em;
}
.ranking-section__head p {
  margin-top: 3px;
  font-size: 0.8rem;
  color: #999;
  line-height: 1.45;
}

.ranking-vacio,
.ranking-cargando {
  font-size: 0.85rem;
  color: #aaa;
  padding: 1rem 0;
  list-style: none;
}
.ranking-cargando {
  min-height: 48px;
}

/* ── LISTA ── */
.ranking-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 26px 44px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 8px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.ranking-row:hover { background: #f8f8fb; }

.ranking-row__rank {
  font-size: 1rem;
  font-weight: 900;
  color: #c7ccd4;
  text-align: center;
}
.ranking-row--top3 .ranking-row__rank { color: #16a34a; }

.ranking-row__thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: #eee;
  flex-shrink: 0;
}

.ranking-row__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
/* Envuelve nombre + sello oro/plata/bronce en una fila propia — el sello queda con flex-shrink:0
   así nunca lo recorta el ellipsis del nombre, aunque el nombre sea largo (migrado de
   Gonzalo/ranking.css, ver MIGRACION-1b7ce783.md Tarea 1/2). */
.ranking-row__name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ranking-row__name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ranking-row__name-row .rank-seal {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.ranking-row__name-row .rank-seal svg { width: 11px; height: 11px; }
.ranking-row__meta {
  font-size: 0.72rem;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-row__score {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1a1a2e;
  background: #f4f5f7;
  border-radius: 50px;
  padding: 6px 12px;
  white-space: nowrap;
}
.ranking-row--top3 .ranking-row__score {
  background: rgba(22,163,74,0.12);
  color: #16a34a;
}

/* ── TABLET / DESKTOP ── */
@media (min-width: 768px) {
  .ranking-wrapper { padding: 1.5rem 2rem 3rem; }
  .ranking-hero { padding: 2.4rem 2.5rem; }
  .ranking-hero-title { font-size: 1.9rem; }
  .ranking-hero-sub { font-size: 0.92rem; }
  .ranking-section { padding: 1.5rem 1.75rem; }
  .ranking-row {
    grid-template-columns: 32px 48px 1fr auto;
    gap: 14px;
    padding: 8px 10px;
  }
  .ranking-row__thumb { width: 48px; height: 48px; }
  .ranking-row__name { font-size: 0.92rem; }
  .ranking-row__score { font-size: 0.95rem; padding: 6px 12px; }
}

@media (min-width: 1024px) {
  .ranking-wrapper { padding: 1.5rem 3.5rem 3rem; }
}
