/*
 * TRUSKEYS — MOBILE HERO
 * Enfold Child Theme / css/07-hero-mobile.css
 *
 * Scope:
 * - Mobile Hero visibility and layout
 * - Mobile/tablet-portrait Hero frame, imagery, captions and CTAs
 * - Small-phone and large-phone responsive adjustments
 * - 601px–767px mobile Hero frame correction
 * - 767px–768px fractional-width Mobile Hero rules
 *
 * Desktop Hero rules and the 768px–989px PC Hero extension
 * are managed by 06-hero-desktop.css.
 */

/* =========================================================
   01. MOBILE HERO — ORIGINAL BASELINE
   ========================================================= */

/* ========================================================================
   TRUSKEYS MOBILE HERO SLIDER 1 — CLEAN BASELINE
   Current 393px phone appearance preserved.
   Responsive rules are defined separately for phone, large-phone, and
   tablet-portrait widths. The verified 393px phone baseline is preserved.

   Enfold: Fullwidth Easy Slider
   Slider class: truskeys-mobile-hero
   Slider 1 heading class: mhero-s1-title
   Caption: Left without Frame
   CTA label HTML: <span class="mhero-cta-label">...</span>
   ======================================================================== */

/* ---------------------------------------------------------
   1. Visibility
   --------------------------------------------------------- */
@media (min-width: 800px) {
    #top .truskeys-home-hero {
        display: block !important;
        visibility: visible !important;
    }

    #top .truskeys-mobile-hero {
        display: none !important;
    }
}

@media (max-width: 799px) {
    #top .truskeys-home-hero {
        display: none !important;
    }

    #top .truskeys-mobile-hero {
        display: block !important;
    }
}


/* ---------------------------------------------------------
   2. SHARED MOBILE / TABLET BASE <= 799px
   393px current visual baseline:
   - Hero 550px
   - caption X shift -20px
   - support top -20px
   - CTA top -25px
   - CTA 165 x 28px
   --------------------------------------------------------- */
