/**
* CSS grid styling shared between individual contests' results tables
* and the top-level header of the table-of-tables
*/

// Set min widths so our columns line up across all results table down the page 
// Max-content serves as an escape hatch if absolutely needed to fit some content
$votes-min-width-m: 4.313rem; ;
$votes-min-width-l: 5.875rem;
$pct-min-width-s: 3.5rem; 
$pct-min-width-m: 3.5rem;
$pct-min-width-l: 4.25rem;

.grid {
  display: grid; 
  grid-template-columns: 1fr  minmax($pct-min-width-s, max-content);

  &.medium {
    grid-template-columns: 1fr minmax($votes-min-width-m, max-content) minmax($pct-min-width-m, max-content);
  }

  &.large {
    grid-template-columns: 1fr minmax($votes-min-width-l, max-content) minmax($pct-min-width-l, max-content);
  }

  &.uncontested {
    grid-template-columns: 1fr minmax($pct-min-width-s, max-content);

    &.large {
      grid-template-columns: 1fr minmax($pct-min-width-l, max-content);
    }
  }

  div[role="rowgroup"],
  div[role="row"] {
    display: contents;
  }
}