.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}
.portfolio-item {
  transition: transform 0.3s ease;
  cursor: pointer;
}
.portfolio-item:hover {
  transform: scale(1.03);
}
#popup-overlay {
  z-index: 99999;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
}
#project-popup {
  z-index: 99999;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #222;
  color: #fff;
  z-index: 9999;
  max-width: 1000px;
  width: 90%;
  padding: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 10px;
}
.popup-slider {
  width: 100%;
  max-width: 500px;
  height: 500px;
}
.popup-slider img {
  width: 100%;
  height: auto;
  object-fit: cover;
}
.popup-content {
  flex: 1;
}
.popup-content h2 {
  color: #fff !important;
}
#portfolio-filter {
  text-align: center;
}
.filter-btn {
  background: none;
  border: none;
  font-weight: bold;
  cursor: pointer;
  color: #555;
  margin-bottom: 0;
}
.filter-btn.active {
  color: red;
}
.portfolio-pagination {
  text-align: center;
  margin-bottom: 40px;
}
body.no-scroll,
html.no-scroll {
  overflow: hidden !important;
  height: 100vh;
}
.portfolio-item img {
  height: 200px !important;
  width: auto !important;
}

/* ===================== Responsive Enhancements ===================== */

/* Base font scaling */
body {
  font-size: 16px;
}

@media screen and (max-width: 1024px) {
  body {
    font-size: 15px;
  }
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  body {
    font-size: 14px;
  }
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 20px;
    gap: 16px;
  }
  .popup-slider {
    max-width: 100%;
    height: auto;
  }
  .popup-content {
    flex-basis: 100%;
  }
}

@media screen and (max-width: 480px) {
  body {
    font-size: 13px;
  }
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .portfolio-item img {
    height: 150px !important;
  }
  .popup-content {
    padding: 10px 0;
  }
}