/*
 * MOBILE CATEGORY CARDS V1 — shared phone/tablet pattern for Home's 3 "X in deiner Nähe" sections
 * (Dienstleistungen/Veranstaltungen/Vermietungen). One file, one pattern - only the section's own modifier
 * class (.luca-nearby-section--service/--events/--rentals) exists for any genuinely type-specific exception,
 * and none is needed yet.
 *
 * Markup: frontend/theme_1/partials/home_nearby_category.blade.php (included 3x from home_1.blade.php). Each
 * card inside .luca-nearby-track is a real, full .luca-listing-card instance - the SAME partial/CSS
 * (luca-public-listing.css) Home's own "Highlights für Familien" section already uses. This file does NOT
 * restyle the card itself, only the horizontal swipe track that holds up to 3 of them and the section's own
 * header/CTA - avoiding a second, divergent card design (the ticket's own "no crear 3 diseños distintos" rule
 * applies just as much to "a 4th design that isn't Highlights' either").
 *
 * Swipe: pure CSS scroll-snap (overflow-x:auto + scroll-snap-type:x mandatory), no slider library - matching
 * the one other horizontal-scroll precedent already in this codebase (age_groups.blade.php's own inline style).
 * No arrows: optional per the ticket, and three cards already fit a natural one-swipe gesture, so none were
 * added for V1.
 *
 * Scope: every rule lives inside @media (max-width: 1023.98px) except the one-time ".luca-nearby-section"
 * default `display:none`. Desktop (>=1024px) renders nothing from this file at all - the section's own view
 * logic already only ever executes inside home_1.blade.php, which is Home-only, but the CSS-hidden-by-default
 * contract is kept anyway, the same belt-and-suspenders guarantee home_mobile_primary_types/luca-mobile-home.css
 * already use throughout.
 */

.luca-nearby-section {
    display: none;
}

@media (max-width: 1023.98px) {
    .luca-nearby-section {
        display: block;
        margin: 28px 0;
    }

    .luca-nearby-section .container {
        padding-left: var(--luca-mobile-page-padding, 16px);
        padding-right: var(--luca-mobile-page-padding, 16px);
    }

    .luca-nearby-header {
        margin-bottom: 14px;
    }

    .luca-nearby-title {
        margin: 0;
        font-family: var(--home-font-heading, 'Exo 2', 'Asap', system-ui, sans-serif);
        font-weight: 700;
        font-size: 19px;
        color: var(--home-ink, #302d2a);
    }

    /* ==================== swipe track: centered, scroll-snap, no JS ====================
       Negative margin + matching padding lets the track bleed to the viewport edge (so a partially-visible
       neighbor card is reachable) while .container above keeps the header/CTA text aligned to the normal
       page gutter. scroll-padding mirrors the track's own side padding so the FIRST/LAST card can also
       reach true center, not just the ones in between. */
    .luca-nearby-track {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 16px;
        margin: 0 calc(var(--luca-mobile-page-padding, 16px) * -1);
        padding: 4px var(--luca-mobile-page-padding, 16px) 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .luca-nearby-track::-webkit-scrollbar {
        display: none;
    }

    .luca-nearby-track__item {
        flex: 0 0 82%;
        max-width: 300px;
        scroll-snap-align: center;
    }

    /* The card's own internal layout (image/body/footer) is untouched - only its width/height here, since
       luca-public-listing.css normally sizes it via a CSS grid column, which this flex track replaces. */
    .luca-nearby-track__item .luca-listing-card {
        height: 100%;
    }

    .luca-nearby-cta {
        margin-top: 4px;
        text-align: center;
    }

    .luca-nearby-cta__link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 20px;
        border-radius: var(--luca-mobile-card-radius, 14px);
        border: 1px solid var(--home-green, #6eaa89);
        color: var(--home-green, #6eaa89);
        font-weight: 600;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .luca-nearby-cta__link:hover,
    .luca-nearby-cta__link:focus-visible {
        background: rgba(110, 170, 137, 0.08);
        color: var(--home-green, #6eaa89);
    }
}

@media (min-width: 1024px) {
    /* Explicit and redundant with the default display:none above on purpose - same "readable on its own"
       guarantee every other Mobile-only section in this codebase already states twice. */
    .luca-nearby-section {
        display: none !important;
    }
}
