/* ═══ Ficha de club (club.php) y de escuela (escuela.php) ═══
   Sacado del <style> de club.php para compartirlo. Carga después de
   torneo.css, así que gana por orden a igual especificidad (ver las
   notas de .cd-table). */
/* ── Ficha de club ──────────────────────────────────────────── */
.cd-page { padding-bottom: 4rem; }

.cd-hero {
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-left: 4px solid var(--tp-gold);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.5rem;
}
.cd-hero h1 { margin: 0 0 .2rem; font-family: Georgia, serif; font-size: 1.9rem; line-height: 1.15; }
.cd-hero-muni { font-size: .85rem; color: var(--tp-dim); }

/* Logo + nombre. Caja fija con `object-fit: contain` porque los logos vienen
   con proporciones distintas; los clubes sin archivo caen en el monograma. */
.cd-hero-top { display: flex; align-items: center; gap: 1.1rem; }
.cd-logo {
  flex: 0 0 auto;
  width: 5rem; height: 5rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--tp-border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.cd-logo img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 4px; box-sizing: border-box; }
.cd-logo.is-ph {
  background: var(--tp-soft);
  color: var(--tp-dim);
  font-family: Georgia, serif; font-size: 1.5rem; font-weight: 700;
}

/* Información que carga el editor del club (clubes_info) */
.cd-info { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--tp-border); }
.cd-desc { margin: 0 0 .9rem; line-height: 1.6; max-width: 75ch; }
.cd-desc:last-child { margin-bottom: 0; }
.cd-contacto { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 2rem; }
.cd-contacto li { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.cd-contacto a { color: var(--tp-ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.cd-contacto a:hover { color: var(--tp-gold); text-decoration: underline; }
.cd-contacto-lbl { font-size: .64rem; text-transform: uppercase; letter-spacing: .07em;
                   color: var(--tp-dim); font-weight: 700; }

.cd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--tp-border);
}
.cd-stat-val { font-size: 1.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-stat-lbl { font-size: .64rem; text-transform: uppercase; letter-spacing: .07em;
               color: var(--tp-dim); font-weight: 700; margin-top: .1rem; }

.cd-orden { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: .9rem; }
.cd-orden-lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
                color: var(--tp-dim); font-weight: 700; margin-right: .2rem; }
.cd-orden a {
  padding: .3rem .7rem;
  border: 1px solid var(--tp-border);
  background: var(--tp-surface);
  border-radius: 999px;
  text-decoration: none;
  color: var(--tp-dim);
  font-size: .78rem;
  font-weight: 600;
}
.cd-orden a:hover { border-color: var(--tp-gold); color: var(--tp-ink); }
.cd-orden a.is-active { background: var(--tp-ink); border-color: var(--tp-ink); color: #fff; }

.cd-pos { color: var(--tp-dim); font-variant-numeric: tabular-nums; }
/* El AAPP ID no debe partirse: con la columna estrecha se rompía en tres
   líneas y disparaba el alto de todas las filas. */
.cd-table td:nth-child(3) { white-space: nowrap; font-size: .8rem; }
.cd-nombre { font-weight: 600; }
.cd-tit {
  font-size: .66rem; font-weight: 700; padding: .05rem .35rem;
  border-radius: 3px; background: var(--tp-gold); color: #1c1c1b; margin-left: .35rem;
}
.cd-tit-aapp { background: #e8e5dc; color: #4a4638; }

/* Desde 781px la tabla se agranda: son una decena de filas en una pantalla
   vacía, no los pareos densos de un torneo para los que está calibrada
   `.tp-table`. Empata en especificidad con `.tp-table th|td` y gana por orden
   (este <style> va después del <link> de torneo.css). */
@media (min-width: 781px) {
  .cd-table { font-size: 1rem; }
  .cd-table th,
  .cd-table td { padding: .95rem 1.1rem; }
  /* Cabeceras: se suben a .86rem y se aprieta el letter-spacing para que el
     texto más grande no ensanche las columnas. */
  .cd-table thead th {
    font-size: .86rem;
    letter-spacing: .045em;
    font-weight: 700;
    color: var(--tp-ink);
  }
  .cd-table .cd-nombre { font-family: Georgia, serif; font-size: 1.12rem; font-weight: 700; }
  .cd-table .cd-pos { font-size: 1rem; }
  .cd-table td:nth-child(3) { font-size: .92rem; }
  .cd-table td:nth-child(4) { font-size: .95rem; }
  /* Los tres ratings son el dato que se viene a leer */
  .cd-table td:nth-child(5),
  .cd-table td:nth-child(6),
  .cd-table td:nth-child(7) {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
  }
  /* El guion de "sin rating" no debe crecer con el número */
  .cd-table td:nth-child(5) .tp-muted,
  .cd-table td:nth-child(6) .tp-muted,
  .cd-table td:nth-child(7) .tp-muted { font-size: .95rem; font-weight: 400; }
  .cd-table td:nth-child(8) { font-size: .85rem; }
  .cd-tit { font-size: .78rem; padding: .1rem .45rem; }
  .cd-logo { width: 6.5rem; height: 6.5rem; }
  .cd-logo.is-ph { font-size: 2rem; }
}

.cd-id-m { display: none; }

@media (max-width: 620px) {
  .cd-hero h1 { font-size: 1.45rem; }
  .cd-hero-top { gap: .85rem; }
  .cd-logo { width: 3.6rem; height: 3.6rem; border-radius: 10px; }
  .cd-logo.is-ph { font-size: 1.1rem; }
  /* En móvil no caben 8 columnas: fuera FED y el AAPP ID (que pasa debajo
     del nombre), y de los tres ratings sólo el de la pestaña elegida
     (por apellido, blitz: es la modalidad con más actividad). */
  .cd-table th:nth-child(3), .cd-table td:nth-child(3),
  .cd-table th:nth-child(4), .cd-table td:nth-child(4),
  .cd-table.cd-mod-blitz   th:is(:nth-child(5), :nth-child(6)),
  .cd-table.cd-mod-blitz   td:is(:nth-child(5), :nth-child(6)),
  .cd-table.cd-mod-rapido  th:is(:nth-child(5), :nth-child(7)),
  .cd-table.cd-mod-rapido  td:is(:nth-child(5), :nth-child(7)),
  .cd-table.cd-mod-clasico th:is(:nth-child(6), :nth-child(7)),
  .cd-table.cd-mod-clasico td:is(:nth-child(6), :nth-child(7)) { display: none; }
  .cd-id-m { display: block; font-size: .72rem; color: var(--tp-dim); margin-top: .1rem; }
  .cd-table td:nth-child(5), .cd-table td:nth-child(6), .cd-table td:nth-child(7) {
    font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .cd-table td:nth-child(8) { font-size: .72rem; }
}

/* ── Sólo escuela.php ───────────────────────────────────────────── */
.cd-hero-kicker {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--tp-dim); font-weight: 700; margin-bottom: .15rem;
}
.cd-h2 { font-family: Georgia, serif; font-size: 1.35rem; margin: 2rem 0 .8rem; }

/* Club del alumno, debajo del nombre: es otra afiliación, no la principal. */
.cd-alumno-club { display: block; font-size: .74rem; color: var(--tp-dim); margin-top: .1rem; }
.cd-alumno-club a { color: inherit; }
.cd-alumno-club a:hover { color: var(--tp-gold-dk); }

/* Tabla de torneos en los que la escuela presentó equipo */
.cd-part { width: 100%; }
.cd-part th.cd-part-num, .cd-part td.cd-part-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cd-part-fecha { display: block; font-size: .76rem; color: var(--tp-dim); margin-top: .1rem; }
.cd-part-pos {
  display: inline-block; min-width: 2.4rem; padding: .1rem .45rem;
  border: 1px solid var(--tp-border); border-radius: 6px;
  font-weight: 700; text-align: center;
}
.cd-part-de { display: block; font-size: .68rem; color: var(--tp-dim); margin-top: .1rem; }
/* Podio: mismos tonos que .jp-torneo-pos de jugador.php */
.cd-part-pos.cd-pos-1 { border-color: #c9a227; background: rgba(201,162,39,.12); color: #a8841a; }
.cd-part-pos.cd-pos-2 { border-color: #9aa3ad; background: rgba(154,163,173,.14); }
.cd-part-pos.cd-pos-3 { border-color: #b87333; background: rgba(184,115,51,.12); color: #9a5d27; }

@media (min-width: 781px) {
  .cd-part { font-size: 1rem; }
  .cd-part th, .cd-part td { padding: .9rem 1.1rem; }
  .cd-part thead th { font-size: .86rem; letter-spacing: .045em; font-weight: 700; color: var(--tp-ink); }
}
@media (max-width: 620px) {
  /* Jugadores sobra en un teléfono */
  .cd-part th:nth-child(3), .cd-part td:nth-child(3) { display: none; }
}