@media (max-width: 799px) {

    /* Hero frame */
    #top .truskeys-mobile-hero .avia-slideshow-inner {
        position: relative !important;

        height: 550px !important;
        min-height: 550px !important;
        max-height: 550px !important;

        overflow: hidden !important;
    }

    #top .truskeys-mobile-hero .avia-slideshow-inner > li,
    #top .truskeys-mobile-hero .avia-slideshow-inner > li > .avia-slide-wrap {
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: hidden !important;
    }

    #top .truskeys-mobile-hero .avia-slideshow-inner > li > .avia-slide-wrap {
        display: block !important;
        position: relative !important;
    }

    /* Hero image */
    #top .truskeys-mobile-hero
    .avia-slideshow-inner > li > .avia-slide-wrap > img,

    #top .truskeys-mobile-hero
    .avia-slideshow-inner > li > .avia-slide-wrap > picture > img {
        position: absolute !important;
        inset: 0 !important;

        width: 100% !important;
        height: 100% !important;

        max-width: none !important;
        max-height: none !important;

        object-fit: cover !important;
        object-position: 50% 58% !important;
    }

    #top .truskeys-mobile-hero
    .avia-slideshow-inner > li > .avia-slide-wrap > picture {
        position: absolute !important;
        inset: 0 !important;

        width: 100% !important;
        height: 100% !important;
    }

    /* Slider 1 caption */
    #top .slideshow_caption:has(.mhero-s1-title) {
        position: absolute !important;

        top: 0 !important;
        bottom: auto !important;
        left: 0 !important;
        right: 0 !important;

        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;

        padding: 21px 24px 0 !important;
        margin: 0 !important;

        /* Final manual correction: align copy with mobile logo */
        transform: translateX(-20px) !important;

        box-sizing: border-box !important;

        text-align: left !important;

        background: transparent !important;
    }

    #top .slideshow_caption:has(.mhero-s1-title) .slideshow_inner_caption,
    #top .slideshow_caption:has(.mhero-s1-title) .slideshow_align_caption {
        width: 100% !important;
        max-width: none !important;

        height: auto !important;
        min-height: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        text-align: left !important;

        background: transparent !important;
        box-shadow: none !important;
    }

    /* Heading wrapper */
    #top .mhero-s1-title,
    #top h1.mhero-s1-title,
    #top h2.mhero-s1-title {
        margin: 0 0 3px !important;
        padding: 0 !important;

        font-size: 0 !important;
        line-height: 1 !important;
        letter-spacing: normal !important;

        text-shadow: none !important;
    }

    #top .mhero-s1-eyebrow {
        display: block !important;

        margin: 0 0 6px !important;

        color: #168fd5 !important;

        font-size: 11px !important;
        line-height: 1.35 !important;
        letter-spacing: .105em !important;
        font-weight: 700 !important;

        text-transform: uppercase !important;
        white-space: nowrap !important;

        text-shadow: none !important;
    }

    #top .mhero-s1-main {
        display: block !important;

        max-width: 100% !important;

        color: #12315f !important;

        font-size: 23px !important;
        line-height: 1.17 !important;
        font-weight: 700 !important;
        letter-spacing: -.035em !important;

        overflow-wrap: normal !important;
        word-break: normal !important;

        text-shadow: none !important;
    }

    #top .slideshow_caption:has(.mhero-s1-title) .avia-caption-content {
        margin: 0 !important;
        padding: 0 !important;
        text-shadow: none !important;
    }

    #top .mhero-s1-support {
        position: relative !important;
        top: -20px !important;

        display: block !important;

        max-width: 345px !important;

        margin: 0 0 8px !important;

        color: #3f536d !important;

        font-size: 12px !important;
        line-height: 1.4 !important;
        font-weight: 400 !important;

        text-shadow: none !important;
    }

    /* CTA group */
    #top .mhero-s1-cta {
        position: relative !important;
        top: -25px !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;

        gap: 2px !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    #top .mhero-s1-cta a.mhero-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        width: 165px !important;
        min-width: 0 !important;
        max-width: 100% !important;

        height: 28px !important;
        min-height: 0 !important;

        margin: 0 !important;
        padding: 0 8px !important;

        box-sizing: border-box !important;

        border: 1px solid #168fd5 !important;
        border-radius: 8px !important;

        font-size: 12px !important;
        line-height: 1 !important;
        font-weight: 700 !important;
        letter-spacing: 0 !important;

        text-align: center !important;
        text-decoration: none !important;
        white-space: nowrap !important;

        text-shadow: none !important;
        box-shadow: none !important;
    }

    /* Two-layer CTA text centering */
    #top .mhero-s1-cta a.mhero-btn .mhero-cta-label {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        width: 100% !important;
        height: 100% !important;

        margin: 0 !important;
        padding: 0 !important;

        line-height: 1 !important;
        white-space: nowrap !important;

        transform: translateY(-1px) !important;
    }

    #top .mhero-s1-cta a.mhero-btn-primary,
    #top .mhero-s1-cta a.mhero-btn-primary:visited {
        background: #128bce !important;
        color: #ffffff !important;
    }

    #top .mhero-s1-cta a.mhero-btn-secondary,
    #top .mhero-s1-cta a.mhero-btn-secondary:visited {
        background: rgba(255,255,255,.88) !important;
        color: #137fb9 !important;
    }

    #top .mhero-s1-cta a.mhero-btn-primary:hover {
        background: #087ab7 !important;
        color: #ffffff !important;
    }

    #top .mhero-s1-cta a.mhero-btn-secondary:hover {
        background: #ffffff !important;
        color: #105b91 !important;
    }
}


/* ---------------------------------------------------------
   3. SMALL PHONES <= 374px
   Preserve the compact-phone tuning.
   --------------------------------------------------------- */
@media (max-width: 374px) {

    #top .truskeys-mobile-hero .avia-slideshow-inner {
        height: 530px !important;
        min-height: 530px !important;
        max-height: 530px !important;
    }

    #top .slideshow_caption:has(.mhero-s1-title) {
        padding: 19px 20px 0 !important;
    }

    #top .mhero-s1-main {
        font-size: 21px !important;
    }

    #top .mhero-s1-support {
        font-size: 11.5px !important;
    }

    #top .mhero-s1-cta a.mhero-btn {
        width: 204px !important;
    }
}


/* ---------------------------------------------------------
   4. LARGE PHONES 400px–600px
   Preserve the existing larger-phone values.
   --------------------------------------------------------- */
