:root {
  --color-content-background: #1A1A1A;
  --color-content-background-second: #222;
  --color-content-background-third: #333;
  --color-border: #aaa;
  --color-invert-background: #fff;
}

body {
  margin: 0;
  background-color: black;
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

body > div.main {
  margin: 0 auto;
  background-color: var(--color-content-background);
  max-width: 80em;
  width: 100%;
}

div.main .content {
  padding: 0 2em 1em;
  overflow: hidden;
}

.content img {
  max-width: 100%;
  min-width: 0; /* allow shrinking */
}

.content .content-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0em;
}

div.main .content .wide {
  width: 100%;
}

a {
  text-decoration: none;
  color: red;
}

.link-set a {
  color: inherit;
}

.link-set a:hover {
  color: red;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-style: normal;
}

a h1, a h2, a h3 {
  color: white;
}

p, li, td, th {
  color: #eee;
  line-height: 1.4;
}

.main .content ul li {
  margin-bottom: 0.5em;
}

pre {
  overflow: auto;
  background-color: var(--color-content-background-third);
  line-height: 1.2; /* ensure line drawing characters are displayed without vertical gaps */
  padding: 1em;
}

table {
  border-collapse: collapse;
  background-color: var(--color-content-background-third);
}

button {
  margin-right: 0.2em;
  margin-bottom: 0.2em;
  padding: 0.4em 0.6em;
  border-radius: 6px;
  border: 1px solid white;
  font-size: 1em;
  cursor: pointer;
  background-color: transparent;
  backdrop-filter: blur(20px);
  color: white;
}

button.primary {
  border-width: 2px;
}

.invert {
  background-color: var(--color-invert-background);
  color: black;
}

.invert p {
  color: black;
}

.invert button {
  color: black;
  border-color: black;
}

button:hover {
  border-color: red;
}

button.primary:hover {
  border-color: red;
  box-shadow: 0 0 5px red;
}

.horizontal-separator {
  border-bottom: 5px solid var(--color-border);
}

.horizontal-separator:last-of-type {
  border-bottom: none;
}

/* Menubar */

.menubar {
  display: flex;
  justify-content: center;
  background-color: transparent;
  height: 3em;
  margin: 2em auto;
  width: 95%;
  max-width: 80em;
  color: white;
}

#mobile-menu a,
.menubar a {
  color: unset;
}

.whitespace {
  flex-grow: 1;
}

.menu {
  font-family: "Space Mono", monospace;
  font-weight: 400;
  color: white;
  font-size: 1.1em;
  padding: 0;
  margin-right: 2em; /* Some space on the right to ensure the rightmost dropdown has enough space. */
}

.menu li {
  list-style-type: none;
}

.menu > li {
  padding: 0 1em;
  display: inline-block;
}

.menu > li:first-child {
  padding: 0 1em 0 0;
}

#logo-modern {
  /* margin: 0.5em 20% 0 0em; */
  margin: 0.5em 0;
  max-height: 2em;
}

#logo-modern:hover {
  cursor: pointer;
}

.navicon {
  display: none;
}

@media only screen and (max-width: 1000px) {
  .menu > li {
    padding: 0 0.5em;
  }

  .menu > li:first-child {
    padding: 0;
  }
}

@media only screen and (max-width: 900px) {
  .menu a {
    display: none;
  }

  .navicon {
    display: inline;
    color: white;
  }
}

/* Menu */

.menu .menu-link {
  position: relative;
}

.menu .menu-link .menu-link:hover > a {
  color: red;
}

/* Don't highlight the top-level menu item on desktop */
#mobile-menu ul li.current > a,
.menu ul .menu-link.current > a {
  border-bottom: 1px solid white;
}

#mobile-menu li > a > i.weak,
.menu .menu-link > a > i.weak {
  color: #666;
}

#mobile-menu li > a > i,
.menu .menu-link > a > i {
  margin-left: 0.2em;
}

#mobile-menu li:hover > a > i.weak,
.menu .menu-link:hover > a > i.weak {
  color: unset;
}

#mobile-menu ul button:hover {
  background-color: unset;
}

.menu-list {
  position: absolute;
  display: none;
  z-index: 7;
  padding: 0;
  background-color: var(--color-content-background);
  border-radius: 10px;
}

.menu-list li a {
  white-space: pre;
}

.menu-link:hover > .menu-list {
  display: block;
  box-shadow: 0px 2px 5px black;
}

.menu-list li {
  padding: 0.8em 1.2em;
  position: relative;
}

.menu-list li .menu-list {
  position: absolute;
  top: 0;
  left: 100%;
}

#mobile-menu {
  font-family: "Space Mono", monospace;
  font-weight: 400;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  width: 100%;
  height: 100%;
  display: none;
  z-index: 7;
  color: white;
  overflow-y: auto;
}

#mobile-menu a:hover {
  color: red;
}

#mobile-menu ul {
  list-style: none;
}

#mobile-menu.show, #mobile-menu .show {
  display: block;
}

#mobile-menu .close-btn {
  all: unset;
  font-size: 4rem;
  line-height: 1;
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
}

#mobile-menu .mobile-root {
  font-size: 2rem;
  line-height: 1.8;
}

#mobile-menu .mobile-submenu {
  font-size: 85%;
}

.mobile-submenu-toggle {
  all: unset;
  cursor: pointer;
  margin-left: 0.5rem;
}

.mobile-submenu {
  display: none;
}

.mobile-submenu-toggle i {
  transition: transform .25s;
}

.mobile-submenu.show ~ .mobile-submenu-toggle i,
.mobile-submenu-toggle.open i {
  transform: rotate(180deg);
}

/* Forum integration -- style the HTML fetched from the forum correctly. */
.quote, .onebox {
  padding: 1em;
  border-radius: 6px;
  border: 1px solid #888;
  background-color: var(--color-content-background-third);
}

.onebox .source {
  display: none;
}

.onebox .thumbnail {
  max-height: 8em;
}

.onebox h1,
.onebox h2,
.onebox h3,
.onebox h4 {
  font-family: inherit;
}

/* Footer */
#footer {
  display: flex;
  justify-content: space-between;
  color: white;
  margin: 3em auto 0 auto;
  width: 90%;
  max-width: 80em;
  gap: 2em;
  padding: 1em;
}

/* Footer logo: pin to its original size; the source bitmap is 4096px wide. */
#address img {
  width: 186px;
  height: auto;
}

#contact {
  margin-top: -1em;
}

#contact img {
  padding: 0.3em;
}

#partners {
  margin-top: -1em;
}

#partners h4 {
  margin-bottom: 0em;
}

#partners img {
  padding: 0.5em 0.5em;
}

#contact a {
  color: white;
}

.mobile-only {
  display: none;
}

@media only screen and (max-width: 900px) {
  #footer {
    flex-wrap: wrap-reverse;
  }

  .mobile-only {
    display: inline;
  }
}

