/*
 * MOBILE FOUNDATION 1B — Home mobile shell (above-the-fold + primary discovery).
 * 1B.1 SIMPLIFY DISCOVERY HIERARCHY: removed the separate Schlechtwetter-Modus teaser section this file
 * originally added (product decision - weather is context inside "Was machen wir heute?"/today_entry.blade.php,
 * not a third, separately-branded function; home_mobile_weather_teaser.blade.php is deleted). Added one rule
 * hiding the detailed-categories grid at its mobile position (home_categories.blade.php itself untouched).
 *
 * Scoped to Home only: loaded exclusively from resources/views/frontend/home/home_1.blade.php's own
 * @push('styles') - the same pattern home-sections.css itself already uses - so this file is simply never
 * requested on any other page, never mind applying to one. Everything below additionally lives inside a
 * max-width:767.98px query (or targets a brand-new class with no desktop markup), so Desktop and Tablet are
 * visually untouched. Reuses home-sections.css's own --home-* tokens (green/coral/yellow/turquoise/blue/ink,
 * Exo 2/Asap font stacks) rather than redeclaring them - that file is always loaded first (same @push block,
 * declared above this file's own <link>), so the variables are already in scope.
 *
 * This file does NOT touch style.css, home-hero.css, or home-sections.css - additive only, same discipline as
 * luca-mobile-foundation.css (Foundation 1A).
 */