@media (min-width: 400px) and (max-width: 600px) {

    #top .truskeys-mobile-hero .avia-slideshow-inner {
        height: 570px !important;
        min-height: 570px !important;
        max-height: 570px !important;
    }

    #top .slideshow_caption:has(.mhero-s1-title) {
        padding: 24px 27px 0 !important;
    }

    #top .mhero-s1-main {
        font-size: 24px !important;
    }
}


/* ---------------------------------------------------------
   5. LARGE PHONES / NARROW TABLETS 601px–767px
   Keep text aligned with the tablet header logo and scale the CTA.
   --------------------------------------------------------- */
@media (min-width: 601px) and (max-width: 767px) {

    /* Preserve the current 78% crop for other images in this mobile Hero. */
    #top .truskeys-mobile-hero
    .avia-slideshow-inner > li > .avia-slide-wrap > img:not(.wp-image-2830),
    #top .truskeys-mobile-hero
    .avia-slideshow-inner > li > .avia-slide-wrap > picture > img:not(.wp-image-2830) {
        object-position: 50% 78% !important;
    }

    /* Target image 2830 only: align its content to the bottom of the Hero frame.
       This gives one consistent image-position baseline across 601–767px,
       without per-width translateY patches. */
    #top #full_slider_1
    .avia-slideshow-inner > li > .avia-slide-wrap > img.wp-image-2830,
    #top #full_slider_1
    .avia-slideshow-inner > li > .avia-slide-wrap > picture > img.wp-image-2830 {
        object-position: 50% 100% !important;
    }

    #top .truskeys-mobile-hero .avia-slideshow-inner {
        height: clamp(590px, 80vw, 630px) !important;
        min-height: clamp(590px, 80vw, 630px) !important;
        max-height: clamp(590px, 80vw, 630px) !important;
    }

    #top .slideshow_caption:has(.mhero-s1-title) {
        padding: clamp(24px, 3.5vw, 30px) 44px 0 !important;
    }

    #top .mhero-s1-eyebrow {
        font-size: 12px !important;
        margin-bottom: 7px !important;
    }

    #top .mhero-s1-main {
        max-width: 520px !important;
        font-size: clamp(24px, 3.5vw, 27px) !important;
        line-height: 1.15 !important;
    }

    #top .mhero-s1-support {
        max-width: 480px !important;
        font-size: clamp(12.5px, 1.8vw, 14px) !important;
        line-height: 1.42 !important;
    }

    #top .mhero-s1-cta {
        gap: 5px !important;
    }

    #top .mhero-s1-cta a.mhero-btn {
        width: 205px !important;
        height: 34px !important;
        font-size: 13px !important;
        border-radius: 9px !important;
    }
}


/* ---------------------------------------------------------
   6. TABLET PORTRAIT 768px–799px
   The mobile Hero remains active below 800px, so its full layout,
   image crop, typography, and button styles must remain active here.
   --------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 799px) {

    #top .truskeys-mobile-hero .avia-slideshow-inner {
        height: clamp(630px, 82vw, 800px) !important;
        min-height: clamp(630px, 82vw, 800px) !important;
        max-height: clamp(630px, 82vw, 800px) !important;
    }

    #top .slideshow_caption:has(.mhero-s1-title) {
        /* Match the caption's left edge to the 601–767px layouts. */
        padding: clamp(28px, 3.5vw, 36px) 48px 0 92px !important;
    }

    #top .mhero-s1-eyebrow {
        font-size: clamp(12px, 1.3vw, 14px) !important;
        margin-bottom: 8px !important;
    }

    #top .mhero-s1-main {
        max-width: 560px !important;
        font-size: clamp(28px, 3.2vw, 32px) !important;
        line-height: 1.15 !important;
    }

    #top .mhero-s1-support {
        max-width: 500px !important;
        font-size: clamp(14px, 1.5vw, 15px) !important;
        line-height: 1.45 !important;
    }

    #top .mhero-s1-cta {
        gap: 8px !important;
    }

    #top .mhero-s1-cta a.mhero-btn {
        width: clamp(210px, 23vw, 230px) !important;
        height: 42px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
        padding: 0 12px !important;
    }
}




















