/* Home app layout for phones and tablets below 1024px; Desktop and GEO markup stay unchanged. */
.luca-home-visual,
.luca-home-shortcuts { display: none; }
.age-group-card__range--compact { display: none; }

@media (max-width: 1023.98px) {
    .luca-home-discovery {
        display: flex;
        flex-direction: column;
        background: #fcfcfa;
        padding-bottom: 24px;
    }

    .luca-home-discovery > .hero-section-landing,
    .luca-home-discovery > .luca-mobile-primary-types,
    .luca-home-discovery > .home-feature-cards-section,
    .luca-home-discovery > .home-more-luca-section,
    .luca-home-discovery > .home-categories-section { display: none; }

    /* MOBILE FINAL CLEANUP: the back-to-top hide that used to live here (Home-only) is now a single,
       global rule in luca-mobile-foundation.css (every Public + Family Mobile page, not just Home) -
       removed from here to keep it in one place, not two. */

    .luca-home-discovery > .age-groups-section { order: 1; }
    .luca-home-discovery > .luca-home-shortcuts { order: 2; }
    .luca-home-discovery > .luca-hero-search { order: 3; }
    .luca-home-discovery > .luca-nearby-section { order: 4; }
    .luca-home-discovery > .home-highlights-section { order: 5; }
    /* Keep the existing collapsed width and #luca-match deep-link toggle contract. */
    .luca-home-discovery > .luca-match-section { order: 5; }
    .luca-home-discovery > .home-provider-cta { order: 6; }

    /* HERO CLEANUP: __body is now a full-height overlay beside the character (left column, same plane as
       the photo) instead of a card stacked below/overlapping it - the real photo (luca-home-mobile.jpg)
       has a wide flat/empty band on its left two-thirds with the character on the right, which is what
       makes this layout possible without covering him. object-position is pushed hard right so his full
       reach (hat/raised hands) stays in frame once the box is taller-relative-to-width than the photo's
       own native ratio; confirmed via mockup against the real file, not guessed. */
    .luca-home-visual {
        position: relative;
        display: block;
        padding: 0;
        margin: 12px 16px 0;
        border-radius: 24px;
        overflow: hidden;
        background: #e5f4ef;
        box-shadow: 0 5px 24px rgba(43, 85, 63, .06);
        min-height: clamp(206px, 56vw, 248px);
    }
    .luca-home-visual__art {
        position: absolute;
        inset: 0;
    }
    .luca-home-visual__art img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 97% 50%;
    }
    .luca-home-visual__body {
        position: relative;
        z-index: 1;
        max-width: 50%;
        min-height: 100%;
        padding: 16px 10px 16px 18px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    /* FINAL POLISH: brand label -> two-tone headline -> subcopy, no CTA. Colors are one step darker than the base brand
       tokens (#6eaa89 green / #e8665d coral) because both sit on the mint photo: #245f43 = 5.3:1+, #c9453c = 3.3:1+ (large
       bold text needs 3:1) against the photo's mint, where the base coral measures only ~2.3:1. Text stays inside the
       photo's empty left band (the character starts at ~51% of the width). */
    .luca-home-visual__body h2 {
        font-family: var(--home-font-heading, 'Exo 2', sans-serif);
        font-size: clamp(20px, 5.4vw, 24px);
        line-height: 1.14;
        letter-spacing: -.4px;
        font-weight: 800;
        margin: 0 0 6px;
    }
    .luca-home-visual__green,
    .luca-home-visual__coral { display: block; }
    .luca-home-visual__green { color: #245f43; }
    .luca-home-visual__coral { color: #c9453c; }
    .luca-home-visual__brand {
        margin: 0 0 4px;
        color: #2f5243;
        font-size: 12.5px;
        font-weight: 700;
        letter-spacing: .02em;
        line-height: 1.2;
    }
    .luca-home-visual__sub {
        color: #2f5243;
        font-size: 12.5px;
        line-height: 1.4;
        margin: 0;
    }
    .luca-home-discovery .age-groups-section {
        padding: 22px 16px 14px !important;
        background: transparent;
    }
    .luca-home-discovery .age-groups-section .container { padding: 0; }
    .luca-home-discovery .age-groups-header { margin: 0 0 12px; text-align: left; }
    .luca-home-discovery .age-groups-title { font-size: 20px; margin: 0; }
    .luca-home-discovery .age-groups-eyebrow,
    .luca-home-discovery .age-groups-subtitle,
    .luca-home-discovery .age-groups-subtext,
    .luca-home-discovery .age-groups-blob,
    .luca-home-discovery .age-group-card__desc,
    .luca-home-discovery .age-group-card__cta,
    .luca-home-discovery .age-group-card__icon-halo { display: none; }
    .luca-home-discovery .age-groups-track {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
        overflow: visible;
        scroll-snap-type: none;
        padding: 0;
        margin: 0;
    }
    .luca-home-discovery .age-group-card {
        min-width: 0;
        min-height: 84px;
        padding: 10px 6px !important;
        border-radius: 16px;
        gap: 5px;
        box-shadow: 0 2px 8px rgba(36, 77, 59, .035);
        background-image: none;
        background-color: var(--age-card-tint-rich);
    }
    .luca-home-discovery .age-group-card__icon-wrap { width: 34px !important; height: 34px !important; margin: 0; }
    .luca-home-discovery .age-group-card__icon { width: 34px !important; height: 34px !important; font-size: 16px !important; box-shadow: none; }
    .luca-home-discovery .age-group-card__range { font-size: 17px !important; line-height: 1.2; margin: 0; }
    .luca-home-discovery .age-group-card__range--full { display: none; }
    .luca-home-discovery .age-group-card__range--compact { display: block; }
    .luca-home-discovery .age-group-card:active,
    .luca-home-discovery .age-group-card[aria-current="true"] {
        border-color: #244d3b;
        box-shadow: inset 0 0 0 2px #244d3b;
        transform: none;
    }

    .luca-home-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 16px 20px; }
    .luca-home-shortcut {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 14px;
        border-radius: 18px;
        min-width: 0;
        color: #244d3b;
        background: #d9efe6;
    }
    .luca-home-shortcut--beta { background: #fff0cf; color: #674b23; }
    .luca-home-shortcut__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #9fdfd7; margin-bottom: 8px; }
    .luca-home-shortcut--beta .luca-home-shortcut__icon { background: #f2bd48; }
    .luca-home-shortcut strong { font-size: 18px; line-height: 1.2; margin-bottom: 5px; }
    .luca-home-shortcut > span:not(.luca-home-shortcut__icon) { font-size: 12px; line-height: 1.4; }
    .luca-home-shortcut__arrow { position: absolute; top: 23px; right: 15px; font-size: 12px; }
    .luca-home-shortcut:hover { color: #244d3b; }

    .luca-home-discovery .luca-hero-search { margin: 0 0 10px !important; scroll-margin-top: 80px; }
    .luca-home-discovery .luca-hero-search__panel { padding: 12px !important; border: 1px solid #edf0ec; border-radius: 20px !important; box-shadow: 0 4px 16px rgba(36, 77, 59, .04); }
    .luca-home-discovery .luca-hero-search__tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px !important; gap: 2px !important; background: #f2f5f1; border-radius: 12px; margin-bottom: 14px; }
    .luca-home-discovery .luca-hero-search__tabs .nav-item { margin: 0; min-width: 0; }
    .luca-home-discovery .luca-hero-search__tab { width: 100%; padding: 10px 2px !important; font-size: 11px !important; min-height: 44px; border-radius: 9px; }
    .luca-home-discovery .luca-hero-search__tab.active { background: #6eaa89; color: #fff; }
    .luca-home-discovery .luca-hero-search__tabs .nav-item:nth-child(2) { order: 2; }
    .luca-home-discovery .luca-hero-search__tabs .nav-item:nth-child(3) { order: 1; }
    .luca-home-discovery .luca-hero-search__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px !important; }
    .luca-home-discovery .luca-hero-search__field { min-width: 0; }
    /* Preserve Select2's one-pixel hidden native control after the legacy select sizing rules. */
    .luca-home-discovery .luca-hero-search__field select.select2-hidden-accessible {
        width: 1px !important;
        height: 1px !important;
        min-height: 0 !important;
    }
    .luca-home-discovery .luca-hero-search__field label { font-size: 12px; margin-bottom: 5px; }
    .luca-home-discovery .luca-hero-search__field .select2-container { max-width: 100%; }
    .luca-home-discovery .luca-hero-search__field .selection,
    .luca-home-discovery .luca-hero-search__field .select2-selection--single { width: 100%; min-width: 0; }
    .luca-home-discovery .luca-hero-search__field .select2-selection--single { min-height: 44px; border-radius: 10px; }
    .luca-home-discovery .luca-hero-search__field .select2-selection__rendered { font-size: 14px; padding-left: 10px; padding-right: 22px; }
    .luca-home-discovery .luca-hero-search__cta { grid-column: 1 / -1; min-height: 44px; font-size: 14px; border-radius: 12px; }
    .luca-home-discovery .luca-nearby-section { padding: 0; margin: 20px 0 10px; }

    .luca-home-discovery .home-highlights-section { padding: 20px 0; background: transparent; }
    .luca-home-discovery .home-highlights-header { margin-bottom: 14px; }
    .luca-home-discovery .home-highlights-title { font-size: 20px; }
    .luca-home-discovery .home-highlights-subtitle { display: none; }
    .luca-home-discovery .home-highlights-grid > :nth-child(n+4) { display: none; }
    .luca-home-discovery .home-highlights-grid {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 16px;
        padding: 4px 0 10px;
        scrollbar-width: none;
    }
    .luca-home-discovery .home-highlights-grid > .luca-listing-card {
        flex: 0 0 82%;
        max-width: 300px;
        scroll-snap-align: center;
    }
    .luca-home-discovery .home-provider-cta { padding: 20px 0; min-height: 0; }
    .luca-home-discovery .home-provider-cta__panel { padding: 16px; gap: 14px; }
    .luca-home-discovery .home-provider-cta h2 { font-size: 20px; }
    .luca-home-discovery .home-provider-cta p { font-size: 13px; }
    .luca-home-shortcut:focus-visible { outline: 3px solid #244d3b; outline-offset: 3px; }
}

/* Home-only tablet shell. This sheet is loaded by home_1.blade.php, so other public,
   Family and Provider pages retain their existing responsive contracts. */
@media (min-width: 768px) and (max-width: 1023.98px) {
    body.home-ten.luca-has-mobile-bottom-nav {
        padding-bottom: calc(var(--luca-mobile-bottom-nav-height) + var(--luca-mobile-safe-bottom));
    }
    .home-ten .luca-mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        inset: auto 0 0;
        z-index: 1040;
        align-items: stretch;
        justify-content: space-between;
        background: #fff;
        border-top: 1px solid rgba(48, 45, 42, .08);
        box-shadow: var(--luca-mobile-shadow);
        padding-bottom: var(--luca-mobile-safe-bottom);
        height: calc(var(--luca-mobile-bottom-nav-height) + var(--luca-mobile-safe-bottom));
    }
    .home-ten footer.footer-landing,
    .home-ten hr.linear-line,
    .home-ten .back-to-top,
    .header .header-navbar-rht,
    .header .main-menu-wrapper > ul.main-nav,
    .header .navbar-brand.logo { display: none !important; }

    .header .navbar.header-nav { min-height: 68px; padding: 6px 0; }
    .header .navbar-header {
        display: flex;
        position: relative;
        width: 100%;
        min-height: 56px;
        align-items: center;
        justify-content: space-between;
    }
    .header #mobile_btn {
        display: inline-flex;
        position: static;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        margin: 0;
    }
    .header #mobile_btn .bar-icon span { background: #244d3b; }
    .header .navbar-brand.logo-small {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        padding: 0;
        margin: 0;
    }
    .header .navbar-brand.logo-small img { width: auto; height: 44px; max-height: 44px; }
    .header .luca-mobile-appbar-guest {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        margin-left: auto;
        min-height: 44px;
        color: #244d3b;
        font-weight: 700;
    }
    .header .luca-mobile-appbar-home-actions {
        display: flex !important;
        align-items: center;
        gap: 12px;
        margin-left: auto;
    }
    .header .luca-mobile-appbar-home-actions__bell,
    .header .luca-mobile-appbar-home-actions__avatar {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }
    .header .luca-mobile-appbar-home-actions__bell img { width: 20px; height: 20px; }
    .header .luca-mobile-appbar-home-actions__avatar img {
        width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
    }
    .header .main-menu-wrapper {
        position: fixed;
        inset: 0 auto 0 0;
        width: 300px;
        margin: 0;
        overflow-y: auto;
        z-index: 11111;
        transform: translateX(-100%);
        transition: transform .3s;
        background: #fff;
    }
    html.menu-opened .header .main-menu-wrapper { transform: translateX(0); }
    .header .menu-header { display: flex; }
    .home-ten .luca-mobile-drawer { display: flex !important; }

    .luca-home-visual { min-height: 320px; margin: 16px 24px 0; }
    .luca-home-visual__body { padding: 40px 24px; }
    .luca-home-visual__body h2 { font-size: 34px; }
    .luca-home-visual__brand,
    .luca-home-visual__sub { font-size: 16px; }
    .luca-home-discovery .age-groups-track { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .luca-home-shortcuts { margin-left: 24px; margin-right: 24px; }
    .luca-home-shortcut { padding: 20px; }
    .luca-home-discovery .luca-hero-search__tab { font-size: 14px !important; }
    .luca-home-discovery .luca-hero-search__fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .luca-home-discovery .luca-hero-search__cta { grid-column: auto; align-self: end; }
    .luca-nearby-track__item,
    .luca-home-discovery .home-highlights-grid > .luca-listing-card { flex-basis: 42%; max-width: 340px; }
}
