/* HELPER CLASSES */

.uppercase {
  text-transform: uppercase;
}

.select-navigation {
  margin-bottom: 26px;
}

main {
  margin: 0 auto;
  max-width: 1200px;
  padding: 20px;
}

section {
  padding-bottom: 40px;
}

h1, h2, h3 {
  font-family: 'Oswald';
  margin-bottom: 20px;
}

/* COMMON TABLE STYLES */
table.dataTable {
  border-spacing: 20px;
  border-collapse: collapse;
  font-family: 'Open Sans';
}

table.dataTable,
table.dataTable > thead > tr > th,
table.dataTable > thead > tr > td {
  border-bottom: none !important;
}

table.dataTable th {
  font-weight: 600 !important;
  background: #542869;
  color: white;
}

table.dataTable td {
  background: #efefef;
  vertical-align: middle;
}


table.dataTable td[data-cell="Parti"] {
    background-color: var(--party-color);
}

table.dataTable td[data-cell="Party"] {
    background-color: var(--party-color);
}

    
/* COMMON MOBILE TABLE STYLES */
@media (max-width: 650px) {
  table.dataTable {
	border-collapse: separate;
  }

  table.dataTable th {
    display: none;
  }

  table.dataTable td {
    display: grid;
    grid-template-columns: 20ch auto;
    text-align: left !important;
    border: none;
  }

  table.dataTable td[data-cell="Parti"] {
	 background-color: #efefef !important;
  }
  
  table.dataTable td[data-cell="Party"] {
	 background-color: #efefef !important;
  }

  table.dataTable td::before {
    content: attr(data-cell) ': ';
    background-color: #efefef;
    font-weight: 700;
    text-transform: capitalize;
  }
  
  table.dataTable td::after {
    content: '';
    background-color: var(--party-color);
  }
  
  table.dataTable tr:first-child {
    padding-bottom: 5px;
  }
}

/* RESULTS BY DIVISION TABLE */

#resultsByDivision td:first-child a {
  color: #39b29f;
}

.party-color-block {
  overflow: hidden;
  white-space: nowrap;
  height: 100%;
  @media (max-width: 650px) {
    max-width: 50px;
  }
}

.party-color-block.pc {
  background: #364baf;
  color: #364baf;
}

.party-color-block.ndp {
  background: #e6722b;
  color: #e6722b;
}

.party-color-block.liberal {
  background: #cc0000;
  color: #cc0000;
}

.party-color-block.na {
  background: #c9c9c9;
  color: #c9c9c9;
}

/* ELECTED TABLE CELL */

table.dataTable td.elected {
  padding: 0;
  height: 1px;
}

table.dataTable td.elected > div {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: black;
  color: white;
  text-align: center;
  height: 100%;
}

@media (max-width: 650px) {
  table.dataTable td.elected {
    padding: 8px 10px;
    height: auto;
  }
}

/* BUTTONS */
.btn-results {
  display: inline-block;
  font-family: "Open Sans";
  text-transform: uppercase;
  text-decoration: none;
  color: white;
  padding: 5px 30px;
  margin-bottom: 5px;
}

@media (max-width: 450px) {
  .btn-results {
  	display: block;
  	text-align: center;
  	padding: 10px 20px;
  }
}

.btn-results.overall {
  background: #edc65d;
}

.btn-results.division {
  background: #535654;
}

.chart-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.chart-group-item {
  display: flex;
  flex-direction: column;
  text-align: center;
  max-width: 250px;
  width: 100%;
}

h3 {
  width: 100%;
}

.chart-container {
  aspect-ratio: 1;
  width: 100%;
  position: relative;
}
