@import url("https://fonts.googleapis.com/css2?family=Overpass:wght@200;300;400;600;700;800&display=swap");

* {
  margin: 0%;
  padding: 0%;
  box-sizing: border-box;
  font-family: "Overpass", sans-serif;
}

@mixin mobile {
  @media (max-width: 500px) {
    @content;
  }
}
@mixin mobile2 {
  @media (max-width: 400px) {
    @content;
  }
}

body section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 850px;
  margin: 0% auto;
  width: 90%;
  margin-top: 1.5rem;
  transition: 0.3s ease-in top;
  top: -30%;
  @include mobile() {
    align-items: flex-start;
    flex-direction: column;
    form {
      width: 100%;
      margin-top: 1rem;
      input {
        width: 100%;
      }
    }
  }
  .title {
    flex: 1;
    h1 {
      color: #2c2c2c;
      font-weight: bold;
    }
  }
  form {
    display: flex;
    align-items: center;
    background: #e9eaeb;
    flex: 1;
    padding: 0.3rem 1rem;
    border-radius: 0.35rem;
    .icon {
      display: flex;
      ion-icon {
        font-size: 1.2rem;
        color: #5f6368;
      }
    }
    input {
      padding: 0.45rem 1rem;
      border: none;
      outline: none;
      background-color: transparent;
      font-size: 1rem;
      line-height: 1.5;
      padding-inline-start: 0.7rem;
    }
  }
}

// Images

body section {
  .imageContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    max-width: 850px;
    width: 90%;
    gap: 20px;
    margin: 0% auto;
    margin-top: 2rem;
    .image {
      width: 100%;
      height: 300px;
      position: relative;
      overflow: hidden;
      user-select: none;
      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
      &:hover {
        .author {
          bottom: 0%;
        }
      }
      @include mobile() {
        .author {
          bottom: 0%;
        }
      }
    }
    .author {
      position: absolute;
      bottom: -40%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 0.6rem 1rem;
      overflow: hidden;
      z-index: 11;
      z-index: 2;
      transition: 0.3s ease bottom;
      background-color: transparent;
      p {
        color: #fff;
      }
      span {
        color: #fff;
        font-size: 1rem;
        display: flex;
        padding: 0.5rem;
        border-radius: 50%;
        cursor: pointer;
        &:hover {
          background: rgba(255, 255, 255, 0.253);
        }
        ion-icon {
          font-size: 1.5rem;
          pointer-events: none;
        }
      }
      &::after {
        content: "";
        position: absolute;
        height: 100px;
        background-color: #111;
        display: flex;
        width: 100%;
        left: 0%;
        z-index: -1;
        opacity: 0.7;
      }
    }
  }
}

// Load More btn

body section {
  .loadMoreBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto;
    button {
      padding: 0.475rem 1rem;
      border: none;
      outline: none;
      background-color: #2c2c2c;
      color: #fff;
      font-size: 1rem;
      line-height: 1.5;
      border-radius: 0.25rem;
      cursor: pointer;
    }
  }
}

// Nav overflow

body section {
  &.navActive {
    header {
      position: fixed;
      top: 0%;
      left: 50%;
      background-color: #fff;
      z-index: 400;
      transform: translateX(-50%);
      margin-top: 0;
      padding: 1rem 2rem;
      width: 100%;
      box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 0px 0px;
      border-bottom: 1px solid rgba(99, 99, 99, 0.2);
    }
  }
}

// View Image

body .overlay {
  position: fixed;
  height: 100vh;
  width: 100%;
  background-color: #111;
  opacity: 0.5;
  top: 0;
  left: 0;
  z-index: 500;
  display: none;
}
// Image Container
body .imgViewCont {
  position: fixed;
  user-select: none;
  top: 50%;
  left: 50%;
  width: 90%;
  max-width: 700px;
  transform: translate(-50%, -50%);
  height: 400px;
  overflow: hidden;
  border: 5px solid #fff;
  box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
  z-index: 1000;
  background-color: #2c2c2c;
  .closeBtn {
    position: absolute;
    z-index: 100;
    right: 10px;
    top: 10px;
    button {
      border: none;
      outline: none;
      background-color: transparent;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: 0.3s ease backgound-color;
      height: 35px;
      width: 35px;

      ion-icon {
        font-size: 1.35rem;
        color: rgb(223, 45, 80);
      }
      &:hover {
        background-color: rgba(223, 45, 81, 0.219);
      }
    }
  }
  .imgCont {
    height: 100%;
    width: 100%;
    position: relative;
    img {
      height: 100%;
      width: 100%;
      object-fit: cover;
    }
  }
  // Cta
  .ctaButtons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: space-between;
    width: 97%;

    button {
      border: none;
      outline: none;
      background-color: transparent;
      cursor: pointer;
      padding: 0.9rem;
      // background-color: rgba(99, 99, 99, 0.123);
      transition: 0.3s ease backgound-color;
      border-radius: 50%;
      display: flex;
      ion-icon {
        font-size: 2.5rem;
        color: #fff;
      }
      &:hover {
        background-color: rgba(99, 99, 99, 0.123);
      }
    }
  }
}

body.imageOverview {
  overflow: hidden;
  padding-right: 17px;
  .overlay {
    display: flex;
  }
  @include mobile2() {
    padding-right: 0%;
  }
}
