/* ==========================================================================
   Video Hero Section - Responsive Design
   Mobile-First Approach with Progressive Enhancement
   ========================================================================== */

/* ==========================================================================
   Base Mobile Styles (320px - 767px)
   ========================================================================== */
@media (max-width: 767px) {
    .hero-section {
        height: 100vh;
        min-height: 500px;
        max-height: 800px;
        margin-top: 0; /* Remove negative margin on mobile */
        padding-top: 0; /* Remove top padding */
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    /* Video adjustments for mobile */
    .hero-video {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        min-width: 100%;
        min-height: 100%;
        width: auto;
        height: auto;
        object-fit: cover;
        /* Improve video performance on mobile */
        will-change: transform;
        -webkit-transform: translate3d(-50%, -50%, 0);
        transform: translate3d(-50%, -50%, 0);
    }
    
    /* Optimize overlay for mobile */
    .hero-overlay {
        background: rgba(10, 15, 28, 0.6); /* Slightly darker for better text readability */
    }
    
    /* Content container adjustments */
    .hero-content {
        padding: 2rem 1rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100%;
        width: 100%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    /* Title responsive sizing */
    .hero-title {
        font-size: 4rem; /* 64px base - much bigger */
        font-size: clamp(3rem, 12vw, 6rem); /* Start at 3rem minimum */
        line-height: 1.1;
        margin: 0;
        padding: 0;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: manual;
        text-align: center;
        position: relative;
        letter-spacing: -0.02em;
    }
    
    .hero-title br {
        display: inline; /* Keep line breaks visible on mobile */
    }
    
    /* When there are no buttons, center the title perfectly */
    .hero-content:not(:has(.hero-buttons)) .hero-title,
    .hero-content:last-child .hero-title {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        margin: 0;
    }
    
    /* Button adjustments */
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
        gap: 0.75rem;
        margin-top: 2rem;
        position: absolute;
        bottom: 3rem;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .hero-button {
        width: 100%;
        text-align: center;
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }
    
    /* Admin bar adjustments */
    .admin-bar .hero-section {
        margin-top: 0;
        padding-top: 0;
    }
}

/* ==========================================================================
   Small Mobile (320px - 374px)
   ========================================================================== */
@media (max-width: 374px) {
    .hero-section {
        min-height: 450px;
    }
    
    .hero-content {
        padding: 1.5rem 0.75rem;
    }
    
    .hero-title {
        font-size: 3rem; /* 48px - minimum size */
        margin: 0;
        letter-spacing: -0.02em;
    }
    
    .hero-buttons {
        max-width: 260px;
    }
    
    .hero-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   Medium Mobile (375px - 479px)
   ========================================================================== */
@media (min-width: 375px) and (max-width: 479px) {
    .hero-title {
        font-size: 3.5rem; /* 56px */
        letter-spacing: -0.02em;
    }
}

/* ==========================================================================
   Specific rule for up to 480px
   ========================================================================== */
@media (max-width: 480px) {
    .hero-title {
        font-size: 3rem !important; /* Exactly 3rem as requested */
        letter-spacing: -0.02em;
    }
}

/* ==========================================================================
   Large Mobile (480px - 767px)
   ========================================================================== */
@media (min-width: 480px) and (max-width: 767px) {
    .hero-section {
        min-height: 550px;
    }
    
    .hero-content {
        padding: 2rem 1.5rem;
    }
    
    .hero-title {
        font-size: 5rem; /* 80px - even bigger */
        margin: 0;
        letter-spacing: -0.03em;
    }
    
    .hero-buttons {
        flex-direction: row;
        max-width: none;
        justify-content: center;
    }
    
    .hero-button {
        width: auto;
        min-width: 140px;
    }
}

/* ==========================================================================
   Tablet Portrait (768px - 900px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 900px) {
    .hero-section {
        height: 100vh;
        min-height: 600px;
        max-height: 900px;
        margin-top: -80px;
        padding-top: 80px;
    }
    
    .hero-content {
        padding: 3rem 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 4rem; /* 64px */
        font-size: clamp(3rem, 9vw, 4.5rem);
        margin-bottom: 2.5rem;
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-title br {
        display: inline; /* Restore line breaks on tablets */
    }
    
    .hero-buttons {
        justify-content: center;
        gap: 1.25rem;
    }
    
    .hero-button {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-width: 150px;
    }
    
    .admin-bar .hero-section {
        margin-top: -112px;
        padding-top: 112px;
    }
}

/* ==========================================================================
   Tablet Landscape (901px - 1024px)
   ========================================================================== */
@media (min-width: 901px) and (max-width: 1024px) {
    .hero-section {
        height: 90vh;
        min-height: 650px;
    }
    
    .hero-content {
        padding: 3rem;
        text-align: left;
    }
    
    .hero-title {
        font-size: 4.5rem; /* 72px */
        font-size: clamp(3.5rem, 8vw, 5rem);
        text-align: left;
        max-width: 1000px;
    }
    
    .hero-buttons {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   Small Desktop (1025px - 1280px)
   ========================================================================== */
@media (min-width: 1025px) and (max-width: 1280px) {
    .hero-title {
        font-size: clamp(4rem, 8vw, 6rem);
        max-width: 1100px;
    }
}

/* ==========================================================================
   Landscape Orientation Mobile (Height Priority)
   ========================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        height: 100vh;
        min-height: 400px;
    }
    
    .hero-content {
        padding: 1.5rem 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-buttons {
        margin-top: 1rem;
    }
    
    .hero-button {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   Video Performance Optimizations
   ========================================================================== */

/* Pause video on mobile to save battery and data */
@media (max-width: 767px) and (hover: none) {
    .hero-video {
        /* Add poster frame for mobile */
        background-color: var(--blaze-secondary, #0A0F1C);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .hero-video {
        display: none;
    }
    
    .hero-section {
        background-color: var(--blaze-secondary, #0A0F1C);
        background-image: linear-gradient(135deg, #0A0F1C 0%, #1a1f2e 100%);
    }
}

/* ==========================================================================
   iOS Safari Specific Fixes
   ========================================================================== */
@supports (-webkit-touch-callout: none) {
    .hero-section {
        /* Fix iOS viewport height issues */
        height: 100vh;
        height: -webkit-fill-available;
    }
    
    .hero-video {
        /* Ensure video plays inline on iOS */
        -webkit-playsinline: true;
        playsinline: true;
    }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    .hero-button {
        /* Larger touch targets */
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-button:active {
        transform: scale(0.98);
    }
}

/* ==========================================================================
   High Resolution Displays
   ========================================================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .hero-section {
        height: auto;
        min-height: auto;
        page-break-inside: avoid;
    }
    
    .hero-video {
        display: none;
    }
    
    .hero-overlay {
        display: none;
    }
    
    .hero-content {
        padding: 1rem;
        color: black;
    }
    
    .hero-title {
        color: black !important;
        font-size: 24pt !important;
    }
    
    .hero-buttons {
        display: none;
    }
}

/* ==========================================================================
   Fallback for No JavaScript
   ========================================================================== */
.no-js .hero-video {
    display: none;
}

.no-js .hero-section {
    background: linear-gradient(135deg, var(--blaze-secondary, #0A0F1C) 0%, #2a3142 100%);
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.hero-section.is-loading .hero-video {
    opacity: 0;
    transition: opacity 1s ease;
}

.hero-section.is-loaded .hero-video {
    opacity: 1;
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */
.hero-section:focus-within .hero-content {
    outline: 3px solid var(--blaze-primary, #FF6B35);
    outline-offset: -3px;
}

.hero-button:focus-visible {
    outline: 3px solid white;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);
}