/* --------------------------------------------------------------------------------- */
/* ------------------------------------ Filters ------------------------------------ */
/* --------------------------------------------------------------------------------- */

#portfolio {
  margin: 10em auto;
  width: 80dvw;
  height: fit-content;
  min-height: 80dvh;
  scroll-margin-top: 100px;

  h2 {
    width: 100%;
    text-align: center;
  }

  #filterButtons {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
  }

  button {
    margin: 0 10px 2em 10px;
    padding: 10px 20px;
    cursor: pointer;
    background: none;
    border: none;

    font-family: montserrat;
    color: var(--text-white);
    font-size: 1.2em;
    font-weight: 600;

    transition: 0.3s ease, color 0.3s ease;
  }

  #filterButtons button.active-filter {
    background-color: rgba(255, 255, 255, 0.1); /* or any contrast color */
    color: var(--primary-color); /* or just white if it's enough contrast */
    border-radius: 6px;
  }
}

.filter-buttons {
  margin-bottom: 20px;
  text-align: center;
}

.filter-buttons button {
  margin: 0 10px;
  padding: 10px 20px;
  cursor: pointer;
}

@media only screen and (max-width: 700px) {
  #portfolio button {
    font-size: 1em;
    margin: 0;
    padding: 1em;
  }

  #filterButtons {
    margin-bottom: 2em;
  }
}

/* --------------------------------------------------------------------------------- */
/* -------------------------------------- Cards ------------------------------------ */
/* --------------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  display: block;
  position: relative;
}

.card.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.card img {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  background-color: #222;
}

.subtext {
  position: absolute;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text-white);
  width: 100%;
  text-align: center;
  padding: 10px;
  display: none;
}

.card:hover .subtext {
  display: block;
}

@media only screen and (max-width: 700px) {
  .card img {
    width: 100%;
    aspect-ratio: 16/9;
  }

  .subtext {
    display: block;
  }
}

/* --------------------------------------------------------------------------------- */
/* ------------------------------------- POP OVER ---------------------------------- */
/* --------------------------------------------------------------------------------- */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-content {
  background: var(--background-color);
  border-radius: 10px;
  width: 90%;
  height: 90%;
  overflow: auto;
  position: relative;
  border-radius: 8px;

  display: flex;
  flex-direction: column;

  section {
    width: 100%;
    padding: 3em;
  }

  p {
    margin: 1em 0;
    font-weight: 100;
  }

  strong {
    font-weight: 600;
  }

  h2 {
    margin: 0 0 1em 0;
  }

  h3 {
    font-size: 1.6em;
    font-weight: 600;
  }
}

.modal-content img {
  width: 100%;
  height: 40%;
  object-fit: cover;
  object-position: center;
}

.modal-information {
  display: grid;
  grid-template-columns: 70% 30%;
  grid-template-rows: auto auto auto;
  grid-column-gap: 0px;
  grid-row-gap: 0px;
}

.assignment,
.idea,
.process {
  width: 90%;
  border: 3px solid var(--primary-color);
  border-radius: 8px;
  padding: 1em;
  margin-bottom: 1em;
}

.idea {
  grid-area: 1 / 1 / 2 / 2;
}

.assignment {
  grid-area: 2 / 1 / 3 / 2;
}

.process {
  grid-area: 3 / 1 / 4 / 2;
}

.screenshots {
  grid-area: 1 / 2 / 4 / 3;
  margin-top: -11em;

  img {
    height: auto;
    max-height: 200px;
    width: 100%;
    object-fit: contain;
    margin: 1em 1em 1em 0;
  }
}

.close-btn {
  position: absolute;
  aspect-ratio: 1;
  width: 1.2em;
  top: 10px;
  right: 25px;
  font-size: 3em;
  text-align: center;
  color: var(--primary-color);
  cursor: pointer;
  transition: 0.3s ease;
  background-color: white;
  border-radius: 50%;
  border: 1px solid white;
}

.close-btn:hover {
  color: var(--text-black);
  border: 1px solid black;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.hidden {
  display: none;
}

.modal-buttons {
  cursor: pointer;
  background: none;
  margin: 2em 0;
  transition: 0.3s ease, color 0.3s ease;
}

.modal-buttons a {
  margin: 3em 1em 2em 0;
  padding: 10px 20px;
  cursor: pointer;
  background: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  font-family: montserrat;
  color: var(--text-white);
  font-size: 1em;
  text-decoration: none;
  transition: 0.3s ease, color 0.3s ease;
}

.modal-buttons a:hover {
  background-color: var(--background-color);
  color: var(--primary-color);
}

@media only screen and (max-width: 700px) {
  .modal-content section {
    padding: 1em;
  }

  .modal-information {
    display: flex;
    flex-direction: column;
  }

  .modal-information {
    width: 100%;
  }

  .modal-buttons {
    display: flex;
    justify-content: space-around;
    margin: 0;
  }

  .assignment,
  .idea,
  .process {
    width: 100%;
  }

  .screenshots {
    margin-top: 0;

    img {
    }
  }
}
