/* Mobile-First Optimizations for HYROX V2 */

/* Enhanced Mobile Hero */
@media (max-width: 768px) {
    .about-section-hero {
        display: none;
    }

    .hero {
        min-height: 60vh;
        padding: 70px 0 80px;
        background-attachment: scroll; /* Better performance on mobile */
    }

    .hero::before {
        background-attachment: scroll !important; /* Fixed backgrounds don't work on mobile */
        background-size: cover;
        background-position: center;
    }

    .hero-content-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hero-badge span {
        font-size: 10px;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 12vw, 4rem);
        line-height: 0.9;
        margin-bottom: 24px;
    }

    .hero-subtitle {
        font-size: 11px;
        line-height: 1.8;
        margin-bottom: 40px;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta a {
        width: 100%;
        text-align: center;
        padding: 18px 24px;
        font-size: 12px;
    }
}

/* Improved Banner Text Mobile */
@media (max-width: 768px) {
    .section-banner-large {
        padding: 60px 0;
    }

    .banner-content h2 {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
        letter-spacing: 0.08em;
        line-height: 1.2;
    }

    .hyrox-title-banner {
        padding: 60px 0;
    }

    .hyrox-title-banner h2 {
        font-size: clamp(1.5rem, 7vw, 2.5rem);
        letter-spacing: 0.08em;
    }

    .race-format-overlay h2 {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
        letter-spacing: 0.08em;
        line-height: 1.3;
    }

    .calendar-banner-special h2 {
        font-size: clamp(1.8rem, 8vw, 3rem);
        letter-spacing: 0.08em;
    }
}

/* Split Sections Mobile Optimization */
@media (max-width: 1200px) {
    .split-content {
        grid-template-columns: 1fr;
    }

    .split-text {
        padding: 60px 40px;
        order: 1;
    }

    .split-image {
        min-height: 350px;
        order: 2;
    }

    /* Keep image first on reverse sections for visual hierarchy */
    .split-section.reverse .split-text {
        order: 2;
    }

    .split-section.reverse .split-image {
        order: 1;
    }
}

@media (max-width: 768px) {
    .split-text {
        padding: 40px 24px;
    }

    .split-text h3 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }

    .split-text h4 {
        font-size: 0.95rem;
        margin-top: 20px !important;
    }

    .split-text p {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 16px;
    }

    /* Tighten race format section spacing */
    .split-section.reverse .split-text h3 {
        margin-bottom: 12px;
    }

    .split-section.reverse .split-text h4 {
        margin-top: 16px !important;
        margin-bottom: 8px;
    }

    .split-section.reverse .split-text p {
        margin-bottom: 12px;
    }

    .split-image {
        min-height: 300px;
    }

    /* Hide race format image on mobile */
    .race-format-img {
        display: none;
    }

    /* Hide hyrox intro image on mobile */
    .hyrox-intro-img {
        display: none;
    }

    .btn-outline {
        width: 100%;
        text-align: center;
        padding: 16px 24px;
    }
}

@media (max-width: 480px) {
    .split-text {
        padding: 32px 20px;
    }

    .split-image {
        min-height: 460px;
    }

    .stations-list {
        gap: 8px;
        margin-top: 12px;
    }

    .station-inline {
        font-size: 12px;
        padding: 5px 0;
    }
}

