/* ==========================================================================
   Mobile Fixes — EZMatch Landing Page
   Targets: max-width 767px (mobile phones)
   Desktop styles are NOT affected.

   NOTE: Sections 0 and 0b apply to ALL screen sizes (global fixes).
   ========================================================================== */


/* --------------------------------------------------------------------------
   Image loading placeholder — shimmer while lazy images are fetching.
   Once the image loads it covers the background, shimmer disappears.
   Targets only lazy-loaded images so logos/icons are unaffected.
   -------------------------------------------------------------------------- */

img[loading="lazy"] {
    background: linear-gradient(
        90deg,
        #e8e8e8 25%,
        #d4d4d4 50%,
        #e8e8e8 75%
    );
    background-size: 400% 100%;
    animation: ez-img-shimmer 1.4s ease infinite;
}

@keyframes ez-img-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}


/* --------------------------------------------------------------------------
   0. ezv2-header — blog/inner pages use this class but it had zero CSS.
   Applied globally (desktop + mobile). Matches the dark style of index.html.
   -------------------------------------------------------------------------- */

.ezv2-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: #050816 !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

/* Inner flex row */
.ezv2-header-inner {
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 16px;
    gap: 16px;
}

/* Logo: icon + EZMATCH text */
.ezv2-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1;
}
.ezv2-logo img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}
.ezv2-logo span {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.08em;
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Desktop nav links */
.ezv2-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}
.ezv2-nav a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}
.ezv2-nav a:hover { color: #ffffff; }

/* Language selector — dark styled */
.ezv2-lang-select select,
.ezv2-header #langOption {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background-color: #1a1d2e !important;
    padding: 5px 6px !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer;
}

/* Hamburger button: hidden by default on desktop, shown only in mobile media query below */
#mobile-menu-btn {
    display: none;
}

/* Push page body below fixed header */
body.ezv2-light {
    padding-top: 60px;
}

/* Light-theme overrides — must come after dark defaults to win the !important cascade */
.ezv2-light .ezv2-header {
    background: rgba(249, 250, 251, 0.97) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1) !important;
}
.ezv2-light .ezv2-logo span {
    color: #1e293b !important;
}
.ezv2-light .ezv2-lang-select select,
.ezv2-light .ezv2-header #langOption {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    background-color: rgba(243, 244, 246, 0.97) !important;
    border-color: rgba(15, 23, 42, 0.2) !important;
}


/* --------------------------------------------------------------------------
   0b. ezv2-header mobile overrides — collapse nav to hamburger
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {
    .ezv2-header .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .ezv2-header-inner {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
        row-gap: 0;
    }
    /* Flex order: logo | lang | hamburger | nav (full-width below) */
    .ezv2-logo      { order: 1; flex: 1; }
    .ezv2-header-right { order: 10; }
    .ezv2-nav {
        display: none !important;
        order: 20;
        width: 100%;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 8px 0 12px !important;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
    .ezv2-nav.mobile-open {
        display: flex !important;
        background: #050816 !important;
    }
    .ezv2-nav a {
        padding: 13px 16px !important;
        font-size: 13px !important;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        color: rgba(255,255,255,0.75) !important;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .ezv2-nav a:last-child { border-bottom: none; }

    /* Light-theme mobile nav overrides */
    .ezv2-light .ezv2-nav.mobile-open {
        background: rgba(249, 250, 251, 0.98) !important;
        border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
    }
    .ezv2-light .ezv2-nav a {
        color: #374151 !important;
        border-bottom-color: rgba(15, 23, 42, 0.06) !important;
    }
    .ezv2-light #mobile-menu-btn {
        border-color: rgba(15, 23, 42, 0.25) !important;
    }
    .ezv2-light #mobile-menu-btn span {
        background: #374151 !important;
    }
}


