/* Global variables. */
:root {
  /* Set sans-serif & mono fonts */
  --sans-font: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir,
    "Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica,
    "Helvetica Neue", sans-serif;
  --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  --standard-border-radius: 5px;
  --border-width: 1px;

  /* Default (light) theme */
  --bg: #fff;
  --accent-bg: #F5F7FF;
  --header-bg: #5BA1AD;
  --stats-table-header-bg: #78DCFF;
  --stats-table-totals-bg: #AEEAFF;
  --text: #212121;
  --text-light: #585858;
  --border: #898EA4;
  --accent: #0d47a1;
  --accent-hover: #1266e2;
  --accent-text: var(--bg);
  --code: #d81b60;
  --preformatted: #444;
  --marked: #ffdd33;
  --disabled: #efefef;
}

/* global font settings */
html {
  font-family: var(--sans-font);
  scroll-behavior: smooth;
}


/* Make the body a nice central block 
  grid-template-columns controls the width of the page
  font-size: 1.15rem;
 */
body {
  line-height: 1.5;
  display: grid;
  grid-template-columns: 1fr min(65rem, 90%) 1fr;
  margin: 0;
}
body > * {
  grid-column: 2;
}

/* Format headers */
h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2.6rem;
  margin-top: 3rem;
}

h3 {
  font-size: 2rem;
  margin-top: 3rem;
}

h4 {
  font-size: 1.44rem;
}

h5 {
  font-size: 1.15rem;
}

h6 {
  font-size: 0.96rem;
}

p {
  margin: 1.5rem 0;
}

/* Make the header bg full width, but the content inline with body */
header {
  background-color: var(--header-bg);
  border-bottom: var(--border-width) solid var(--border);
/*  text-align: center; */
  padding: 0.5rem 0.5rem 1.0rem 0.5rem;
  grid-column: 1 / -1;
}

header h1 {
  max-width: 1200px;
  margin: 1rem auto;
}

header h3 {
  font-size: 1.0rem;
  margin: 1.3rem;
}

header p {
  font-size: 0.85rem;
  margin: 0.5rem;
}


footer {
  margin-top: 4rem;
  padding: 2rem 1rem 1.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: center;
  border-top: var(--border-width) solid var(--border);
  background-color: var(--accent-bg);
}

/* Format links & buttons */
a,
a:visited {
  color: var(--accent);
}

a:hover {
  text-decoration: none;
}

button,
.button,
a.button, /* extra specificity to override a */
input[type="submit"],
input[type="reset"],
input[type="button"] {
  border: var(--border-width) solid var(--accent);
  background-color: var(--accent);
  color: var(--accent-text);
  padding: 0.5em;
  text-decoration: none;
  line-height: normal;
}

.button[aria-disabled="true"], 
input:disabled,
textarea:disabled,
select:disabled,
button[disabled] {
  cursor: not-allowed;
  background-color: var(--disabled);
  border-color: var(--disabled);
  color: var(--text-light);
}

input[type="range"] {
  padding: 0;
}

/* Format tables */
table {
  border-collapse: collapse;
  margin: 1.5rem 0;
}

table.noborder {
  border: 0px hidden var(--border);
  /*border-collapse: collapse;
  margin: 1.5rem 0;*/
}

table.stats {
  border-collapse: collapse;
  font-size: 0.85rem;
}

/* table rows */
tr:nth-child(even) {
  /* Set every other cell slightly darker. Improves readability. */
  background-color: var(--accent-bg);
}

tr.nostripe {
  background-color: var(--bg);
}

table.stats tr {
  background-color: var(--bg);
}

/* table cells */
td {
  border: var(--border-width) solid var(--border);
  text-align: start;
  padding: 0.3rem;
}
th {
  background-color: var(--accent-bg);
  font-weight: bold;
}

td.noborder, th.noborder {
  border: 0px hidden var(--border);
  text-align: start;
  padding: 0.15rem 0.5rem;
}	

table.stats th {
  background-color: var(--stats-table-header-bg);
  font-weight: bold;
  padding: 0.1em 0.25em;
  text-align: center;
}

table.stats td {
  padding: 0.1em 0.25em;
  text-align: right;
}

table.standings tr :nth-child(2),
table.standings tr :nth-child(3), 
table.leaders tr :nth-child(2),
table.leaders tr :nth-child(3), 
table.team tr :nth-child(1),
table.team tr :nth-child(2) {
  text-align: left;
}

table.team tr.totals :nth-child(2) {
  text-align: right;
}

table.fieldingleaders tr > th + td,
table.fieldingleaders tr > th + td + td,
table.player tr > th > th + td,
table.player tr > th + td,
table.playerfielding tr > th > th + td,
table.playerfielding tr > th + td,
table.fielding tr > th,
table.fielding tr > th + th,
table.fielding tr > th + th + td,
table.fielding tr > th + td {
  text-align: left;
}

table.fielding tbody tr > th:not([rowspan]), 
table.fielding tbody tr > th + th {
  background-color: var(--bg);
  font-weight: normal;
}

table.stats tr.totals td {
  background-color: var(--stats-table-totals-bg);
  font-weight: bold;
  padding: 0.1em 0.25em;
}

table.player tr.totals :nth-child(3) {
  text-align: right;
}

table caption {
  font-weight: bold;
  margin-bottom: 0.5rem;
}
