@import url("https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
}

body {
  background: rgba(252, 245, 229, 1);
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1;
  color: #212121;
  overflow-x: hidden;
}

.logo-container {
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0.625rem;
}

.logo {
  text-decoration: none;
  color: #212121;
}

.logo-text {
  font-family: "DM Mono", monospace;
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.25rem;
  text-transform: uppercase;
}

.banner {
  background: rgba(252, 245, 229, 1);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1.875rem 0 1.25rem;
  max-width: 95%;
  margin: 0 auto;
  border-bottom: 1px solid #21212166;
}

.avatar-section {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.25rem;
}

.avatar-img {
  width: 11.875rem;
  height: 11.875rem;
  border-radius: 0.625rem;
  object-fit: fill;
}

.properties {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  gap: 0.75rem;
  height: 11.875rem;
}

.details {
  display: flex;
  flex-direction: column;
}

.name {
  font-weight: 500;
  font-size: 2rem;
  color: #212121;
  margin-bottom: 0.5rem;
  max-width: 22ch;

  display: -webkit-box;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.description {
  font-weight: 500;
  font-size: 1rem;
  color: rgba(33, 33, 33, 0.7);
  margin-bottom: 0.5rem;
  max-width: 45ch;
  word-break: break-all;
  /* width: 450px; */
  display: -webkit-box;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

.btn-light {
  width: fit-content;
  background-color: transparent;
  opacity: 0.7;
}

.btn-light:hover,
.btn-light:active {
  opacity: 1;
}

.btn-dark {
  background-color: #212121;
  color: #fcf5e5;
  padding: 1.125rem 2rem;
  border-radius: 0.5rem;
}

.btn-dark:hover,
.btn-dark:active {
  background: #212121cc;
}

.modal {
  position: fixed;
  background-color: #f8f8f8;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 35rem;
  width: 100%;
  padding: 3rem 2rem;
  z-index: 1;
  border: none;
  border-radius: 1rem;
  transition: all 0.4s ease-in-out;

  & .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    outline: none;
  }

  & .modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;

    & .btn-dark {
      padding: 0.5rem;
      margin-top: 1.5rem;
    }
  }

  & .form-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;

    & .form-label {
      display: flex;
      justify-content: space-between;
      align-items: center;

      & .error {
        font-size: 0.625rem;
        color: red;
      }
    }

    & input {
      background-color: transparent;
      border: none;
      outline: 1px solid #f8f8f8;
      padding: 0.5rem;
      border-radius: 0.5rem;
      border-bottom: 0.2px solid slategray;

      & ::placeholder {
        font-style: italic;
      }
    }

    & input[type="file"] {
      border: none;
      border-radius: 0;
      outline: 0;
    }
  }
}
.modal::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.custom-upload {
  position: relative;
  width: 100%;
  height: 14rem;
  background-color: #f0f0f0;
  font-style: italic;
  border: 1px dashed #999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-align: center;
  border-radius: 0.25rem;
  overflow: hidden;
  margin-top: 0.6rem;
  transition: all 0.3s ease-in-out;
}

.custom-upload:hover {
  background-color: #fcfcfc;
}

.custom-upload span {
  font-size: 0.875rem;
  text-align: center;
  padding: 0.5rem;
  color: #333;
}

.upload-preview {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* main */
.main {
  max-width: 95%;
  margin: 0 auto;
}

/* The container holding the cards */
.container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 1.3rem;
  padding: 1.25rem 0 2.5rem;
  width: 100%;
  border-bottom: 1px solid #21212166;
}

.card-img-container {
  width: 100%;
  max-height: 26.25rem;
  height: 100%;
  border-radius: 0.625rem;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

/* -----styling for each image card when focused */
.card.focused {
  /* box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); */
  /* transform: translateY(-1rem); */
  transform: scale(1);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-description {
  display: flex;
  justify-content: space-between;
  gap: 0.3125rem;
  padding-top: 1rem;
}

.card-title {
  font-weight: 500;
  line-height: 1.2;
  font-size: 1.25rem;
}

.previewable-modal {
  border: none;
}

.previewable-images {
  position: relative;
  transform: scale(0.9);
  opacity: 0;
  border-radius: 0.5rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.previewable-modal.show .previewable-images {
  transform: scale(1);
  opacity: 1;
}

.preview-img {
  border-radius: 0.625rem;
  margin: 0.5rem 0;
}

.previewable-title {
  margin-top: 1.25rem;
}

.delete-icon {
  position: absolute;
  right: 17px;
  top: 10px;
  width: 20px;
  height: 20px;
  z-index: 1;
}

.like-icon {
  max-width: 1.4375rem;
  width: 100%;
  color: #212121;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.2s ease-in-out;
}

.like-icon:hover,
.like-icon.liked {
  opacity: 1;
}

.hidden {
  display: none;
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

/* Media queries styling for small Laptop Screens (up to 1024px wide) */
@media (max-width: 64rem) {
  .btn-dark {
    padding: 0.625rem 1.25rem;
  }

  .container {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Tablets (up to 880px wide) */
@media (max-width: 55rem) {
  .banner {
    max-width: 90%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
  }

  .avatar-section {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .properties {
    align-items: center;
    height: auto;
    gap: 1.5rem;
  }

  .name {
    max-width: 50ch;
  }

  .description {
    max-width: 65ch;
    margin: 0 auto;
  }

  .details {
    align-items: center;
  }

  .btn-dark {
    width: 90%;
    margin: 0 auto;
    justify-content: center;
    padding: 1.5rem;
  }

  .main {
    max-width: 90%;
  }

  .container {
    grid-template-columns: 1fr;
    gap: 5rem;
  }

  .card-description {
    padding-top: 1.5rem;
  }
}

/* 608px */
@media (max-width: 38rem) {
  .modal {
    max-width: 25rem;
  }
}

/* 480px */
@media (max-width: 30rem) {
  .banner {
    padding-bottom: 1.8rem;
  }

  .name {
    font-size: 1.25rem;
    padding: 0 30px;
    text-align: center;
  }

  .description {
    font-size: 1rem;
    padding: 0 2.2rem;
  }

  .modal {
    max-width: 90%;
  }
  .footer {
    padding: 1.5rem;
  }
}

/* 342.4px */
@media (max-width: 21.4rem) {
  .card-img-container {
    max-height: 15rem;
  }
}
