body {
  /* Borders */
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* prevent horizontal scrolling */

  /* Background */
  background-image: url("background.jpg");
  background-size:cover;
  background-position:top;
  background-attachment: fixed;

  /* Text */
  font-family: "body-font", serif;
  --font-size: clamp(16px, 5vw, 48px);
  font-size: var(--font-size);
  text-align: center;
  color: #ddd;
}

@font-face {
  font-family: "body-font";
  src: url("forum-regular.otf") format("opentype");
}

main {
  width: calc(100% - 10vw);
  margin: 10vw auto;
}


/* Variable with the preferred icon size in navigation scope */
nav {
  --icon-size: clamp(36px, 4vw, 72px);
}


/* Clickable menu icon */
nav input { /* Selector for <nav><input> */
  display: none; /* Hide checkbox */
}

nav input + label { /* Selector for <label> directly following <nav><input> */
  z-index: 2;
  position: absolute;
  right: 0;
  top: 0;
  width: var(--icon-size);
  height: var(--icon-size);
  cursor: pointer;
  /* make it non-selectable for hiding the cursor */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

nav input:not(checked) + label {
}

nav input:checked + label {
}


/* hamburger icon with rotating lines */
.menu-icon div {
  height: round(calc(var(--icon-size) * 0.05), 1px); /* dynamically scale line thickness */
  background-color: #ddd;
  margin: 28% 28% 0 0;
  transition: .5s 0s ease-in-out;
  -webkit-transition: .5s 0s ease-in-out;
}

nav input:checked + .menu-icon div:nth-child(1) {
  background-color: #222;
  transform-origin: left bottom;
  transform: rotate(45deg) scaleX(127%);
}

nav input:checked + .menu-icon div:nth-child(2) {
  opacity: 0;
}

nav input:checked + .menu-icon div:nth-child(3) {
  background-color: #222;
  transform-origin: left top;
  transform: rotate(-45deg) scaleX(127%);
}


/* Navigation menu styling */
nav input ~ div { /* Selector for all <div> following <nav><input> */
  z-index: 1;
  position: absolute;
  top: 0px;
  display: flex; /* Flexbox with width and height of menu entries */
  flex-direction: column;
  justify-content: flex-start; /* Vertical alignment */
  align-items: center; /* Horizontal alignment */
  padding: var(--icon-size) 2vw 2vw 2vw; /* Show menu below icon */
  max-width: 80vw;
  overflow: auto; /* Adds vertical scrollbars if necessary */
  transition: .5s 0s ease-in-out;
  -webkit-transition: .5s 0s ease-in-out;
  background-color: #eee;
}

nav input:not(checked) ~ div {
  right: -80vw;
  opacity: 0;
}

nav input:checked ~ div {
  right: 0;
  opacity: 1;
}

nav a:link {
  margin-top: var(--font-size);
}

nav a:link {
  color: #222;
}

nav a:visited {
  color: #222;
}

nav a:link:hover {
  color: #a41;
}

nav a:visited:hover {
  color: #a41;
}

main a:link {
  color: #ddd;
}

main a:visited {
  color: #ddd;
}

main a:link:hover {
  color: #a41;
}

main a:visited:hover {
  color: #a41;
}