/* Training Cards Mobile */
@media (max-width: 768px) {
    .services-new {
        padding: 60px 0;
    }

    .section-intro-dark {
        font-size: 15px;
        padding: 0 20px;
        line-height: 1.6;
    }

    .training-cards-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 20px;
    }

    .training-card-new {
        border-width: 1px;
    }

    .training-card-image {
        height: 220px;
    }

    .training-card-content {
        padding: 30px 24px;
    }

    .training-card-content h4 {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .training-card-content p {
        font-size: 13px;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .training-card-image {
        height: 180px;
    }

    .training-card-content {
        padding: 24px 20px;
    }
}

/* Includes Grid Mobile */
@media (max-width: 768px) {
    .includes-section-new {
        padding: 40px 0;
    }

    .includes-grid-new {
        grid-template-columns: 1fr;
        gap: 1px;
    }

    .include-item-new {
        padding: 30px 24px;
        font-size: 12px;
        letter-spacing: 0.08em;
    }
}

@media (max-width: 480px) {
    .include-item-new {
        padding: 24px 20px;
        font-size: 11px;
    }
}

/* Events Carousel Mobile - Enhanced Touch */
@media (max-width: 768px) {
    .events-carousel-inline {
        padding: 40px 0;
    }

    .events-inline-title {
        font-size: 1.5rem;
        margin-bottom: 50px;
        padding: 0 20px;
    }

    .events-carousel-container {
        padding: 0 10px;
        margin: 0 auto;
    }

    .carousel-arrow {
        width: 50px;
        height: 50px;
        font-size: 2rem;
        border-width: 1px;
        /* Better touch target */
        min-width: 50px;
        min-height: 50px;
    }

    .carousel-prev {
        left: -19px;
    }

    .carousel-next {
        right: -19px;
    }

    .events-carousel-track {
        max-width: 400px;
        height: 520px;
    }

    .event-card-carousel {
        padding: 40px 30px;
        min-height: 480px;
    }

    .event-card-carousel h3 {
        font-size: 1.8rem;
        letter-spacing: 0.1em;
        margin-bottom: 16px;
    }

    .event-date-text {
        font-size: 13px;
        margin-bottom: 30px;
    }

    .event-venue {
        font-size: 14px;
        line-height: 1.5;
    }

    .event-status {
        font-size: 13px;
    }

    .btn-event-carousel {
        padding: 16px 32px;
        font-size: 11px;
        /* Better touch target */
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .events-cta-inline {
        margin-top: 60px;
        padding: 0 20px;
    }

    .events-cta-inline p {
        font-size: 15px;
        line-height: 1.6;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .events-carousel-container {
        padding: 0 10px;
    }

    .carousel-arrow {
        width: 44px;
        height: 44px;
        font-size: 1.6rem;
    }

    .carousel-prev {
        left: -19px;
    }

    .carousel-next {
        right: -19px;
    }

    .events-carousel-track {
        max-width: 100%;
        height: 480px;
    }

    .event-card-carousel {
        padding: 32px 24px;
        min-height: 440px;
    }

    .event-card-carousel h3 {
        font-size: 1.5rem;
    }

    /* Hide prev/next on smallest screens for clarity */
    .event-slide.prev,
    .event-slide.next {
        display: none;
    }
}

/* HYROX Logo Mobile */
@media (max-width: 768px) {
    .hyrox-logo-section {
        padding: 50px 0;
    }

    .hyrox-coach-logo {
        max-width: 200px;
    }
}

/* Calendar Mobile */
@media (max-width: 768px) {
    .calendar-section-new {
        padding: 40px 0;
    }

    .calendar-embed-container {
        padding: 20px 12px;
        margin: 40px auto 0;
    }

    .calendar-embed-container iframe {
        min-height: 650px;
    }
}

@media (max-width: 480px) {
    .calendar-embed-container {
        padding: 16px 8px;
    }
}

/* Footer Mobile */
@media (max-width: 768px) {
    .footer {
        padding: 60px 0 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h3 {
        font-size: 1.3rem;
    }

    .footer-section h4 {
        font-size: 1rem;
    }

    .footer-section ul li a:hover {
        padding-left: 0;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

/* Race Format Hero Mobile - Fix Image Repeat */
@media (max-width: 768px) {
    .race-format-hero {
        min-height: 400px;
        background-attachment: scroll;
        background-repeat: no-repeat !important;
        background-size: cover !important;
        background-position: center center !important;
    }

    .race-format-overlay {
        padding: 0 24px;
    }
}

@media (max-width: 480px) {
    .race-format-hero {
        min-height: 300px;
        background-repeat: no-repeat !important;
        background-size: cover !important;
        background-position: center center !important;
    }

    .race-format-overlay {
        padding: 0 20px;
    }

    .race-format-overlay h2 {
        font-size: clamp(1.3rem, 6.5vw, 2rem);
        line-height: 1.2;
    }
}

/* iPhone 12 Pro specific (390px) */
@media (max-width: 390px) {
    .race-format-hero {
        min-height: 280px;
    }

    .race-format-overlay h2 {
        font-size: 1.4rem;
        letter-spacing: 0.05em;
    }
}

/* Typography Mobile Improvements */
@media (max-width: 768px) {
    h2 {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        margin-bottom: 30px;
    }

    h3 {
        font-size: 1.2rem;
        line-height: 1.3;
    }

    h4 {
        font-size: 1rem;
    }

    p {
        font-size: 15px;
        line-height: 1.7;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: clamp(1.5rem, 9vw, 2rem);
    }

    h3 {
        font-size: 1.1rem;
    }

    p {
        font-size: 14px;
    }
}

/* Touch Target Improvements */
@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
        padding: 16px 32px;
        font-size: 11px;
    }

    .nav-menu a {
        padding: 12px 0;
        font-size: 12px;
    }

    .btn-signup {
        min-height: 44px;
        padding: 12px 20px;
    }
}

/* Prevent horizontal scroll */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .container {
        max-width: 100%;
        padding: 0 20px;
    }

    /* Ensure images don't overflow */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Performance: Reduce animations on mobile */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.3s !important;
    }
}
