/* Periodic-table-only styles.
   Load AFTER /style/wdmstyle.css. */

.periodic-table-page {
  overflow: visible;
}

.periodic-table-page__related-links {
  margin: 0 0 1rem 1.25rem;
}

.periodic-table-page__related-links li + li {
  margin-top: 0.45rem;
}

.periodic-table-wrapper {
  max-width: 100%;
  overflow-x: visible;
}

.periodic {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 200px;
  margin-right: 0;
  text-shadow: none;
}

.periodic-row {
  clear: both;
  height: 12.5%;
}

.cell {
  float: left;
  position: relative;
  width: 5.555555%;
  height: 100%;
}

.cell--empty {
  pointer-events: none;
}

.element {
  position: absolute;
  top: 0;
  left: 0;
  right: 1px;
  bottom: 1px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-color: rgba(0, 128, 128, 0.82);
  text-align: center;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.45);
}

.cell:hover .element,
.cell:focus-within .element {
  z-index: 1;
  border-color: rgba(0, 0, 0, 0.18);
  background-color: rgba(0, 128, 128, 0.96);
}

.at_num,
.at_details {
  position: absolute;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
}

.at_num {
  top: 4px;
  right: 5px;
  font-size: 0.72rem;
  line-height: 1;
}

.symbol {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  margin-top: -0.5rem;
  font-size: 0.9rem;
  line-height: 1;
  height: 1rem;
}

.periodic-table__link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.periodic-table__link:hover,
.periodic-table__link:focus {
  text-decoration: underline;
}

.periodic-table__link:focus-visible {
  outline: 3px solid #ffb81c;
  outline-offset: 2px;
}

.at_details {
  left: 0;
  right: 0;
  bottom: 4px;
  font-size: 0.58rem;
  line-height: 1.2;
}

.cell:nth-child(-n+2) .element,
.cell:nth-child(n+13) .element {
  background-color: rgba(0, 160, 96, 0.82);
}

.cell:nth-child(1) .element,
.periodic-row:nth-child(2) .cell:nth-child(n+14) .element,
.periodic-row:nth-child(3) .cell:nth-child(n+15) .element,
.periodic-row:nth-child(4) .cell:nth-child(n+16) .element,
.periodic-row:nth-child(5) .cell:nth-child(n+17) .element {
  background-color: rgba(0, 192, 64, 0.82);
}

.periodic-row:nth-child(-n+6) .cell:nth-child(18) .element {
  background-color: rgba(64, 192, 0, 0.82);
}

.periodic-row:nth-child(n+8) .element {
  background-color: rgba(0, 96, 160, 0.82);
}

.cell:nth-child(-n+2):hover .element,
.cell:nth-child(-n+2):focus-within .element,
.cell:nth-child(n+13):hover .element,
.cell:nth-child(n+13):focus-within .element {
  background-color: rgba(0, 160, 96, 0.96);
}

.cell:nth-child(1):hover .element,
.cell:nth-child(1):focus-within .element,
.periodic-row:nth-child(2) .cell:nth-child(n+14):hover .element,
.periodic-row:nth-child(2) .cell:nth-child(n+14):focus-within .element,
.periodic-row:nth-child(3) .cell:nth-child(n+15):hover .element,
.periodic-row:nth-child(3) .cell:nth-child(n+15):focus-within .element,
.periodic-row:nth-child(4) .cell:nth-child(n+16):hover .element,
.periodic-row:nth-child(4) .cell:nth-child(n+16):focus-within .element,
.periodic-row:nth-child(5) .cell:nth-child(n+17):hover .element,
.periodic-row:nth-child(5) .cell:nth-child(n+17):focus-within .element {
  background-color: rgba(0, 192, 64, 0.96);
}

.periodic-row:nth-child(-n+6) .cell:nth-child(18):hover .element,
.periodic-row:nth-child(-n+6) .cell:nth-child(18):focus-within .element {
  background-color: rgba(64, 192, 0, 0.96);
}

.periodic-row:nth-child(n+8) .cell:hover .element,
.periodic-row:nth-child(n+8) .cell:focus-within .element {
  background-color: rgba(0, 96, 160, 0.96);
}

@media (max-width: 599px) {
  .periodic {
    height: 260px;
  }

  .element {
    right: 1px;
    bottom: 1px;
  }

  .symbol {
    font-size: clamp(0.6rem, 1.8vw, 0.9rem);
  }
}

@media (min-width: 600px) {
  .periodic {
    height: 460px;
    margin-right: 0;
  }

  .element {
    right: 2px;
    bottom: 2px;
  }

  .at_num,
  .at_details {
    opacity: 1;
  }

  .symbol {
    margin-top: -17px;
    font-size: 16px;
    line-height: 30px;
    height: 30px;
  }

  .at_details {
    font-size: 0.8vw;
  }
}

@media (min-width: 800px) {
  .periodic {
    height: 540px;
  }

  .symbol {
    font-size: 20px;
  }
}

@media (min-width: 992px) {
  .periodic {
    height: 680px;
  }

  .at_num,
  .at_details {
    font-size: 0.8vw;
  }

  .symbol {
    font-size: 24px;
  }
}

@media (min-width: 1200px) {
  .periodic {
    height: 800px;
  }

  .symbol {
    font-size: 30px;
  }
}
