/* =============================================
   HERO SECTION - PRODUCTION READY
   Optimized for countyfirstladies.com hero images
   v1.1 | Mobile-first | Performance-optimized
   ============================================= */

/**
 * Hero Container
 * 1. Default 3:2 aspect ratio matching hero-bg1.webp
 * 2. Flex layout for centered content
 * 3. Responsive height control
 */
.hero {
    position: relative;
    min-height: 0;
    padding-bottom: 66.67%; /* 3:2 aspect ratio (1) */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
    background-color: #f0f0f0; /* Fallback color */
}

/**
 * Media Background
 * 1. Absolute positioning for full coverage
 * 2. z-index management
 * 3. Performance optimizations
 */
.media-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background-color: transparent;
    will-change: transform; /* Performance hint */
}

/**
 * Hero Image
 * 1. Perfect aspect-ratio maintenance
 * 2. Smooth transitions
 * 3. Mobile-first optimizations
 */
.media-background__image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
    image-rendering: crisp-edges;
    filter: brightness(1.1);
}

/* Active state for current image */
.media-background__image--active {
    opacity: 1;
    z-index: 1;
}

/**
 * Overlay Gradient
 * 1. Subtle gradient for text readability
 * 2. z-index above image but below content
 */
.media-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0) 40%
    );
    z-index: 2;
}

/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */

@media (min-width: 768px) {
    .hero {
        padding-bottom: 56.25%; /* Switch to 16:9 on larger screens */
        min-height: 60vh; /* Fallback */
    }
}

@media (min-width: 1200px) {
    .hero {
        padding-bottom: 0;
        min-height: 75vh;
    }
}

/* High-density displays */
@media 
(-webkit-min-device-pixel-ratio: 2), 
(min-resolution: 192dpi) { 
    .media-background__image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print styles */
@media print {
    .hero {
        min-height: 0;
        padding-bottom: 0;
        height: 50vh;
    }
    .media-background::after {
        display: none;
    }
}