/* Stats page (design v3). Classes start with st-. Tokens come from styles.css. */

#st-app{min-height:70vh;padding-bottom:8px}

/* controls: Batting | Pitching, season (only when there is more than one), All columns */
.st-ctrl{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;margin-top:6px}
.st-ctrl [hidden]{display:none}
.st-season select{min-height:48px;padding:0 14px;font:600 1.0625rem/1 var(--body)}

.st-h2{margin-top:26px;font:700 1.6rem/1.15 var(--display)}
#st-empty{margin-top:18px}

/* table */
.st-scroll{max-width:100%;margin-top:12px;overflow-x:auto;border-block:2px dashed var(--line)}
.st-t{width:auto;min-width:100%;border-collapse:separate;border-spacing:0;font-size:1.0625rem;white-space:nowrap}
.st-t caption{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap} /* read by screen readers; shown in print */
.st-t th,.st-t td{padding:12px 10px;text-align:right;background:var(--bg)}
.st-t .st-l{text-align:left}
.st-t td{border-top:1px solid var(--line)}
.st-t tbody th{border-top:1px solid var(--line);font-weight:600}
.st-t tbody tr:first-child th,.st-t tbody tr:first-child td{border-top:0}
.st-t thead th{padding:0;border-bottom:2px solid var(--edge);color:var(--muted)}
.st-t thead button{display:flex;align-items:center;justify-content:flex-end;gap:4px;width:100%;min-height:48px;min-width:48px;padding:0 10px;border:0;background:transparent;color:inherit;font:600 1rem/1 var(--body);cursor:pointer}
.st-t thead .st-l button{justify-content:flex-start}
.st-t thead button:focus-visible{outline-offset:-4px}
.st-arr{display:inline-block;width:.9em;font-size:.7em;text-align:center}
.st-t thead th[aria-sort="ascending"] button,.st-t thead th[aria-sort="descending"] button{color:var(--ink)}
@media (hover:hover){.st-t thead button:hover{color:var(--ink)}}
.st-t tbody .st-s{color:var(--ink)}
.st-t .st-n{position:sticky;left:0;z-index:1;min-width:128px;box-shadow:1px 0 0 var(--line)}
.st-t thead .st-n{z-index:2}
.st-t tfoot th,.st-t tfoot td{border-top:2px solid var(--edge);background:var(--surface);font-weight:700}
.st-hint,.st-src{margin-top:10px;color:var(--muted);font-size:1rem}
.st-btns{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}

/* glossary */
.st-gloss{margin-top:28px;border-top:1px solid var(--line)}
.st-gloss summary{display:flex;align-items:center;justify-content:flex-start;gap:14px;min-height:56px;font:600 1.125rem/1.2 var(--body);cursor:pointer;list-style:none}
.st-gloss summary::-webkit-details-marker{display:none}
/* a visible arrow, so it reads as a drop-down: it points down when closed and up when open */
.st-gloss summary::after{content:"";flex:none;width:12px;height:12px;margin:-6px 0 0;border:solid var(--ink);border-width:0 3px 3px 0;transform:rotate(45deg);transition:transform .15s,margin .15s}
.st-gloss[open] summary::after{margin-top:6px;transform:rotate(-135deg)}
.st-gloss__g{display:grid;gap:8px 40px;padding-bottom:16px}
@media (min-width:800px){.st-gloss__g{grid-template-columns:1fr 1fr}}
.st-gloss h3{margin-bottom:8px;font:700 1.25rem/1.2 var(--display)}
.st-gloss dl{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0}
.st-gloss dt{font-weight:700}
.st-gloss dd{margin:0;color:var(--muted)}

/* print: shared tokens turn black on white; the table only */
@media print{
  @page{size:landscape;margin:12mm}
  .st-ctrl,.st-btns,.st-hint,.st-gloss,.sf-title .sf-sub,#st-nojs{display:none!important}
  #st-app{min-height:0}
  .sf-title{padding:0}
  .sf-title h1,.st-h2{font-size:16pt;margin:4pt 0;color:var(--ink)}
  .st-scroll{overflow:visible;border:0}
  .st-t{font-size:9pt;color:var(--ink)}
  .st-t caption{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto;white-space:normal;text-align:left;color:var(--ink);padding:0 0 4pt;caption-side:top}
  .st-t thead th,.st-t tbody th,.st-t tbody td,.st-t tfoot th,.st-t tfoot td{background:none!important;color:var(--ink)!important;box-shadow:none!important;padding:3pt 5pt;border-top:0.5pt solid var(--edge)}
  .st-t thead button{color:var(--ink)!important;min-height:0;padding:0;font-size:9pt;display:inline}
  .st-t thead th{border-bottom:1.5pt solid var(--ink)}
  .st-t tfoot th,.st-t tfoot td{border-top:1.5pt solid var(--ink);font-weight:700}
  .st-arr{display:none}
  .st-t .st-n{position:static}
}