/* TEST ONLY — Mobile Hero 601–767px */
@media only screen and (min-width: 601px) and (max-width: 767px) {

  /* 1. Define the visible Hero frame */
  #top #full_slider_1 {
    height: min(85svh, 150vw) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* 2. Force all slider layers to follow the frame */
  #top #full_slider_1 .avia-slideshow,
  #top #full_slider_1 .avia-slideshow-inner,
  #top #full_slider_1 .avia-slideshow-inner > li,
  #top #full_slider_1 .avia-slideshow-inner > li > .avia-slide-wrap {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* 3. Establish the image positioning container */
  #top #full_slider_1 .avia-slideshow-inner > li > .avia-slide-wrap {
    position: relative !important;
  }

  /* 4. Keep original image ratio and align its bottom */
  #top #full_slider_1 .avia-slideshow-inner > li > .avia-slide-wrap > img.wp-image-2830 {
    position: absolute !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    transform: none !important;
  }

}


/* =========================================================
   MOBILE HERO — FRACTIONAL WIDTH 767px < width < 768px
   Replays the mobile Hero baseline for the fractional breakpoint.
   ========================================================= */

@media screen and (767px < width < 768px) {

    /* ==== 766px baseline copied: Mobile Hero 601–767px typography (source line 4117) ==== */
    /* Preserve the current 78% crop for other images in this mobile Hero. */
    #top .truskeys-mobile-hero
    .avia-slideshow-inner > li > .avia-slide-wrap > img:not(.wp-image-2830),
    #top .truskeys-mobile-hero
    .avia-slideshow-inner > li > .avia-slide-wrap > picture > img:not(.wp-image-2830) {
        object-position: 50% 78% !important;
    }

    /* Target image 2830 only: align its content to the bottom of the Hero frame.
       This gives one consistent image-position baseline across 601–767px,
       without per-width translateY patches. */
    #top #full_slider_1
    .avia-slideshow-inner > li > .avia-slide-wrap > img.wp-image-2830,
    #top #full_slider_1
    .avia-slideshow-inner > li > .avia-slide-wrap > picture > img.wp-image-2830 {
        object-position: 50% 100% !important;
    }

    #top .truskeys-mobile-hero .avia-slideshow-inner {
        height: clamp(590px, 80vw, 630px) !important;
        min-height: clamp(590px, 80vw, 630px) !important;
        max-height: clamp(590px, 80vw, 630px) !important;
    }

    #top .slideshow_caption:has(.mhero-s1-title) {
        padding: clamp(24px, 3.5vw, 30px) 44px 0 !important;
    }

    #top .mhero-s1-eyebrow {
        font-size: 12px !important;
        margin-bottom: 7px !important;
    }

    #top .mhero-s1-main {
        max-width: 520px !important;
        font-size: clamp(24px, 3.5vw, 27px) !important;
        line-height: 1.15 !important;
    }

    #top .mhero-s1-support {
        max-width: 480px !important;
        font-size: clamp(12.5px, 1.8vw, 14px) !important;
        line-height: 1.42 !important;
    }

    #top .mhero-s1-cta {
        gap: 5px !important;
    }

    #top .mhero-s1-cta a.mhero-btn {
        width: 205px !important;
        height: 34px !important;
        font-size: 13px !important;
        border-radius: 9px !important;
    }

    /* ==== 766px baseline copied: Bottom-aligned Mobile Hero frame (source line 4245) ==== */
  /* 1. Define the visible Hero frame */
  #top #full_slider_1 {
    height: min(85svh, 150vw) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* 2. Force all slider layers to follow the frame */
  #top #full_slider_1 .avia-slideshow,
  #top #full_slider_1 .avia-slideshow-inner,
  #top #full_slider_1 .avia-slideshow-inner > li,
  #top #full_slider_1 .avia-slideshow-inner > li > .avia-slide-wrap {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* 3. Establish the image positioning container */
  #top #full_slider_1 .avia-slideshow-inner > li > .avia-slide-wrap {
    position: relative !important;
  }

  /* 4. Keep original image ratio and align its bottom */
  #top #full_slider_1 .avia-slideshow-inner > li > .avia-slide-wrap > img.wp-image-2830 {
    position: absolute !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    transform: none !important;
  }

    /* Keep the Mobile Hero visible and the Desktop Hero hidden. */
    #top .truskeys-home-hero {
        display: none !important;
    }

    #top #full_slider_1,
    #top .truskeys-mobile-hero {
        display: block !important;
        visibility: visible !important;
    }
}


/* ================= END MOBILE HERO CSS ================= */
