/* Performance Optimization CSS */

/* CLS Fix - Reserve space for dynamic content */
.website-livechat-widget {
  min-height: 60px;
  min-width: 300px;
}

.website-security-badges {
  min-height: 80px;
}

.newsletter-section {
  min-height: 200px;
}

.website-cta-section {
  min-height: 120px;
}

/* Font display optimization */
@font-face {
  font-family: 'FontAwesome';
  font-display: swap;
}

/* WebFont preloading */
@font-face {
  font-family: 'Segoe UI';
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

/* Critical font optimization */
body, .navbar-brand, h1, h2, h3, h4, h5, h6 {
  font-display: swap;
}

/* Critical above-the-fold styles */
#hero {
  contain: layout style paint;
  will-change: transform;
}

.hero-image {
  aspect-ratio: 3/2;
  object-fit: cover;
}

/* Image optimization */
img {
  height: auto;
  image-rendering: auto;
}

.img-fluid {
  max-width: 100%;
  height: auto;
}

/* Gallery responsive images */
.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  aspect-ratio: 3/2;
}

/* Service card images */
.service-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  aspect-ratio: 16/10;
}

/* Team member images */
.team-member img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  aspect-ratio: 1/1;
  border-radius: 50%;
}

/* Case study images */
.case-study-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  aspect-ratio: 16/9;
}

/* Reduce layout shift from navbar */
.navbar {
  min-height: 76px;
}

/* Optimize animations for performance */
@media (prefers-reduced-motion: no-preference) {
  .feature-item, .service-card, .team-member {
    transition: transform 0.2s ease-out;
  }
}

/* Disable animations completely for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Critical loading performance */
.lozad {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Prevent invisible text during font load */
body {
  font-display: swap;
}

/* Optimize for Core Web Vitals */
.container, .container-fluid {
  contain: layout;
}

/* Preload critical images dimensions */
.hero-image {
  width: 600px;
  height: 400px;
  max-width: 100%;
}

/* Newsletter form stability */
.newsletter-form {
  min-height: 60px;
  display: flex;
  gap: 10px;
}

.newsletter-input {
  flex: 1;
  min-height: 40px;
}

.newsletter-button {
  min-width: 100px;
  min-height: 40px;
}

/* Social links stability */
.social-icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 10px;
  min-height: 40px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

/* Fix layout shift from icons */
i[class*="fa-"] {
  width: 1em;
  text-align: center;
}

/* Optimize third-party content */
iframe {
  loading: lazy;
}

/* Critical inline styles for immediate visibility */
.critical-above-fold {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