/* --------------------------------------------------------------------------
   1. Parallax background — mobile browsers don't support background-attachment:fixed
   Switch to scroll so the hero background image actually renders on iOS/Android
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {
    .parallax-variation {
        background-attachment: scroll !important;
    }
}


/* --------------------------------------------------------------------------
   2. Container: fluid width instead of fixed px
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {
    .container {
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box;
    }
}

@media only screen and (max-width: 479px) {
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}


/* --------------------------------------------------------------------------
   2. Header / Navbar
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {

    /* Header wrapper: allow wrapping so nav can drop to second row */
    header > div {
        height: auto !important;
        min-height: 60px;
        flex-wrap: wrap !important;
        padding: 0 16px !important;
        align-items: center;
        row-gap: 0;
    }

    /* Logo stays on the left, fills remaining space — both header styles */
    header > div > a:first-child,
    .ezv2-logo {
        flex: 1;
    }

    /* Language selector: compact, stays in top bar */
    header #langOption {
        order: 10;
        margin-left: 8px;
        font-size: 11px !important;
        padding: 5px 4px !important;
    }

    /* Hamburger button (injected by mobile-nav.js) */
    #mobile-menu-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        width: 36px;
        height: 36px;
        padding: 7px 6px;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.25);
        border-radius: 6px;
        cursor: pointer;
        order: 11;
        margin-left: 8px;
        flex-shrink: 0;
    }

    #mobile-menu-btn span {
        display: block;
        width: 18px;
        height: 2px;
        background: rgba(255, 255, 255, 0.85);
        border-radius: 2px;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }

    /* Hamburger → X animation */
    #mobile-menu-btn.open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    #mobile-menu-btn.open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    #mobile-menu-btn.open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    /* Nav: hidden by default on mobile, override inline display:flex */
    header nav {
        display: none !important;
        order: 20;
        width: 100%;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 8px 0 12px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 0;
    }

    /* Nav: visible when hamburger is open */
    header nav.mobile-open {
        display: flex !important;
    }

    /* Nav links: full-width tap targets */
    header nav a {
        padding: 13px 4px !important;
        font-size: 13px !important;
        letter-spacing: 0.06em !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.75) !important;
        display: block;
    }

    header nav a:last-child {
        border-bottom: none;
    }

    /* Light-theme general nav overrides */
    .ezv2-light header nav.mobile-open {
        background: rgba(249, 250, 251, 0.98) !important;
    }
    .ezv2-light header nav a {
        color: #374151 !important;
        border-bottom-color: rgba(15, 23, 42, 0.06) !important;
    }
}


/* --------------------------------------------------------------------------
   3. Hero Section — reorder and resize for mobile (index.html only)
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {

    /* Override the Bootstrap float-based grid with flexbox so we can reorder */
    #home-section-wrapper .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    /* All hero columns → full width, no float */
    #home-section-wrapper .col-md-12,
    #home-section-wrapper .col-md-4 {
        float: none !important;
        width: 100% !important;
    }

    /* Order on mobile:
       1. Headline + desc + CTA buttons
       2. App mockup image
       3. Left feature boxes
       4. Right feature boxes
    */
    #home-section-wrapper .col-md-12 {
        order: 1;
    }
    #home-section-wrapper .col-md-4:not(.left):not(.right) {
        order: 2;
    }
    #home-section-wrapper .col-md-4.left {
        order: 3;
    }
    #home-section-wrapper .col-md-4.right {
        order: 4;
    }

    /* Hero top padding: 60px fixed header + 20px breathing room */
    #home-section-wrapper .container {
        padding: 80px 0 0 0 !important;
    }

    /* Description text: full width (was 75%) */
    #home-section-wrapper .desc {
        width: 100% !important;
    }

    /* CTA buttons: tighten bottom gap before image */
    #home-section-wrapper .buttons {
        margin-bottom: 0 !important;
    }
    /* Keep inline-flex so store-badge icon stays LEFT of text, not above */
    #home-section-wrapper .buttons a {
        display: inline-flex !important;
        margin: 0 6px 10px !important;
    }

    /* App mockup image: large hero visual, no extra vertical whitespace */
    #home-section-wrapper .feature-home-image {
        max-height: none !important;
        padding: 8px 0 8px !important;
        text-align: center;
    }

    #home-section-wrapper .feature-home-image img {
        width: 88vw !important;
        max-width: 380px !important;
    }

    /* Feature boxes: tight top/bottom margins */
    .left .feature-box-style-1:first-child {
        margin-top: 12px !important;
    }
    .left .feature-box-style-1:last-child {
        margin-bottom: 8px !important;
    }
    .right .feature-box-style-1:first-child {
        margin-top: 8px !important;
    }
    .right .feature-box-style-1:last-child {
        margin-bottom: 24px !important;
    }

    /* Normalize .left column to match .right column layout on mobile:
       flip icon to left, flip text alignment and padding */
    #home-section-wrapper .col-md-4.left .feature-box-style-1 {
        text-align: left !important;
    }
    #home-section-wrapper .col-md-4.left .feature-box-style-1 .feature-icon {
        float: left !important;
    }
    #home-section-wrapper .col-md-4.left .feature-box-style-1 .feature-title {
        padding-right: 0 !important;
        padding-left: 45px !important;
    }
    #home-section-wrapper .col-md-4.left .feature-box-style-1 .feature-desc {
        padding-right: 0 !important;
        padding-left: 45px !important;
    }
}


