@color: #1ab254;

@easing: cubic-bezier(0, 0, 0.25, 1);

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
  -moz-osx-font-smoothing: grayscale;
  line-height: inherit;
}

body {
  background-color: #fff;
  color: #000;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.4em;
  font-weight: normal;
  padding: 0 5vw;
  min-width: 350px;
}

img {
  border: 0;
}

&:focus-visible {
  outline: 2px dotted @color;
  outline-offset: 4px;
}

main,
header,
nav,
section {
  display: block;
}

body,
input,
textarea,
select {
  font-family: "Work Sans", sans-serif;
}

b {
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
  &:hover {
    text-decoration: underline;
  }
}

#toggleUser {
  all: unset;
  width: 30px;
  height: 30px;
  position: absolute;
  right: 5vw;
  top: 30px;
  font-size: 0;
  cursor: pointer;
  background: url("/images/user-icon.svg") no-repeat center;
}

@media screen and (max-width: 540px) {
  body:not(.userVisible) .user {
    display: none;
  }
}

@media screen and (min-width: 541px) {
  #toggleUser {
    display: none;
  }
}

header {
  padding: 30px 0;
  .top {
    @media screen and (max-width: 540px) {
      .user {
        margin-top: 15px;
        a {
          margin-right: 5px;
        }
      }
    }
    @media screen and (min-width: 541px) {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      .user {
        text-align: right;
      }
    }
    .user {
      @media screen and (max-width: 710px) {
        a {
          display: inline-block;
        }
      }
      @media screen and (min-width: 711px) {
        display: flex;
        gap: 10px;
      }
    }
  }
  a {
    color: @color;
  }
  #logo {
    font-weight: 700;
    font-size: 150%;
    a {
      color: #000;
      display: flex;
      gap: 10px;
      align-items: center;
    }
  }
  .breadcrumb {
    .separator {
      display: block;
      width: 20px;
      height: 20px;
      background: url("/images/breadcrumb-sep.svg") no-repeat center;
    }
    @media screen and (max-width: 540px) {
      margin-top: 20px;
      a,
      span,
      .separator {
        display: inline-block;
        vertical-align: middle;
      }
      .separator {
        margin-bottom: -2px;
      }
    }
    @media screen and (min-width: 541px) {
      margin-top: 10px;
      display: flex;
      align-items: center;
    }
    a {
      color: #777;
      white-space: nowrap;
      &.active {
        color: #000;
        text-decoration: none !important;
        cursor: default;
        pointer-events: none;
      }
    }
    span {
      white-space: nowrap;
    }
  }
}

@keyframes slideIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

main {
  min-height: ~"calc(100dvh - 210px)";
  .categories {
		.file-info-container .file-info {
			display: none;
		}
    @media screen and (max-width: 629px) {
      a {
        aspect-ratio: 2 / 1;
      }
      a + a {
        margin-top: 20px;
      }
    }
    @media screen and (min-width: 630px) {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
      gap: 20px;
      a {
        aspect-ratio: 1;
      }
    }
    a {
      display: block;
      background-color: @color;
      color: #fff;
      padding: 12px 30px 20px 17px;
      font-size: 150%;
      line-height: 1.4em;
      font-weight: 700;
      animation: slideIn 0.5s ease forwards;
      opacity: 0;
      position: relative;
      transition: background-color 0.5s ease;
      &:hover {
        background-color: #000;
        text-decoration: none;
        transition-duration: 0.15s;
      }
      img {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: -1;
      }
      &.bg {
        background-color: #000;
        img {
          transition: opacity 0.5s ease;
        }
        &:hover {
          img {
            opacity: 0.7;
            transition-duration: 0.15s;
          }
        }
      }
    }
  }
}

h1 {
  font-size: 150%;
  font-weight: 700;
  line-height: 1.4em;
  margin-bottom: 1em;
}

h2 {
  margin: 1.5em 0 1em;
  font-size: 150%;
}

h3 {
  margin: 1.5em 0 0.5em;
  font-size: 125%;
  color: @color;
  font-weight: 500;
}

h4 {
  margin: 1.5em 0 0.5em;
  font-size: 100%;
  color: @color;
  font-weight: 500;
}

ul {
  padding-left: 20px;
  margin: 0.5em 0;
}

p {
  margin: 1em 0;
}

main.text {
  padding-top: 20px;
}

#subpage {
  max-width: 800px;
  a {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #777;
    &:hover {
      opacity: 0.6;
    }
  }
}

footer {
  color: #888;
  font-size: 80%;
  line-height: 1.4em;
  margin-top: 25px;
  @media screen and (max-width: 520px) {
    padding: 15px 0 25px;
    p {
      margin: 0;
    }
  }
  @media screen and (min-width: 521px) {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
  }
}

label {
  display: block;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  all: unset;
  border: 1px solid #ccc;
  padding: 10px;
  width: 300px;
  font-size: 100%;
  line-height: 1.4em;
  cursor: text;
  margin: 0 0 1em;
  &:hover {
    border-color: #888;
  }
  &:focus {
    border-color: @color;
    outline: none;
  }
}

input[type="submit"],
button {
  all: unset;
  background-color: @color;
  color: #fff;
  padding: 9px 30px 11px;
  cursor: pointer;
  font-weight: 700;
  margin: 1em 0;
  font-size: 100%;
  transition: background-color 0.5s ease;
  &:hover {
    transition-duration: 0.15s;
    background-color: #000;
  }
}
.error {
  color: #c22;
  margin: 0.5em 0;
}

.file-info-container {
  display: inline-block;
  .file-info {
    display: inline;
    margin-left: 7px;
    font-size: 80%;
    color: #777;
    .format {
      border-radius: 0 6px 0 0;
      border: 1px solid #777;
      font-size: 10px;
      font-weight: 500;
      padding: 2px 2px 1px;
    }
  }
}

.download {
  padding: 10px 15px;
  background-color: #eee;
}