/* Responsive fixes for services and projects sections */

/* Base fixes for cards in both sections */
.services-grid,
.projects-grid {
  width: 100%;
  display: grid;
  gap: 25px;
}

.service-card,
.project-card {
  width: 100%;
  height: 380px;
  overflow: hidden;
  position: relative;
}

.service-card-image,
.project-card-image,
.service-card-image img,
.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Project intro section */
.projects-intro {
  max-width: 800px;
  margin: 0 auto 60px;
  text-align: center;
}

.projects-intro p {
  color: var(--light-gray);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 30px;
}

/* Service buttons - styled like project buttons */
/* Service button styles removed as requested */

/* Project card content fixes */
.project-content p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 15px;
}

.project-content {
  display: flex;
  flex-direction: column;
}

/* Common card styles for both services and projects */
@media (max-width: 992px) {
  /* Services section */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .service-card {
    height: 350px; /* Adjusted height for tablets */
  }

  /* Projects section */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .project-card {
    height: 350px; /* Adjusted height for tablets */
  }
}

@media (max-width: 768px) {
  /* Services section */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .service-card {
    height: 320px; /* Adjusted height for small tablets */
  }

  .service-content {
    padding: 20px;
  }

  .service-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }

  .service-content p {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }

  /* Projects section */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .project-card {
    height: 320px; /* Adjusted height for small tablets */
  }

  .project-content {
    padding: 20px;
  }

  .project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }

  .project-content p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
  }

  .tech-tag {
    font-size: 0.8rem;
    padding: 4px 10px;
    margin-bottom: 0;
    white-space: nowrap;
  }

  .project-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    display: inline-block;
  }
}

@media (max-width: 576px) {
  /* Services section */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .service-card {
    height: 300px; /* Better height for mobile phones */
  }

  .service-content h3 {
    font-size: 1.4rem;
  }

  /* Projects section */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-card {
    height: 300px; /* Better height for mobile phones */
  }

  .project-content h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
  }

  .project-content p {
    margin-bottom: 12px;
    max-height: 55px;
  }

  .project-tech {
    margin-bottom: 12px;
    gap: 5px;
  }

  .tech-tag {
    padding: 3px 10px;
  }
}

/* Fix for small mobile devices */
@media (max-width: 400px) {
  /* Services section */
  .service-card {
    height: 280px; /* Smaller height for very small screens */
  }

  .service-content {
    padding: 15px;
  }

  .service-content h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .service-content p {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  /* Projects section */
  .project-card {
    height: 280px; /* Smaller height for very small screens */
  }

  .project-content {
    padding: 15px;
  }

  .project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 6px;
  }

  .project-content p {
    font-size: 0.85rem;
    margin-bottom: 8px;
    max-height: 50px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .project-tech {
    margin-bottom: 8px;
    gap: 4px;
  }

  .tech-tag {
    padding: 3px 8px;
    font-size: 0.75rem;
    margin-right: 0;
    line-height: 1.2;
    display: inline-block;
    margin-bottom: 0;
  }

  .project-btn {
    padding: 7px 14px;
    font-size: 0.8rem;
    margin-top: 2px;
  }
}

/* Additional fixes for consistent card display */
@media (max-width: 992px) {
  /* Fix images for both services and projects */
  .service-card-image img,
  .project-card-image img {
    object-position: center;
  }

  /* Ensure consistent hover effects */
  .service-card:hover,
  .project-card:hover {
    transform: translateY(-5px);
  }
}

/* Fix for very small screens */
@media (max-width: 320px) {
  .service-card,
  .project-card {
    height: 260px;
  }

  .service-content p,
  .project-content p {
    font-size: 0.8rem;
    margin-bottom: 6px;
    max-height: 45px;
  }

  /* Service button styles removed as requested */

  .project-btn {
    padding: 6px 14px;
    font-size: 0.75rem;
  }

  /* Service button styles removed as requested */

  .tech-tag {
    padding: 2px 6px;
    font-size: 0.7rem;
  }

  .project-tech {
    margin-bottom: 6px;
    gap: 3px;
  }

  /* Limit visible tech tags on very small screens */
  .project-tech .tech-tag:nth-child(n + 3) {
    display: none;
  }
}