@media (max-width: 767.98px) {
    /* ==================== spacing rhythm (section 14) ==================== */
    .hero-section-landing,
    .age-groups-section,
    .home-categories-section,
    .home-feature-cards-section,
    .luca-mobile-primary-types {
        padding-left: var(--luca-mobile-page-padding, 16px);
        padding-right: var(--luca-mobile-page-padding, 16px);
    }

    .home-categories-section,
    .home-feature-cards-section,
    .luca-mobile-primary-types {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    /* REAL-DEVICE POLISH: age_groups.blade.php's own inline <style> already scopes a mobile rule to
       this section (padding: 44px 0 48px, a desktop-derived number never revisited for the
       app-shell mobile context). Unlike home-hero.css/home-sections.css (proper <link>ed files in
       <head>, both confirmed overridable by this file's own normal cascade position), that rule is
       a <style> TAG embedded inline in the BODY, at the exact position age_groups.blade.php renders
       - equal specificity (one class), but declared LATER in the document than any <head> <link>,
       so it would otherwise win regardless of this file's own load order. Confirmed empirically
       (computed padding stayed 44/48px without !important) before reaching for !important, not
       assumed - the same "verify with the real cascade, don't guess" discipline this track has
       needed more than once already. */
    .age-groups-section {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    /* home-sections.css's own Highlights section padding (44px 0) is likewise never revisited for
       mobile - see the dedicated Highlights block further down for the card-level compaction that
       does most of the real work on this section's own scroll length. */
    .home-highlights-section {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    /* REAL-DEVICE POLISH: on a real phone the 6 age-range cards (age_groups.blade.php, its own inline
       <style>) read as a bit small/lost against the available width - a few px more icon/label
       presence, not a redesign. min-width/flex-basis (the horizontal-scroll-row mechanics) are left
       exactly as that file already sets them. !important throughout: every one of these competes
       against that same inline <style> tag, not another <head> <link> - see the .age-groups-section
       rule above for why equal-specificity alone isn't enough here (confirmed empirically, each
       property here was verified still showing its old value without !important before adding it). */
    .age-group-card {
        padding-top: 22px !important;
        padding-bottom: 20px !important;
    }

    .age-group-card__icon-wrap {
        width: 64px !important;
        height: 64px !important;
    }

    .age-group-card__icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 24px !important;
    }

    .age-group-card__range {
        font-size: 19px !important;
    }

    /* MOBILE HOME 1B.1 — SIMPLIFY DISCOVERY HIERARCHY: the detailed "Was sucht ihr?" grid (8 real, shuffled
       sub-categories - home_categories.blade.php) is hidden at this position on mobile only, so the first
       discovery cluster stays to the 3 top-level type cards + the two star functions (Was machen wir heute? /
       Was passt zu eurer Familie?) right below, instead of also showing 8 more cards immediately after them.
       The file/route/HomeCategoryDiscovery logic/data are 100% untouched - this is a presentation-only,
       mobile-only display:none, easily reversed by deleting this one rule. Desktop/Tablet (>=768px) keep
       showing it exactly as before. */
    .home-categories-section {
        display: none;
    }

    /* ==================== C. Compact hero ==================== */
    .hero-section-landing {
        padding-top: 20px;
        padding-bottom: 8px;
    }

    /* Decorative corner/shadow SVGs read as desktop-only flourish - already d-none below lg in most cases via
       the existing markup, but the handful that aren't get hidden here too so the compact hero never fights
       them for space. The hero photo itself (img1) stays - it's real product personality, not decoration. */
    .hero-section-landing .element-01,
    .hero-section-landing .element-02,
    .hero-section-landing .element-03,
    .hero-section-landing .shadow-01,
    .hero-section-landing .shadow-02,
    .hero-section-landing .shadow-03,
    .hero-section-landing .shadow-04 {
        display: none;
    }

    .hero-section-landing .main-head {
        text-align: left;
    }

    .hero-section-landing h1.fs-52 {
        font-size: 30px !important;
        line-height: 1.2;
        margin-bottom: 10px !important;
    }

    .hero-section-landing .main-head > p.mb-4 {
        font-size: 15px;
        margin-bottom: 16px !important;
    }

    /* The value/benefit list (real micro-benefits replacing the old fake rating block) stays, but tightened -
       still real content, just less vertical weight competing with Search right below it. */
    .hero-section-landing .luca-hero-value {
        margin-top: 12px;
    }

    .hero-section-landing .luca-hero-value__benefits li {
        font-size: 13px;
    }

    /* banner-img column: Bootstrap's own .col-lg-6 already stacks it below the text at <992px - here it's just
       capped so a tall illustration never pushes Search below the fold. */
    .hero-section-landing .banner-img {
        max-width: 220px;
        margin: 0 auto;
    }

    .hero-section-landing .banner-img img.img2,
    .hero-section-landing .banner-img img.img3 {
        display: none;
    }

    /* ==================== D. Search - the primary functional element on mobile ==================== */
    .luca-hero-search {
        margin-top: 4px;
    }

    .luca-hero-search__panel {
        border-radius: var(--luca-mobile-card-radius, 14px);
        padding: 16px;
    }

    /* VISUAL QA FIX - the actual flex items home-hero.css's .luca-hero-search__tabs lays out are the
       <li class="nav-item"> wrappers (each sized to its own .luca-hero-search__tab button), not the
       buttons directly. Two pre-existing, unrelated rules were both adding horizontal spacing between
       them at once - home-hero.css's own gap:4px on this same selector, AND a legacy Bootstrap-template
       rule elsewhere giving every non-last .nav-item an 8px right margin - so tabs were getting double
       spacing (12px, not 4px) between them. Zeroing gap here removes only the redundant half (the 8px
       legacy margin still provides real, visible spacing) and, combined with trimming this panel's own
       horizontal padding by 4px/side (left untouched in home-hero.css itself, per this file's own
       no-touch discipline), frees enough room that all three German labels - whose combined natural
       width came within ~1px of fitting even before this fix - reliably share one row instead of a
       fragile, easily-retriggered 2+1 wrap. */
    .luca-hero-search__tabs {
        gap: 0;
        padding-left: 2px;
        padding-right: 2px;
    }

    .luca-hero-search__tab {
        flex: 1 1 0;
        text-align: center;
        font-size: 13px;
        padding: 10px 4px;
    }

    /* Ort wählen / Kategorie wählen: full-width, finger-sized selects - the real #stateSelect/#categorySelect
       (and the rentals/events equivalents) are untouched, this is sizing/spacing only. 16px min font-size
       avoids iOS Safari's automatic zoom-on-focus (section 16). */
    .luca-hero-search__fields {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* VISUAL QA FIX - same root cause as the .luca-hero-value fix further down: home-hero.css's own
       .luca-hero-search__field { flex: 1 1 220px; } sets flex-basis:220px as a WIDTH hint for its normal
       row layout, but flipping the container above to flex-direction:column (mobile only) turns that same
       220px into a forced HEIGHT per field - the label+select only need ~70px, so each field was carrying
       ~150px of dead space (300px total across Standort+Kategorie) right where the ticket most wants a
       compact, fast-arriving search widget. */
    .luca-hero-search__field {
        width: 100%;
        flex-basis: auto;
    }

    .luca-hero-search__field select.inpts {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }

    /* Angebote finden */
    .luca-hero-search__cta {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 15px;
    }
}

/* VISUAL QA FIX - home-hero.css's own <575.98px rule switches .luca-hero-value to flex-direction:column, but
   never resets its two children's own flex-basis (240px / 340px, set higher up in that same file for the
   normal flex-direction:row/desktop layout, where flex-basis controls WIDTH). Once the axis flips to column,
   the browser applies that same flex-basis to the cross axis instead - i.e. as a HEIGHT floor - so
   .luca-hero-value__headline and __benefits were each forced to be at least 240px/340px TALL regardless of
   their real (much shorter) content, inflating the whole value block to ~620px of mostly empty space and
   pushing Search far down the page. Not introduced by this Mobile track (home-hero.css predates it) but it
   directly defeats this ticket's own "compact hero, Search arrives soon" goal, so fixed here rather than left -
   a one-line flex-basis reset, scoped to the exact breakpoint where the bug occurs, no visual redesign. */
@media (max-width: 575.98px) {
    .luca-hero-value__headline,
    .luca-hero-value__benefits {
        flex-basis: auto;
    }
}

/* ==================== F. Primary types (Dienstleistungen / Veranstaltungen / Vermietungen) ====================
   New, Home-mobile-only mini-section - 3 cards for the 3 real listing types, each linking straight to its real,
   existing route (services/events/rentals - the exact same ones the hero search's own tabs and header nav
   already use). 1B.1: home_categories.blade.php's own "Was sucht ihr?" grid (8 real, shuffled sub-categories)
   is now hidden at its mobile position (see the .home-categories-section rule above) so this is, for now, the
   only categories-flavored entry point mobile sees in the first discovery cluster - the detailed grid itself
   is untouched and still shows on Desktop/Tablet, and can be reintroduced/polished for mobile in a later
   ticket. */
.luca-mobile-primary-types {
    display: none;
}

@media (max-width: 767.98px) {
    .luca-mobile-primary-types {
        display: block;
    }

    .luca-mobile-primary-types__eyebrow {
        display: block;
        font-family: var(--home-font-body);
        font-size: 13px;
        font-weight: 700;
        color: var(--home-ink);
        opacity: 0.6;
        margin-bottom: 10px;
    }

    .luca-mobile-primary-types__grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .luca-mobile-primary-type-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        text-align: center;
        text-decoration: none;
        background: #ffffff;
        border: 1px solid rgba(17, 24, 39, 0.06);
        border-radius: var(--luca-mobile-card-radius, 14px);
        box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
        padding: 16px 8px 14px;
        min-height: 44px;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .luca-mobile-primary-type-card:hover,
    .luca-mobile-primary-type-card:focus-visible {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(17, 24, 39, 0.1);
        text-decoration: none;
    }

    .luca-mobile-primary-type-card:focus-visible {
        outline: 2px solid var(--home-green);
        outline-offset: 2px;
    }

    /* REAL-DEVICE POLISH: a few px more icon presence for "more visual weight, still tap-friendly,
       not taller" (section 7) - the label's own font-size is deliberately left at 12.5px: the
       Visual QA ticket already measured "Dienstleistungen" (the longest of the 3 labels) fitting
       its card with zero overflow margin at exactly that size, so only the icon grows here. */
    .luca-mobile-primary-type-card__icon {
        width: 46px;
        height: 46px;
        border-radius: 13px;
        display: grid;
        place-items: center;
        font-size: 21px;
        color: #ffffff;
    }

    .luca-mobile-primary-type-card--services .luca-mobile-primary-type-card__icon { background: var(--home-green); }
    .luca-mobile-primary-type-card--events .luca-mobile-primary-type-card__icon { background: var(--home-coral); }
    .luca-mobile-primary-type-card--rentals .luca-mobile-primary-type-card__icon { background: var(--home-blue); }

    .luca-mobile-primary-type-card__label {
        font-family: var(--home-font-body);
        font-size: 12.5px;
        font-weight: 700;
        color: var(--home-ink);
        line-height: 1.25;
    }
}

/* ==================== G. Star functions (Was machen wir heute? / Was passt zu eurer Familie?) ====================
   home-sections.css's own .home-feature-card* already reads as a fairly strong, well-contrasted pair
   (gradient background, 68px orb icon, bold title) - REAL-DEVICE POLISH gives them a touch more
   presence (section 8: "hierarchy, contrast... mantenerlas compactas") without changing their compact
   row layout/min-height/padding, which already keeps them from growing tall. */
@media (max-width: 767.98px) {
    .home-feature-card__orb {
        width: 74px;
        height: 74px;
        font-size: 30px;
    }

    .home-feature-card--today .home-feature-card__orb {
        box-shadow: inset -6px -8px 14px rgba(178, 128, 20, 0.3), 0 12px 22px -8px rgba(242, 189, 72, 0.5);
    }

    .home-feature-card--luca-match .home-feature-card__orb {
        box-shadow: inset -6px -8px 14px rgba(197, 73, 64, 0.3), 0 12px 22px -8px rgba(232, 102, 93, 0.5);
    }
}

/* ==================== H. Highlights für Familien - card compaction ====================
   REAL-DEVICE POLISH: real-device finding - 6 cards at ~563px tall each (full desktop-derived
   proportions: 4:3 image, 20px+ body padding, generous meta spacing) is most of this section's own
   contribution to the "demasiado largo" mobile scroll (section 9 - "reducir card height... NO cambiar
   lógica ni cantidad de resultados"). These are the SAME .luca-listing-card/.listing-card-v2-media
   markup Services already compacts in luca-mobile-services.css, just reached through this section's
   own scope (.home-highlights-section) instead of .luca-public-listing--services - the two page-level
   tickets never touch each other's selectors, but the target values are intentionally the same ones
   already verified on Services, for one consistent "app card" density across the whole Mobile track.

   CORRECTION while verifying this locally: home-sections.css already carries its OWN Highlights-
   specific card compaction (an unconditional `.home-highlights-section .luca-listing-card__media
   .listing-card-v2-media { aspect-ratio: 4/2.65 }`, one class level deeper/more specific than a
   first draft of this block used, plus its own <767.98px override to 4/2.8, 18px title, and a
   40px-tall CTA - under this track's own 44px tap-target floor). Every rule below either matches
   that extra specificity level or uses !important, confirmed empirically rather than assumed after
   the first draft silently lost to it - the same lesson as the .age-groups-section fix above, a
   different cause (specificity, not document order) with the same fix. */
@media (max-width: 767.98px) {
    .home-highlights-section .luca-listing-card__media .listing-card-v2-media {
        aspect-ratio: 3 / 2 !important;
    }

    .home-highlights-section .luca-listing-card__body {
        padding: 12px 14px !important;
    }

    .home-highlights-section .luca-listing-card__title {
        font-size: 1rem !important;
        margin-bottom: 4px !important;
        min-height: 0 !important;
    }

    .home-highlights-section .luca-listing-card__meta,
    .home-highlights-section .luca-listing-card__age,
    .home-highlights-section .luca-listing-card__environment,
    .home-highlights-section .luca-listing-card__price {
        margin-bottom: 6px !important;
    }

    .home-highlights-section .luca-listing-card__footer {
        margin-top: 4px;
    }

    /* Raises the pre-existing 40px CTA back up to this track's 44px tap-target floor (every other
       mobile card in this codebase - Services, Home's own primary-type/age-group cards - already
       meets it; this was the one exception). */
    .home-highlights-section .luca-listing-card__footer .btn {
        min-height: 44px !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}
