/* Extra Stylish Effects - Responsive Version */

.about-page {
  padding: 80px 20px;
  background: linear-gradient(to bottom right, #f7f7f7, #e8f0ff);
  text-align: center;
  animation: fadeIn 1s ease-in-out;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 40px;
}

.about-card {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.4s ease;
}

.about-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.about-card:hover img {
  transform: scale(1.1);
}

.about-card .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.about-card:hover .overlay {
  opacity: 1;
}

.about-extra {
  margin-top: 50px;
  text-align: left;
  padding: 30px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  animation: slideUp 1s ease;
}

.gallery-grid {
  margin-top: 70px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.gallery-item {
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s ease;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.2) rotate(2deg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Media Queries */

/* Tablet and smaller screens */
@media (max-width: 768px) {
  .about-page {
    padding: 50px 15px;
  }

  .about-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
  }

  .about-card .overlay {
    padding: 15px;
    font-size: 0.9em; /* Adjust if text sizes are defined elsewhere */
  }

  .about-extra {
    margin-top: 40px;
    padding: 25px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 50px;
  }

  .gallery-item {
    border-radius: 12px;
  }
}

/* Mobile screens */
@media (max-width: 480px) {
  .about-page {
    padding: 30px 10px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
  }

  .about-card {
    border-radius: 12px;
  }

  .about-card .overlay {
    padding: 10px;
    font-size: 0.85em;
  }

  .about-extra {
    margin-top: 30px;
    padding: 20px;
    border-radius: 12px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 40px;
  }

  .gallery-item {
    border-radius: 10px;
  }

  .gallery-item:hover img {
    transform: scale(1.1) rotate(1deg); /* Reduce hover effect for touch devices */
  }
}