/* Fonts */

/* Trade Gothic */
@font-face {
  font-weight: bold;
  font-family: "Trade Gothic";
  font-style: normal;
  src: url("fonts/TradeGothic.woff2") format("woff2");
  font-display: swap;
}

/* Helvetica Neue Regular */

@font-face {
  font-family: "Helvetica Neue";
  src: url("fonts/HelveticaNeue.woff2") format("woff2");
  font-display: swap;
}

/* Root & Default override */

:root {
  --black: #161716;
  --white: #f7f7f7;
  --strong-grey: #6d6d6d;
}

::placeholder {
  color: var(--placeholder-color);
}

:focus {
  outline: .125rem solid var(--outline-color);
  outline-offset: .125rem;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: .125rem solid var(--outline-color);
  outline-offset: .125rem;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* HTML */

html {
  height: 100%;

  font-size: 16px;
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
}

/* Body */

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;

  color: var(--accent);
  font-family: "Trade Gothic", fantasy, Helvetica, sans-serif;

  background-color: var(--primay);
}

/* Keyboard Input element */

kbd {
  border: 1px solid var(--kbd-border);
  border-radius: .375rem;

  font: inherit;

  background-color: var(--kbd-bg);
  box-shadow: inset 0 -1px 0 var(--kbd-border);
}

.kbd-large {
  padding: .375rem 1.5rem; 
}

.kbd-default {
  padding: .375rem .75rem; 
}
/* Links */

a {
  text-decoration: none;
}

/* Header */

.header {
  padding: 0.625rem 1.5rem;
  border-bottom: .125rem solid var(--header-border);
}

.header__wrapper {
  display: flex;
  flex-flow: row;
  align-items: center;
  justify-content: space-between;
  max-width: calc(50vw + 5.75rem);

  font-size: 1.5rem;
  text-align: center;
}

@media (max-width: 480px) {
  .header__wrapper {
    max-width: none;
  }
}

/* Main */

.main {
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  padding: 1.25rem 1rem;
}

.main__input {
  display: flex;
  flex: none;
  flex-flow: row;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0;
}

.main__input-block {
  display: flex;
  flex-flow: row;
  gap: min(2vw, 1.25rem);
  justify-content: space-between;
  width: clamp(10rem, 100%, 40rem);
}

.main__output {
  display: flex;
  flex: 8 0 auto;
  flex-flow: column nowrap;
  align-items: center;
  justify-content: space-evenly;
  padding: .625rem;

  font-size: 1.25rem;
}

/* Footer */

.footer {
  padding: .625rem 1rem;

  background-color: var(--footer-bg);
}

.footer__wrapper {
  display: flex;
  flex-flow: row;
  flex-wrap: wrap;
  gap: min(2vh, 1.25rem);
  align-items: center;
  justify-content: center;
}

/* SVG */
.svg {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* Button */

.btn {
  padding: 0.675rem 1.15rem;
  border: none;
  border-radius: 1rem;

  color: var(--primay);
  font-size: 1rem;
  text-align: center;
  text-transform: uppercase;

  background-color: var(--button-bg);
  cursor: pointer;
}

.btn:hover {
  background-color: var(--button-bg-hover);
  outline-color: var(--button-bg-hover);
}

.btn:active {
  background-color: var(--strong-grey);
  outline-color: var(--strong-grey);
}

/* Input */

.input {
  flex-grow: 1;
  padding: 0 1rem;
  border: .125rem solid var(--accent);
  border-radius: 1rem;

  color: var(--accent);

  background-color: var(--primay);
}

/* Product */

.product-info {
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  justify-content: space-around;
}

/* TODO: change class names */
.subtitle {
  color: var(--strong-grey);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.title {
  padding-bottom: .625rem;

  font-size: 2.5rem;
  letter-spacing: .0625rem;
  text-transform: uppercase;
}

.sizes {
  display: flex;
  flex-flow: column nowrap;
  justify-content: space-between;
  max-width: 5.625rem;
}

.block {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  width: 5.625rem;
  margin: .25rem 0;
}

.low {
  fill: #ff2c7d;
}

.medium {
  fill: #f8d84f;
}

.high {
  fill: #3de716;
}

.na {
  fill: var(--product-na);
}

.oos {
  fill: var(--accent);
}

.error {
  color: red;
}

/* Switcher */

.switcher {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: none;
  border-radius: 16px;

  background-color: var(--strong-grey);
}

.switcher:focus-within {
  box-shadow: 0px 0px 0px 2px var(--white);
}

/* Switcher Label */

.switcher__label {
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

/* Switcher Radio */

.switcher__radio {
  position: absolute;

  -webkit-appearance: none;

  appearance: none;
}

.switcher__radio:checked {
  width: 28px;
  height: 28px;
  border-radius: 16px;
  
  background-color: var(--white);
  outline: none;
}

/* Switcher Icon */

.switcher__radio + .switcher__icon {
  filter: invert(1);
}

.switcher__radio:checked + .switcher__icon {
  filter: invert(0);
}