/* --------------------------------------------------------------------------
   4. Disable all UIKit scrollspy animations — global (mobile + desktop)

   Two selectors are needed:
   - [data-uk-scrollspy]: targets elements BEFORE UIKit adds the animation class
     (UIKit hides them during the delay period via inline opacity:0)
   - [class*="uk-animation-"]: targets elements AFTER UIKit adds the class
   CSS !important beats UIKit's non-important inline style="opacity:0"
   -------------------------------------------------------------------------- */

[data-uk-scrollspy],
[class*="uk-animation-"] {
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}


/* --------------------------------------------------------------------------
   5. Hero typography — bolder headline + readable body text (mobile)
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {

    /* H1: thin font weight from template is hard to read on small screens */
    #home-section-wrapper .slogan h1 {
        font-weight: 700 !important;
        line-height: 1.2 !important;
    }

    /* Description paragraph: bump size and weight for legibility */
    #home-section-wrapper .desc p {
        font-size: 15px !important;
        font-weight: 400 !important;
        line-height: 1.65 !important;
    }
}


/* --------------------------------------------------------------------------
   6. Hero image gap — reduce transparent whitespace (index.html, mobile)
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {

    /* Remove bottom spacing from headline column */
    #home-section-wrapper .col-md-12 {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Pull image column up to close gap from PNG transparent padding */
    #home-section-wrapper .col-md-4:not(.left):not(.right) {
        margin-top: -24px !important;
        margin-bottom: -24px !important;
    }

    /* Image itself: block to remove inline gap, clip top/bottom transparent space */
    #home-section-wrapper .feature-home-image img {
        display: block;
        margin: 0 auto;
    }
}


/* --------------------------------------------------------------------------
   7. Mobile typography — improve subtitle readability on all pages/locales

   Template defaults: body color #9ea6a4 (muted gray), font-weight:300 (thin)
   On mobile these are too hard to read. Two contexts:
   A) Dark background sections (hero, dark overlays) — keep white, bump weight
   B) Light background sections (features, about, etc.) — darken gray, bump weight
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {

    /* A) Dark-background feature boxes (hero section, index.html) */
    .feature-box-style-1 .feature-desc p {
        font-weight: 400 !important;
        color: rgba(255, 255, 255, 0.92) !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    .feature-box-style-1 .feature-title h4 {
        font-size: 15px !important;
        font-weight: 600 !important;
    }

    /* B) Light-background feature boxes (features.html and other pages) */
    .feature-box-style-2 .feature-desc p {
        font-weight: 400 !important;
        color: #4a5568 !important;
        font-size: 15px !important;
        line-height: 1.65 !important;
    }
    .feature-box-style-2 .feature-title h4 {
        font-weight: 600 !important;
    }

    /* Section subtitles (under section headings like "Why Choose Us?") */
    .section-desc p {
        font-weight: 400 !important;
        color: #4a5568 !important;
        font-size: 15px !important;
    }

    /* General paragraph text on light backgrounds — lift from #9ea6a4 */
    p {
        color: #4a5568;
    }

    /* Section titles: "Why People Choose EZMatch", "How EZMatch Works" etc.
       Default: font-weight:100 (ultra-thin) at 60px — unreadable on mobile.
       Fix: normal size + heavy weight for all language variants */
    .section-title h1 {
        font-size: 26px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        letter-spacing: -0.01em !important;
    }

    /* Feature box style-2 item titles ("Smart Suggestions", "Voice Introduction"…) */
    .feature-box-style-2 .feature-title h4 {
        font-size: 17px !important;
    }

    /* General headings on mobile: bump weight from 'normal' (400) to semi-bold */
    h2, h3, h4 {
        font-weight: 600 !important;
    }
}
