/* Gimnasia y Esgrima de Mendoza · Historiales (historiales.html)
   Usa los tokens y componentes de site.css; acá sólo lo propio de la página. */

.hist-controles { display: grid; gap: 18px; margin-bottom: 36px; }

.hist-pestanas { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 2px solid var(--tinta); }
.hist-pestanas button {
  background: transparent; color: var(--tinta); border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px;
  font: 800 clamp(1.05rem, 1.6vw, 1.35rem)/1 var(--display); text-transform: uppercase; letter-spacing: .05em;
  padding: 14px 16px 12px; cursor: pointer; min-height: 48px;
  transition: border-color var(--t-rapido) var(--ease), background-color var(--t-rapido) var(--ease);
}
.hist-pestanas button:first-child { padding-left: 0; }
.hist-pestanas button:hover { border-bottom-color: var(--gris-claro); }
.hist-pestanas button[aria-selected="true"] { border-bottom-color: var(--tinta); }

.hist-subs { display: flex; flex-wrap: wrap; gap: 8px; }
.hist-subs:empty { display: none; }
.hist-subs button {
  background: transparent; color: var(--tinta); border: 1px solid var(--linea); border-radius: 0;
  font: 600 .95rem/1 var(--texto); padding: 10px 14px; min-height: 42px; cursor: pointer;
}
.hist-subs button:hover { border-color: var(--tinta); }
.hist-subs button[aria-pressed="true"] { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }

.hist-fila { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; }
.hist-campo { display: grid; gap: 6px; font: 700 .8rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--gris); }
.hist-campo input, .hist-campo select {
  font: 500 1rem var(--texto); color: var(--tinta); background: var(--papel); letter-spacing: 0; text-transform: none;
  border: 0; border-bottom: 2px solid var(--tinta); border-radius: 0; padding: 10px 2px; min-height: 46px; min-width: min(280px, 100%);
}
.hist-campo select { padding-right: 24px; cursor: pointer; }
.hist-campo input[type="search"] { width: 20rem; max-width: 100%; }

.hist-cifras { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 12px; }
.hist-cifras .cifra b { font-size: clamp(2rem, 4.2vw, 3.6rem); }
/* El clásico va en media columna: tres cifras por fila para que «Ganó Independiente» no se pise. */
.hist-cifras--clasico { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hist-cifras--clasico .cifra:nth-child(3n) { border-right: 0; }
.hist-cifras--clasico .cifra:nth-child(3n+1) { padding-left: 0; }
.hist-cifras--clasico .cifra:nth-child(n+4) { border-top: 1px solid var(--linea); }
.hist-estado { font-size: .95rem; color: var(--gris); margin: 0 0 18px; }
.hist-titulo { font: 800 1.6rem/1 var(--display); text-transform: uppercase; margin: 0; padding-bottom: 14px; }

.hist-tabla th button {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.hist-tabla th button:focus-visible { outline: 3px solid var(--tinta); outline-offset: 3px; }
.hist-tabla th button::after { content: ""; width: 0; height: 0; border: 5px solid transparent; opacity: .3; }
.hist-tabla th[aria-sort="descending"] button::after { border-top-color: currentColor; border-bottom-width: 0; opacity: 1; }
.hist-tabla th[aria-sort="ascending"] button::after { border-bottom-color: currentColor; border-top-width: 0; opacity: 1; }
.hist-tabla th[aria-sort="none"] button::after { border-top-color: currentColor; border-bottom-width: 0; }
.hist-tabla abbr { text-decoration: none; }
.hist-tabla td.num, .hist-tabla th.num { padding-left: 12px; }
.hist-tabla tbody th small { display: block; font-weight: 400; font-size: .85rem; color: var(--gris); white-space: normal; max-width: 34ch; }
.hist-tabla tbody tr.hist-clasico th { font-weight: 800; }
.hist-tabla .asterisco { color: var(--gris); font-weight: 700; }
.hist-tabla tbody td:first-of-type { white-space: nowrap; }

.hist-cobertura { max-width: none; }
.hist-cobertura p { margin: 0 0 8px; }
.hist-cobertura ul { margin: 6px 0 0; padding-left: 18px; }

.hist-fuentes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.hist-fuente { border-top: 2px solid var(--tinta); padding: 18px 0 28px; }
.hist-fuente h3 { font: 800 1.5rem/1 var(--display); text-transform: uppercase; margin: 0 0 6px; }
.hist-fuente__dato { margin: 0 0 10px; font-weight: 600; }
.hist-fuente p { margin: 0 0 10px; }
.hist-fuente ul { margin: 0 0 10px; padding-left: 18px; font-size: .95rem; }
.hist-fuente details { font-size: .92rem; color: var(--gris); }
.hist-fuente summary { cursor: pointer; font-weight: 600; color: var(--tinta); padding: 6px 0; }
.hist-fuente details ol { list-style: none; padding: 0; margin: 8px 0 0; columns: 3 9ch; column-gap: 18px; }
.hist-fuente details li { break-inside: avoid; }

@media (max-width: 860px) {
  .hist-fuentes { grid-template-columns: minmax(0, 1fr); }
  .hist-cifras { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hist-cifras .cifra:nth-child(3n) { border-right: 0; }
  .hist-cifras .cifra:nth-child(3n+1) { padding-left: 0; }
  .hist-cifras .cifra:nth-child(n+4) { border-top: 1px solid var(--linea); }
}
@media (max-width: 620px) {
  .hist-pestanas { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .hist-pestanas button { white-space: nowrap; padding: 14px 12px 12px; }
  .hist-campo { width: 100%; }
  .hist-campo input, .hist-campo select { width: 100%; min-width: 0; }
  .hist-tabla table { min-width: 460px; }
  .hist-tabla tbody th { position: sticky; left: 0; background: var(--papel); z-index: 1; white-space: normal; min-width: 10.5em; }
  .hist-tabla thead th:first-child { position: sticky; left: 0; background: var(--papel); z-index: 2; }
}

/* Balance: ganados menos perdidos. Verde si Gimnasia ganó más, rojo si perdió más. */
.hist-bal { font-weight: 800; }
.hist-bal--pos { color: #1f7a3a; }
.hist-bal--neg { color: #b3261e; }
