/* Portfolio Section */
.portfolio-section {
  padding: 60px 0;
  background: linear-gradient(180deg, #ffffff 0%, #f1f3f5 100%);
  position: relative;
}

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 10px;
  position: relative;
}

.section-title::after {
  content: '';
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #f26c21, #f39c12);
  display: block;
  margin: 12px auto;
  border-radius: 1px;
}

.section-title i {
  color: #f26c21;
  font-size: 1.8rem;
  vertical-align: middle;
  margin-right: 8px;
  animation: rotateIcon 3s ease infinite;
}

@keyframes rotateIcon {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(10deg); }
  100% { transform: rotate(0deg); }
}

.lead-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 35px;
  max-width: 1150px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: slideIn 1.5s ease-out forwards;
  animation-delay: 0.4s;
}

@keyframes slideIn {
  0% { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Portfolio Filters */
.portfolio-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
  list-style: none;
  padding: 0;
}

.portfolio-filters li {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1a1a1a;
  padding: 8px 18px;
  background: #f8f9fa;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.portfolio-filters li:hover,
.portfolio-filters li.filter-active {
  background: linear-gradient(135deg, #f26c21, #f39c12);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(242, 108, 33, 0.25);
  transform: scale(1.05);
}

/* Portfolio Grid */
.isotope-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px; /* Add padding to prevent cards from touching edges */
}

.portfolio-item {
  width: 100%;
  max-width: 360px; /* Restrict max width to prevent oversized cards */
  margin: 7.5px; /* Half of 15px gap for consistent spacing */
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  background: #fff;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  border: 1px solid rgba(242, 108, 33, 0.2);
  box-sizing: border-box; /* Ensure padding/margins don't cause overlap */
}

.portfolio-item:hover {
  transform: rotate(2deg) scale(1.02);
  box-shadow: 0 6px 20px rgba(242, 108, 33, 0.3);
}

.portfolio-item img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.portfolio-item:hover img {
  transform: scale(1.05);
  filter: contrast(1.15);
}

.portfolio-info {
  padding: 18px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.portfolio-info h4 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.portfolio-info p {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: #4a4a4a;
  margin-bottom: 12px;
  flex-grow: 1;
}

.details-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  color: #4a4a4a;
}

.details-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.details-meta i {
  color: #f26c21;
}

.btn-group {
  display: flex;
  gap: 8px;
}

.preview-link,
.details-link {
  display: inline-block;
  padding: 7px 14px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.preview-link {
  background: linear-gradient(135deg, #f26c21, #f39c12);
  color: #fff;
  border: none;
}

.preview-link:hover {
  background: linear-gradient(135deg, #f39c12, #f26c21);
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(242, 108, 33, 0.3);
}

.details-link {
  background: transparent;
  color: #f26c21;
  border: 1px solid;
}

.details-link:hover {
  background: linear-gradient(135deg, #f26c21, #f39c12);
  color: #ffffff;
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(242, 108, 33, 0.3);
}

/* Investor CTA */
.investor-cta {
  text-align: center;
  margin-top: 50px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  border: none;
}

.investor-cta .section-title {
  margin-bottom: 12px;
}

.investor-cta .lead-text {
  max-width: 550px;
  margin-bottom: 18px;
}

.btn-primary {
  display: inline-block;
  padding: 9px 18px;
  background: linear-gradient(135deg, #f26c21, #f39c12);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f39c12, #f26c21);
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(242, 108, 33, 0.3);
}

.btn-primary i {
  margin-right: 6px;
}

/* Responsive Design */
@media (max-width: 991px) {
  .isotope-container {
    padding: 0 10px;
  }
  .portfolio-item {
    max-width: 300px; /* Smaller max-width for mid-sized screens */
    margin: 6px; /* Adjusted for 12px gap */
  }
  .portfolio-item img {
    height: 170px;
  }
  .section-title {
    font-size: 2rem;
  }
  .lead-text {
    font-size: 1.05rem;
  }
}

@media (max-width: 768px) {
  .portfolio-section {
    padding: 40px 0;
  }
  .isotope-container {
    padding: 0 10px;
  }
  .portfolio-item {
    max-width: 100%; /* Full width for smaller screens */
    margin: 5px; /* 10px gap */
  }
  .portfolio-item img {
    height: 150px;
  }
  .portfolio-info h4 {
    font-size: 1.15rem;
  }
  .portfolio-info p {
    font-size: 0.8rem;
  }
  .investor-cta {
    padding: 18px;
  }
}

@media (max-width: 576px) {
  .section-title {
    font-size: 1.7rem;
  }
  .lead-text {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
  .portfolio-item {
    margin: 5px; /* 10px gap */
  }
  .portfolio-item img {
    height: 130px;
  }
  .portfolio-info h4 {
    font-size: 1.1rem;
  }
  .portfolio-filters li {
    font-size: 0.85rem;
    padding: 7px 14px;
  }
  .btn-primary {
    font-size: 0.85rem;
    padding: 7px 14px;
  }
}