/**
 * INSPEGAS.COM.CO - Core Web Vitals & Image Performance Engine
 * Subagente 09: Performance, Image Optimization & Core Web Vitals
 *
 * Designed to ensure 95-100 Google PageSpeed, 0.00 CLS, <1.0s LCP and <50ms INP.
 */

/* ==========================================================================
   1. ZERO CUMULATIVE LAYOUT SHIFT (0.00 CLS) SYSTEM
   ========================================================================== */

/* Universal Responsive Image Rules */
img,
picture img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  image-rendering: auto;
}

/* Aspect Ratio Utilities - Matching Real INSPEGAS Photo Dimensions */
.aspect-photo-portrait {
  aspect-ratio: 3 / 4;
  width: 100%;
}

.aspect-photo-landscape {
  aspect-ratio: 4 / 3;
  width: 100%;
}

.aspect-photo-square {
  aspect-ratio: 1 / 1;
  width: 100%;
}

.aspect-banner-hero {
  aspect-ratio: 1280 / 506;
  width: 100%;
}

.aspect-banner-onac {
  aspect-ratio: 2 / 1;
  width: 100%;
}

.aspect-flow-pqya {
  aspect-ratio: 1280 / 556;
  width: 100%;
}

.aspect-doc-technical {
  aspect-ratio: 1281 / 906;
  width: 100%;
}

/* Skeleton Loading Shimmer (Zero Layout Shift while image decodes) */
.img-skeleton {
  background-color: #f1f5f9;
  background-image: linear-gradient(
    90deg,
    rgba(241, 245, 249, 1) 0%,
    rgba(226, 232, 240, 0.7) 50%,
    rgba(241, 245, 249, 1) 100%
  );
  background-size: 200% 100%;
  animation: imgSkeletonShimmer 1.8s infinite ease-in-out;
  border-radius: 12px;
  overflow: hidden;
}

.img-skeleton.loaded {
  animation: none;
  background: none;
}

@keyframes imgSkeletonShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ==========================================================================
   2. CONTENT VISIBILITY & OFF-SCREEN PERFORMANCE (INP & RENDERING SPEED)
   ========================================================================== */

/* Sections below fold skip layout calculations until near viewport */
.cv-auto {
  content-visibility: auto;
  contain-intrinsic-size: 1px 700px;
}

.cv-auto-sm {
  content-visibility: auto;
  contain-intrinsic-size: 1px 350px;
}

/* GPU Acceleration for smooth GSAP and scrolling transitions */
.gpu-accel {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ==========================================================================
   3. FONT RENDERING & FOIT PREVENTION
   ========================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans Fallback';
  src: local('Arial');
  ascent-override: 92.5%;
  descent-override: 24.5%;
  line-gap-override: 0%;
  size-adjust: 104.5%;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   4. LUXURY CARD & IMAGE HOVER EFFECTS (HARDWARE ACCELERATED)
   ========================================================================== */

.inspector-card-image {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background-color: #1e2227;
}

.inspector-card-image img {
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1), filter 300ms ease;
  will-change: transform;
}

.inspector-card-image:hover img {
  transform: scale(1.035);
}

/* Credential Badge Overlay for E-E-A-T */
.badge-onac-verified {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(17, 19, 21, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(180, 212, 41, 0.45);
  border-radius: 9999px;
  color: #f8fafc;
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.badge-onac-verified::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #b4d429;
  box-shadow: 0 0 8px #b4d429;
}
