/* Hero Section Responsive Styles */

/* Fix body overflow and override Enfold's min-width */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important; /* Override Enfold's 910px min-width */
}

/* Ensure proper box sizing */
* {
    box-sizing: border-box;
}

/* Fix common overflow culprits */
#page, .site {
    overflow-x: hidden;
    width: 100%;
}

/* Base styles for hero section */
.hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    max-width: 100vw;
}

/* Mobile-first approach for hero section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure hero takes up appropriate space on different devices */
@media (max-width: 640px) {
    .hero {
        min-height: 100vh;
        padding-top: 60px; /* Account for mobile navbar */
        padding-bottom: 2rem;
    }
    
    /* Adjust when admin bar is present */
    body.admin-bar .hero {
        padding-top: calc(60px + 46px);
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .hero {
        min-height: 70vh;
    }
}

/* Video background optimization for mobile */
@media (max-width: 768px) {
    .hero video {
        /* Center the video on mobile */
        left: 50%;
        transform: translateX(-50%);
        min-width: 100%;
        min-height: 100%;
        width: auto;
        height: auto;
    }
}

/* Hero content spacing adjustments */
@media (max-width: 640px) {
    /* Add padding to prevent content from touching edges */
    .hero .container-custom {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100vh - 60px);
    }
    
    /* Mobile typography sizes */
    .hero h1 {
        font-size: 1.5rem; /* 24px */
        line-height: 1.3;
        margin-bottom: 0.75rem;
        letter-spacing: -0.02em;
        text-align: left !important;
    }
    
    .hero p {
        font-size: 1rem; /* 16px */
        line-height: 1.5;
        margin-bottom: 1rem;
        opacity: 0.95;
        text-align: left !important;
    }
    
    /* Logo sizing for mobile */
    .hero img {
        max-height: 96px !important; /* Match Figma design */
        height: auto;
        width: auto;
        margin: 0 auto;
    }
    
    /* Button mobile styling */
    .hero .btn-primary {
        font-size: 0.875rem; /* 14px */
        padding: 0.625rem 1.5rem;
        min-width: 140px;
    }
}

/* Small tablet adjustments */
@media (min-width: 640px) and (max-width: 768px) {
    .hero {
        min-height: 80vh;
    }
    
    .hero h1 {
        font-size: 1.875rem; /* 30px */
    }
    
    .hero p {
        font-size: 1.125rem; /* 18px */
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero h1 {
        font-size: 2.5rem; /* 40px */
    }
    
    .hero p {
        font-size: 1.25rem; /* 20px */
    }
}

/* Button responsive styles */
.btn-primary {
    display: inline-block;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

@media (max-width: 640px) {
    .btn-primary {
        width: auto;
        text-align: center;
        display: inline-block;
    }
}

/* Ensure proper z-index stacking */
.hero .tw-z-0 {
    z-index: 0;
}

.hero .tw-z-10 {
    z-index: 10;
    position: relative;
}

/* Improve text readability on all devices */
.hero h1,
.hero p,
.hero a {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Loading optimization */
.hero video {
    will-change: transform;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .hero video {
        display: none;
    }
    
    .hero {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero .tw-bg-opacity-40 {
        background-color: rgba(0, 0, 0, 0.7);
    }
    
    .hero h1,
    .hero p {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    }
}

/* Focus visible styles for keyboard navigation */
.hero a:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(0, 174, 66, 0.5);
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: 3rem;
    }
    
    .hero .container-custom {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        min-height: calc(100vh - 3rem);
    }
    
    .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .hero img {
        max-height: 60px !important;
    }
    
    .hero .btn-primary {
        padding: 0.5rem 1.25rem;
        font-size: 0.813rem;
    }
}