/* Hero Image Responsive Techniques - Production Ready */

/* Method 1: Fixed Viewport with Controlled Scaling */
.hero-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  /* Prevent layout shift during image loading */
  background-color: #f9f6f0; /* Fallback matching your theme */
}

/* Method 2: Enhanced Background Responsive Control */
.hero-bg-responsive {
  background-attachment: scroll; /* Better for mobile performance */
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: background-position 0.3s ease; /* Smooth transitions */
}

/* Mobile-specific optimizations (up to 767px) */
@media (max-width: 767px) {
  .hero-bg-responsive {
    background-attachment: scroll !important; /* Prevents iOS zoom issues */
    background-position: center 25% !important; /* Focus on upper portion */
    /* Prevent mobile browser zoom */
    touch-action: manipulation;
    user-select: none;
  }
  
  .hero-container {
    /* Disable pull-to-refresh */
    overscroll-behavior-y: contain;
    /* Prevent horizontal scroll */
    overflow-x: hidden;
  }
}

/* Tablet adjustments (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-bg-responsive {
    background-position: center 35% !important; /* Slight adjustment for tablet */
  }
}

/* Desktop optimizations (1024px and up) */
@media (min-width: 1024px) {
  .hero-bg-responsive {
    background-attachment: fixed; /* Parallax effect on desktop only */
    background-position: center center !important; /* Centered for desktop */
  }
}

/* Method 3: Object-fit with Position Control (for img elements) */
.hero-image-responsive {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center; /* Default centered */
}

/* Responsive object positioning */
@media (max-width: 767px) {
  .hero-image-responsive {
    object-position: center 30% !important; /* Move focal point up on mobile */
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-image-responsive {
    object-position: center 40% !important; /* Tablet adjustment */
  }
}

/* Method 4: Prevent Mobile Browser Zoom */
.no-zoom {
  touch-action: manipulation; /* Prevents double-tap zoom */
  user-select: none; /* Prevents text selection that can trigger zoom */
  -webkit-touch-callout: none; /* Prevents iOS callout */
  -webkit-user-select: none; /* Webkit browsers */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE/Edge */
}

/* Method 5: CSS Grid for Precise Control */
.hero-grid-container {
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.hero-grid-image,
.hero-grid-content {
  grid-row: 1;
  grid-column: 1;
}

.hero-grid-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero-grid-content {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Method 6: Performance Optimizations */
.hero-lazy-responsive {
  background-size: cover;
  background-position: center center;
  transition: background-image 0.3s ease;
  will-change: background-position; /* Optimize for animations */
}

/* Method 7: Container Query Support (Modern browsers) */
@container (max-width: 768px) {
  .hero-container-query {
    background-position: center 25% !important;
  }
}

/* Method 8: High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-bg-responsive {
    /* Use higher resolution images for retina displays */
    background-image: url('/src/assets/Red Professional Gradients University Education LinkedIn Single Image Ad.PNG');
  }
}

/* Method 9: Orientation Change Handling */
@media (orientation: portrait) {
  .hero-bg-responsive {
    background-position: center 30%;
  }
}

@media (orientation: landscape) {
  .hero-bg-responsive {
    background-position: center center;
  }
}

/* Method 10: Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .hero-bg-responsive {
    background-attachment: scroll !important; /* Respect motion preferences */
  }
}

/* Critical CSS for preventing layout shift */
.hero-image-loading {
  background-color: #f9f6f0; /* Fallback color */
  background-image: linear-gradient(135deg, #f9f6f0 0%, #e8d5b7 100%);
}