:root {
  --blue-font-color: rgb(54, 96, 146);
  --red-font-color: rgb(192, 0, 0);
  --grey-bg-color: rgb(248, 248, 248);
}

/* ##### Global reset ##### */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* ##### Main Elements ##### */
body {
  text-align: center;
}

header,
footer {
  background-color: var(--grey-bg-color);
}

header {
  margin-bottom: 20px;
  padding: 10px;
}

.warning {
  color: red;
  font-size: 22px;
  font-weight: bold;
  text-decoration: underline;
  margin-bottom: 20px;
}

main {
  margin-bottom: 20px;
  padding: 0 20px;
}

footer {
  padding: 20px;
}

/* ##### Smaller Elements ##### */
.grid-container {
  margin: 0 auto;
  max-width: 400px;
  display: grid;
  grid-template-columns: 40px 1fr;
  border-right: 1px solid black;
  border-bottom: 1px solid black;
}

.cell {
  border-top: 1px solid black;
  border-left: 1px solid black;
}

.title-1,
.title-2 {
  color: rgb(192, 0, 0);
}

.title-1 {
  font-size: 20px;
  font-weight: bold;
}

.title-2 {
  margin-bottom: 20px;
}

.cell h3 {
  height: 100%;
}

.cell._A {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
  font-size: 90%;
  font-weight: 600;
  color: rgb(80, 80, 80);
}

/* ##### Links ##### */
.calc-link {
  display: flex;
  justify-content: left;
  align-items: center;
  padding: 4px 2px 4px 8px;
}

.calc-link:link,
.calc-link:visited {
  color: var(--blue-font-color);
  font-size: 18px;
  text-decoration: none;
}

.calc-link:hover,
.calc-link:active {
  text-decoration: underline;
}

.footer-link:link,
.footer-link:visited {
  color: var(--blue-font-color);
  font-size: 18px;
  text-decoration: underline;
  font-weight: bold;
}

.footer-link:hover,
.footer-link:active {
  text-decoration: none;
}

.not-active:link,
.not-active:visited {
  color: grey;
  pointer-events: none;
}

.not-active:hover,
.not-active:active {
  text-decoration: none;
}

/* ##### QUERIES ##### */
@media (hover: none) {
  .calc-link:active {
    text-decoration: underline;
  }

  .footer-link:active {
    text-decoration: none;
  }

  .not-active:active {
    text-decoration: none;
  }
}

@media (max-width: 340px) {
  .grid-container {
    grid-template-columns: 1fr;
  }

  .cell._A {
    padding: 0;
  }

  .cell._B {
    border-top: none;
  }

  .calc-link {
    justify-content: center;
    padding: 0 2px 2px;
  }
}

@media (max-width: 220px) {
  main {
    margin-bottom: 20px;
    padding: 0 10px;
  }
}
