* {
  margin: 0;
  padding: 0;
}

body {
  font-family: Helvetica, sans-serif;
  background-color: ghostwhite;
  display: flex;
  flex-flow: column;
  height: 100vh;
  overflow: hidden;
}

main {
  display: flex;
  flex-flow: column;
  width: 100%;
  height: 100%;
  max-width: 768px;
  margin: auto;
  overflow: hidden;
}

nav {
  padding: 1rem 2rem;
  margin-bottom: 2rem;
  background-color: gainsboro;

  ul {
    display: flex;
    flex-flow: row;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    max-width: 768px;
    margin: auto;

    a {
      text-decoration: none;
      color: dimgray;

      &:hover {
        color: black;
      }

      .logo {
        font-size: 1.5rem;
        font-weight: bold;
        text-transform: uppercase;
        color: royalblue;

        &:hover {
          color: midnightblue;
        }
      }

      .button {
        display: inline-block;
        line-height: 2rem;
        padding: 0 1rem;
        background-color: royalblue;
        color: white;
        border-radius: 1rem;

        &:hover {
          background-color: midnightblue;
        }
      }
    }
  }
}

h1 {
  margin-bottom: 2rem;
}

.postWrapper {
  display: flex;
  flex-direction: column-reverse;
  overflow: auto;
  padding: 1.5rem 0;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 5%,
    black 95%,
    transparent 100%
  );

  .postList {
    .post {
      display: flex;
      flex-flow: column;
      padding: 1rem;
      margin-bottom: 2rem;
      list-style: none;
      background-color: white;
      border-radius: 1rem;

      .user {
        margin-bottom: 0.5rem;

        a {
          color: black;
          font-weight: bolder;
          text-decoration: none;

          &:hover {
            text-decoration: underline;
          }
        }
      }

      .text {
        color: dimgray;
        margin-bottom: 1rem;
      }

      .added {
        align-self: flex-end;
        color: lightgray;
      }
    }
  }
}

form {
  display: flex;
  flex-flow: column;
  align-items: center;
  gap: 2rem;

  label {
    display: flex;
    flex-flow: column;
    width: 100%;

    input {
      height: 2rem;
    }
    textarea {
      resize: none;
      field-sizing: content;
      min-height: 2rem;
    }
  }

  button {
    flex-grow: 0;
    width: auto;
    display: inline-block;
    line-height: 2rem;
    padding: 0 1rem;
    background-color: royalblue;
    color: white;
    border-radius: 1rem;
    border: none;

    &:hover {
      background-color: midnightblue;
      cursor: pointer;
    }
  }
}

.error {
  flex: 1;
  display: flex;
  flex-flow: column;
  align-items: center;
  justify-content: center;
}
