/* Performance optimizations for Makgane Attorneys website */

/* Optimize image loading */
img {
  max-width: 100%;
  height: auto;
}

/* Add will-change for elements that will animate */
.hero-buttons a:hover,
.btn:hover,
nav a:hover,
.feature-box:hover,
.practice-box:hover,
.team-member:hover,
.contact-form button:hover {
  will-change: transform, opacity;
}

/* Optimize transitions */
.btn,
nav a,
.feature-box,
.practice-box,
.team-member,
.contact-form button {
  transition: all 0.3s ease;
}

/* Reduce paint complexity */
.hero,
.about,
.practice-areas,
.team,
.expertise,
.coverage,
.quality,
.contact {
  transform: translateZ(0);
}

/* Optimize font rendering */
body {
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reduce layout shifts */
.hero-image,
.about-image img,
.team-image img,
.map-container iframe {
  aspect-ratio: 16/9;
}

/* Optimize animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* Optimize scrolling */
html {
  scroll-behavior: smooth;
}

/* Optimize form elements */
input, textarea, button {
  appearance: none;
  -webkit-appearance: none;
}
