/* # Variables */
:root {
  --root-size: 16px;

  --app-width-main: 800px;
  --app-width-total: 1024px;

  --size-xxs: 0.0625rem;
  --size-xs: 0.25rem;
  --size-s: 1rem;
  --size-m: 2rem;
  --size-l: 4rem;

  --font-s: 0.8rem;
  --font-m: 1rem;
  --font-l: 1.2rem;

  --z-low: 10;
  --z-mid: 50;
  --z-high: 100;

  --max-width: 64rem;

  --line-size: 1px;
  --line-size-thick: var(--size-xs);
  --line-color: black;

  --color-gray-1: #ddd;
  --color-gray-5: #aaa;
  --color-gray-7: #999;
  --color-gray-8: #777;
  --color-gray-9: #333;
  --color-gray-10: #111;

  --color-warning-fg: black;
  --color-warning-bg: #ff9800;

  --color-blue: #5ab4bd;
  --color-green: #b5d63d;
  --color-green-9: #2b6300;
  --color-white: #fff;

  /* CUSTOM PALETTE */
  --rich-black-fogra-29: #001219ff;
  --blue-sapphire: #005f73ff;
  --viridian-green: #0a9396ff;
  --middle-blue-green: #94d2bdff;
  --medium-champagne: #e9d8a6ff;
  --gamboge: #ee9b00ff;
  --alloy-orange: #ca6702ff;
  --rust: #bb3e03ff;
  --rufous: #ae2012ff;
  --ruby-red: #9b2226ff;

  /* MDC overrides */
  --mdc-theme-primary: #353535;
  --mdc-typography-subtitle2-font-weight: 700;
}

/* # Basic */

html,
body {
  height: 100vh;
}

html {
  font-size: var(--root-size);
  font-family: sans-serif;
  color: black;
}

body {
  box-sizing: border-box;
  margin: 0;
  margin-bottom: 50px;
}

main {
  padding-bottom: var(--size-l);
}

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

a {
  color: inherit;
}

header {
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1;
  /* FIXME */
  padding: 0 42px 0 0;
}

header section {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

section {
  padding: var(--size-s);
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.3rem;
}

p {
  line-height: 1.3;
}

details {
  margin-bottom: var(--size-m);
}

summary {
  font-weight: bold;
  cursor: pointer;
}

form {
  margin-bottom: var(--size-m);
}

fieldset {
  border: var(--line-size) solid var(--line-color);
}

button,
select,
input,
.button {
  border: var(--line-size) solid var(--line-color);
  border-radius: var(--size-xs);
  padding: var(--size-xs) var(--size-xs);
  color: black;
  background-color: white;
  transition: box-shadow 0.2s;
  text-decoration: none;
  font-size: 1rem;
  align-items: flex-end;
  cursor: pointer;
}

button:hover,
select:hover,
input:hover,
.button:hover {
  box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
}

.medium {
  font-size: 1.5rem;
  padding: var(--size-xs) var(--size-s);
}

button.disabled,
.button:disabled {
  cursor: default;
  opacity: 0.5;
}

.buttons {
  display: flex;
}
.buttons .button:not(:last-child),
.buttons button:not(:last-child) {
  margin-right: var(--size-xs);
}

.small {
  font-size: var(--font-s);
  color: #666;
}

.small i {
  font-size: 1rem;
}

/* # Animations */

@keyframes blink {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* # Icons */
@font-face {
  font-display: block;
  font-family: "Material Icons";
  font-style: normal;
  font-weight: 400;
  src: url(fonts/material-icons.woff2) format("woff2");
}

i {
  font-family: "Material Icons";
  font-weight: normal;
  font-style: normal;
  font-size: inherit;
  vertical-align: top;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

button i,
.button i {
  font-size: 24px;
}

.icon {
  max-width: 12px;
}

i.medium {
  font-size: 28px;
}

.icon.medium {
  max-width: 20px;
}

p i,
p .icon {
  vertical-align: text-bottom;
}

/* # Sidebar */

:root {
  --sidebar-background-color: #f5f5f5;
  --sidebar-transition-duration: 0.3s;
  --sidebar-color-overlay: #000000aa;
  --sidebar-width: 224px;
}

aside {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: auto;
  z-index: 10;
  height: 100vh;
  background-color: var(--sidebar-background-color);
}

aside input[type="checkbox"] {
  display: none;
}

aside nav,
aside .overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transition: all var(--sidebar-transition-duration);
}

aside nav {
  transform: translateX(-100%);
  z-index: 100;
  width: var(--sidebar-width);
  overflow: auto;
  box-shadow: 1px 0 5px 0px #0000002e;
}

aside .overlay {
  z-index: 10;
  background-color: transparent;
  pointer-events: none;
}

aside input[type="checkbox"]:checked ~ nav {
  transform: translateX(0);
}

aside input[type="checkbox"]:checked ~ .overlay {
  background-color: var(--sidebar-color-overlay);
  pointer-events: auto;
}

label[for="sidebar--toggle"] {
  cursor: pointer;
  user-select: none;
  padding: var(--size-xs) var(--size-s);
  -webkit-tap-highlight-color: transparent;
}

@media screen and (min-width: 1024px) {
  main {
    margin-left: 224px;
  }
  aside nav {
    transform: translateX(0) !important;
  }
  label[for="sidebar--toggle"] {
    visibility: hidden;
  }
}

header {
  flex: 1 100%;
}

aside nav {
  width: var(--sidebar-width);
  background-color: var(--sidebar-background-color);
}

label[for="sidebar--toggle"] {
  font-size: 30px;
  font-weight: bold;
}

.CORE .runtime-error {
  z-index: 99999;
  background-color: black;
  color: white;
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
}

.CORE .runtime-error p {
  padding: var(--size-s);
  max-width: var(--max-width);
  margin: 0 auto;
}

.CORE .runtime-error strong {
  background-color: red;
  color: white;
  padding: var(--size-xs);
  font-weight: bold;
}

/* MDC wrong styles overrides (it seems they don't use var() everywhere) */

.mdc-floating-label {
  color: var(--mdc-theme-primary) !important;
}
