@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400,500,600&display=swap");

* {
  box-sizing: border-box;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  font-family:
    "Montserrat",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.04em;
  font-size: 16px;
  background-color: #fafafa;
  color: #212121;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
p {
  margin: 0;
}

#categories {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 24px;
  padding: 24px;
}

#categories .item {
  padding: 16px;
  width: 392;
  border-radius: 8px;
  background-color: #f6f6fe;

  h2 {
    margin: 0 0 16px;
    font-weight: 600;
    font-size: 24px;
    line-height: 1.333;
  }

  ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  li {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #808080;
    font-size: 16px;
  }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, 360px);
  justify-content: center;

  gap: 48px 24px;
  padding: 100px 156px;

  .tumb {
    width: 360px;
    height: 300px;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}

input {
  display: block;
  width: 360px;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid #808080;
  font-size: 16px;
  outline: none;

  &::placeholder {
    color: #2e2f42;
  }

  &:hover {
    border-color: #000000;
  }

  &:fosus {
    border-color: #808080;
  }
}

#name-input {
  margin-top: 24px;
}

#name-input + h1 {
  margin-top: 16px;
  font-weight: 600;
  line-height: 1.33;
}

.login-form {
  display: flex;
  flex-direction: column;
  margin-top: 24px;

  label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }

  label:last-of-type {
    margin-bottom: 16px;
  }
}

button {
  display: inline-block;
  width: fit-content;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background-color: #4e75ff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: #ffffff;
  cursor: pointer;

  &:hover {
    background-color: #6c8cff;
  }
}

[data-destroy] {
  background-color: #ff4e4e;

  &:hover {
    background-color: #ff7070;
  }
}

.widget {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-grow: 1;

  p {
    color: #2e2f42;
  }
}

#controls {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 32px;
  background-color: #f6f6fe;
  border-radius: 8px;
}

#boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 44px;
  padding: 16px;
  background-color: #f6f6fe;
  border-radius: 8px;

  &:empty {
    display: none;
  }
}
