/* =============================================================================
   joomsport-brand.css — brand overrides para mod_js_table cuando renderea
   en position main-bottom (Nations League standings tables debajo del
   Mundialito en cada categoría /estadisticas/<cat>).

   Razón: joomsport.css tiene todos los estilos scopeados bajo
   #joomsport-container — ese ID solo existe cuando JoomSport renderea
   como COMPONENTE (?view=table). Cuando el mismo mod_js_table renderea
   como MÓDULO (jdoc:include name=main-bottom), no hay #joomsport-container
   wrapper — el módulo emite directo:

     <div class="moduletable">
       <h3>Nations League <cat></h3>
       <div class="jsmodtbl_responsive">
         <h2 class="groups">Grupo A</h2>
         <div class="table-responsive">
           <table class="table table-striped cansorttbl">…</table>
         </div>
         …
       </div>
     </div>

   Estas reglas mirrorean las de joomsport.css pero con .jsmodtbl_responsive
   como parent. Cargado DESPUÉS de joomsport.css en template/index.php
   (el ordering del <link> determina la cascade — el último wins en
   conflicto de specificity igual).
   ============================================================================= */

/* ---------- 1 · Module heading (Nations League <cat>) ---------- */
/* La position main-bottom usa style=xhtml → wrappea cada módulo en
   <div class="moduletable"> con <h3> del título. Solo aplica si el
   moduletable contiene un jsmodtbl_responsive (= es un mod_js_table). */
.moduletable:has(.jsmodtbl_responsive) > h3 {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(28px, 4vw, 40px);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--brand-blue, #1F3D8E);
  margin: 48px 0 24px;
}

/* ---------- 2 · h2.groups (Grupo A / Grupo B) ---------- */
.jsmodtbl_responsive h2.groups {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand-orange, #ED5A1F);
  padding: 0;
  margin: 28px 0 14px;
  border-bottom: 0;
}

/* ---------- 3 · Table responsive wrapper ---------- */
.jsmodtbl_responsive .table-responsive {
  padding: 0;
  margin-bottom: 32px;
  background: var(--white, #FFFFFF);
  border: 1px solid var(--line, #E5E2DC);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  .jsmodtbl_responsive .table-responsive {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  }
}

/* ---------- 4 · Table base ---------- */
.jsmodtbl_responsive table.cansorttbl {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: transparent;
}

/* Header */
.jsmodtbl_responsive table.cansorttbl thead th {
  background: var(--cream, #FAF7F2);
  padding: 14px 10px;
  border-bottom: 1px solid var(--line, #E5E2DC);
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #6B7280);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.jsmodtbl_responsive table.cansorttbl thead th[style*="left"] {
  text-align: left;
}

/* Reset Bootstrap striped + border default que JoomSport hereda */
.jsmodtbl_responsive .table-striped > tbody > tr:nth-of-type(odd) > td {
  background: transparent;
}
.jsmodtbl_responsive .table > tbody > tr > td,
.jsmodtbl_responsive .table > thead > tr > th {
  border-top: 0;
}

/* Body rows */
.jsmodtbl_responsive table.cansorttbl tbody tr {
  border-bottom: 1px solid var(--line, #E5E2DC);
  transition: background 0.15s;
}
.jsmodtbl_responsive table.cansorttbl tbody tr:hover {
  background: var(--blue-pale, #EDF0FA);
}
.jsmodtbl_responsive table.cansorttbl tbody tr:last-child {
  border-bottom: 0;
}

/* Cell defaults: mono numeric centered (mayoría de cols son stats) */
.jsmodtbl_responsive table.cansorttbl tbody td {
  padding: 14px 10px;
  vertical-align: middle;
  text-align: center;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  color: var(--ink-2, #2C3548);
}

/* Rank col (first col) — itálica brand-blue */
.jsmodtbl_responsive table.cansorttbl tbody td:first-child {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  color: var(--brand-blue, #1F3D8E);
  width: 56px;
  letter-spacing: -0.02em;
}
/* Top-of-group rank en orange */
.jsmodtbl_responsive table.cansorttbl tbody tr:first-child td:first-child {
  color: var(--brand-orange, #ED5A1F);
}

/* Team col (2nd col) — left aligned, regular text */
.jsmodtbl_responsive table.cansorttbl tbody td:nth-child(2) {
  text-align: left;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink, #0F172A);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.jsmodtbl_responsive table.cansorttbl tbody td:nth-child(2) a {
  color: inherit;
  text-decoration: none;
}
.jsmodtbl_responsive table.cansorttbl tbody td:nth-child(2) a:hover {
  color: var(--brand-orange, #ED5A1F);
}

/* Points col (last col) — bold italic brand-blue */
.jsmodtbl_responsive table.cansorttbl tbody td:last-child {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-weight: 800;
  font-style: italic;
  font-size: 18px;
  color: var(--brand-blue, #1F3D8E);
}
.jsmodtbl_responsive table.cansorttbl tbody tr:first-child td:last-child {
  color: var(--brand-orange, #ED5A1F);
}
