/* Hero Mobile Specific Styles */

/* Global mobile overflow fix */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    #page, .site {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
}

/* Fix video positioning for mobile */
@media (max-width: 640px) {
    .hero video {
        object-fit: cover;
        object-position: center;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    /* Ensure overlay is properly positioned */
    .hero .tw-bg-black {
        position: absolute;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5); /* Slightly darker for better text contrast on mobile */
    }
}

/* Vertical centering for hero content */
.hero .container-custom {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Mobile-specific hero container adjustments */
@media (max-width: 640px) {
    .hero .container-custom > div {
        width: 100%;
        max-width: 400px; /* Constrain content width on mobile */
        margin: 0 auto;
    }
    
    /* Ensure proper stacking and spacing */
    .hero .tw-flex-col {
        gap: 2rem; /* Increased gap between logo and text */
    }
    
    /* Logo container - centered */
    .hero .tw-flex-shrink-0 {
        margin-bottom: 2rem; /* More space after logo */
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    /* Text container - left aligned */
    .hero header {
        margin-bottom: 1rem;
        text-align: left !important;
    }
    
    /* Override any center alignment for text on mobile */
    .hero .tw-text-left {
        text-align: left !important;
    }
    
    .hero .tw-text-left h1,
    .hero .tw-text-left p {
        text-align: left !important;
    }
    
    /* Button alignment */
    .hero .tw-text-left .btn-primary {
        margin-left: 0;
        margin-right: auto;
    }
}

/* iPhone-specific adjustments */
@media (max-width: 390px) {
    .hero h1 {
        font-size: 1.375rem !important; /* 22px */
    }
    
    .hero p {
        font-size: 0.938rem !important; /* 15px */
    }
    
    .hero img {
        max-height: 80px !important;
    }
}

/* Large phone adjustments */
@media (min-width: 391px) and (max-width: 428px) {
    .hero h1 {
        font-size: 1.625rem !important; /* 26px */
    }
}

/* Ensure proper aspect ratio for hero on mobile */
@media (max-width: 640px) and (min-aspect-ratio: 3/4) {
    .hero {
        min-height: 85vh; /* Slightly shorter on wider phones */
    }
}

/* Safe area adjustments for modern phones */
@supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 640px) {
        .hero {
            padding-bottom: env(safe-area-inset-bottom);
        }
        
        .hero .container-custom {
            padding-left: max(1.5rem, env(safe-area-inset-left));
            padding-right: max(1.5rem, env(safe-area-inset-right));
        }
    }
}

/* Improve text shadow for mobile readability */
@media (max-width: 640px) {
    .hero h1,
    .hero p {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6),
                     0 1px 3px rgba(0, 0, 0, 0.8);
    }
}

/* Smooth transitions for orientation changes */
@media (max-width: 640px) {
    .hero,
    .hero .container-custom,
    .hero h1,
    .hero p,
    .hero img,
    .hero .btn-primary {
        transition: all 0.3s ease-in-out;
    }
}