
* {
  /*margin: 0;*/
  /*padding: 0;*/
  /*box-sizing: border-box;*/
  /*font-family: Arial, sans-serif;*/
}

.portfolio {
  padding: 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* CARD */
.card {
  cursor: pointer;
  width: auto;
}

.image-wrapper {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.image-wrapper img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

/* TITLE OVER IMAGE */
.image-wrapper h3 {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 12px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

/* ACTION BUTTONS */
.card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
}

.card-actions button {
  border: none;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
}

.card-actions .edit {
  background: #007bff;
}

.card-actions .delete {
  background: #dc3545;
}

/* Mobile Friendly */
@media (max-width: 600px) {
    .portfolio {
      padding: 10px 0;
    }
}


/* MODAL */
#modal_portfolio {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999;
  overflow-y: auto; /* allow scrolling inside modal if content is tall */
}

#modal_portfolio.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 900px;
  border-radius: 10px;
  animation: zoom 0.4s ease forwards;
  position: relative;
  max-height: 90vh; /* prevent modal from exceeding viewport */
  overflow-y: auto; /* scroll modal content if needed */
}

@keyframes zoom {
  from { transform: scale(0.85); }
  to { transform: scale(1); }
}

.close {
position: absolute;
  top: -28px;
  right: 0px;
  font-size: 40px;
  cursor: pointer;
  z-index: 99999;
  color: black;
}

.modal-body {
  display: flex;
  flex-wrap: wrap;
}

.modal-image {
  flex: 1;
  min-width: 300px;
  max-height: 400px;
  overflow: hidden;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.modal-info {
  flex: 1;
  padding: 25px;
}

.modal-info ul {
  list-style: none;
  margin-top: 15px;
  padding: 0;
}

.modal-info li {
  margin-bottom: 10px;
}

.card-actions a {
  text-decoration: none;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  color: #fff;
  display: inline-block;
}

.card-actions .edit {
  background: #007bff;
}

.card-actions .delete {
  background: #dc3545;
}


/* RESPONSIVE */
@media (max-width: 768px) {
  .modal-body {
    flex-direction: column;
  }

  .modal-image {
    max-height: 250px;
    margin-bottom: 15px;
  }

  .modal-info {
    padding: 15px;

    /* Make info scrollable if content is too long */
    max-height: 50vh;   /* adjust as needed */
    overflow-y: auto;
    
    scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
  }
  
  .modal-content{
      width:100%;
      height:100vh;
  }
  
}