/* Local Resources Finder
   Scope with .lr-* to avoid collisions with existing theme
   Uses Inter via your global base; we re-assert as fallback. */


/* Desktop defaults: hide mobile-only UI */
.lr-mobile-tools,
.lr-filters-close,
.lr-dim {
    display: none !important;
}

/* NEW: Drawer search is mobile-only (hide on desktop) */
.lr-drawer-search {
    display: none !important;
}


.lr-wrap {
    --cch-blue: #0011e3;
    --cch-blue-2: #0056b3;
    --cch-accent: #01eefc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #ffffff;
    --pill: #f1f5f9;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    padding: 24px;
}

.lr-header {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 20px 14px 20px;
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.06);
    margin-bottom: 16px;
}

/* Ensure LR search/header never overlays site header menus */
.lr-wrap,
.lr-header,
.lr-search,
.lr-input-group,
.lr-input {
    position: relative;
    z-index: 0;
    /* below any site menu popovers */
}

/* Keep the site’s global header free to overlay above LR content */
.site-main .lr-header {
    isolation: isolate;
    /* prevents accidental higher stacking via ancestors */
}


.lr-title {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.lr-search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    justify-content: center;
    align-items: center;
}


.lr-search-row--center {
    justify-content: center;
}

.lr-input-group--wide {
    width: 100%;
}

.lr-input--xl {
    height: 52px;
    font-size: 16px;
    border-radius: 14px;
}

.lr-search-btn--xl {
    height: 52px;
    border-radius: 14px;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 800;
}


.lr-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.lr-input {
    flex: 1;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
}

.lr-input:focus {
    border-color: var(--cch-blue-2);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, .12);
}

.lr-btn {
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lr-btn.primary {
    background: var(--cch-blue);
    color: #fff;
}

.lr-btn.primary:hover {
    background: var(--cch-blue-2);
}

.lr-btn.secondary {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.lr-btn.secondary:hover {
    border-color: var(--cch-blue-2);
}

.lr-btn.ghost {
    background: #fff;
    border-color: var(--border);
    color: var(--cch-blue-2);
}

.lr-btn.small {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

.lr-btn.outline {
    background: #fff;
    border-color: var(--border);
}

.lr-btn.disabled {
    opacity: .5;
    pointer-events: none;
}

.lr-panels {
    display: grid;
    grid-template-columns: 280px 1fr 420px;
    gap: 16px;
}

.lr-left,
.lr-mid,
.lr-right {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.06);
    min-height: 520px;
}

.lr-left {
    padding: 16px;
}

.lr-panel-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.lr-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 6px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.lr-services {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.lr-services li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lr-services label {
    color: var(--text);
    font-size: 14px;
}

.lr-mid {
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    /* keep existing presence */
}

/* Results list should scroll inside the middle panel */
.lr-results {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
    flex: 1 1 auto;
    overflow: auto;
}

.lr-status {
    margin: 4px 8px 10px;
    font-size: 13px;
    color: var(--muted);
}

.lr-status--error {
    color: #b91c1c;
}

.lr-status--hide {
    display: none;
}

.lr-results {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.lr-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
}

.lr-card-col--left {
    min-width: 0;
}

.lr-card-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.lr-card-sub {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.lr-pill {
    display: inline-block;
    background: var(--pill);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lr-card-col--right {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 6px;
    align-items: start;
    justify-items: end;
}

.lr-distance {
    font-weight: 700;
    color: var(--cch-blue-2);
    font-size: 13px;
}

.lr-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lr-star {
    width: 16px;
    height: 16px;
}

.lr-star.full path {
    fill: #f59e0b;
}

.lr-star.half path {
    fill: url(#gradHalf);
}

.lr-star.empty path {
    fill: #e2e8f0;
}

.lr-rcount {
    color: var(--muted);
    font-size: 12px;
}

.lr-actions {
    display: inline-flex;
    gap: 8px;
}

.lr-loadmore {
    align-self: center;
    margin: 12px 0 4px;
}

.lr-right {
    overflow: hidden;
    padding: 12px;
}

.lr-map {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border-radius: 16px;
}

@media (max-width: 1200px) {
    .lr-panels {
        grid-template-columns: 250px 1fr;
    }

    .lr-right {
        grid-column: 1/-1;
        height: 420px;
    }

    .lr-map {
        min-height: 420px;
    }
}



.lr-pager {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 10px 0 6px;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

.lr-pagebtn {
    background: #fff;
    border: 1px solid var(--border);
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    padding: 0 10px;
    font-size: 13px;
    cursor: pointer;
}

.lr-pagebtn[aria-current="page"] {
    background: var(--cch-blue);
    color: #fff;
    border-color: var(--cch-blue);
}

.lr-pagebtn:disabled {
    opacity: .5;
    cursor: default;
}

/* --- Local Resources: “Searching…” spinner (matches HCE look) --- */
.lr-spinner {
    display: grid;
    place-items: center;
    min-height: 220px;
}

.lr-spinner::after {
    content: "";
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 4px solid #dbe7ff;
    border-top-color: #0056b3;
    animation: lrSpin .9s linear infinite;
}

@keyframes lrSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Visually-hidden text for screen readers (same approach as HCE .hce-sr) */
.lr-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Google Places dropdown: keep above UI and slightly offset below input */
.pac-container {
    z-index: 2147483643 !important;
    margin-top: 6px;
    border-radius: 12px;
    overflow: hidden;
}

@media (max-width: 860px) {


    /* NEW — hide the desktop search form on mobile */
    .lr-header .lr-search {
        display: none !important;
    }

    /* NEW — show the drawer search on mobile */
    .lr-drawer-search {
        display: grid !important;
    }

    /* Search row stacks neatly */
    .lr-search-row {
        grid-template-columns: 1fr;
    }

    /* Single column layout for panels */
    .lr-panels {
        grid-template-columns: 1fr;
        grid-auto-rows: min-content;
        gap: 12px;
    }


    /* Map container: remove clipping on mobile */
    .lr-right {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        /* ← unlock for bleed */
    }

    /* Map: true viewport-bleed (iOS safe) */
    .lr-map {
        width: 100dvw !important;
        /* ← use dynamic viewport width */
        margin-left: calc(50% - 50dvw) !important;
        margin-right: calc(50% - 50dvw) !important;
        border-radius: 0 !important;
        height: var(--map-h, clamp(300px, 44vh, 420px)) !important;
    }


    .lr-results {
        overflow: visible !important;
        /* avoid any clipping */
    }



    /* ——— Mirror HCE: kill header chrome on mobile; toolbar is the slim sticky bar ——— */
    .lr-wrap {
        padding: 12px 0 0 !important;
    }

    /* less side padding like HCE */
    .lr-header {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }

    /* Slim sticky toolbar (same vibe as HCE .hce-mobile-bar) */
    .lr-mobile-tools {
        position: sticky;
        top: 0;
        z-index: 6;
        /* above page content, below global header menus */
        background: #fff;
        border-bottom: 1px solid rgba(0, 0, 0, .06);
        padding: 0;
        /* no big container padding */
        margin: 0 0 8px 0;
    }

    /* Button style already matches our brand; keep it but ensure tight vertical size */
    .lr-nav-btn {
        height: 48px;
    }

    /* Remove tall desktop minimums for tighter mobile fit */
    .lr-left,
    .lr-mid,
    .lr-right {
        min-height: unset;
    }

    /* Results list should scroll without making the page absurdly tall */
    .lr-mid {
        padding: 10px;
    }

    .lr-results {
        max-height: none;
        overflow: visible;
    }

    /* Keep the autocomplete dropdown perfectly aligned on mobile */
    .pac-container {
        width: 96vw !important;
        left: 2vw !important;
        right: 2vw !important;
    }

    /* Input + "Use my location" should wrap gracefully */
    .lr-input-group {
        flex-wrap: wrap;
        gap: 8px;
    }

    .lr-btn.ghost {
        flex: 0 0 auto;
        height: 44px;
    }


    /* Wider, centered search input on mobile */
    .lr-header .lr-input-group--wide {
        max-width: 720px;
        margin: 0 auto;
    }

    /* Stack the input and move 'Use my location' under it, centered */
    .lr-search-row {
        grid-template-columns: 1fr;
        /* single column */
    }

    .lr-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    #lrUseMyLocation.lr-btn.ghost {
        order: 2;
        align-self: center;
        margin-top: 6px;
        min-width: 200px;
    }


    /* Mobile toolbar placement */
    .lr-mobile-tools {
        display: block !important;
        position: sticky;
        top: 0;
        z-index: 5;
        background: #fff;
        border-bottom: 1px solid rgba(0, 0, 0, .06);
        padding: 0;
        margin: 0 0 8px 0;
    }

    /* HCE-like button */
    .lr-nav-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        width: 100%;
        height: 48px;
        padding: 0 16px;
        border-radius: 14px;
        border: 1px solid #004a99;
        background: linear-gradient(180deg, #0a64c6 0%, #0056b3 100%);
        color: #fff;
        font-weight: 900;
        font-size: 16px;
        line-height: 1;
        box-shadow: 0 6px 16px rgba(0, 86, 179, .24);
    }

    .lr-nav-icon {
        flex: 0 0 auto;
        width: 24px;
        height: 24px;
        aspect-ratio: 1/1;
        display: block;
        object-fit: contain;
        image-rendering: -webkit-optimize-contrast;
    }

    /* Show the drawer close “×” only on mobile */
    .lr-filters-close {
        display: inline-flex !important;
    }


    /* Turn the left panel into a slide-in drawer on mobile */
    body {
        --site-header-h: 56px;
    }

    /* fallback height if your header var isn't set */

    .lr-left {
        position: fixed;
        left: 0;
        top: calc(var(--site-header-h, 56px) + env(safe-area-inset-top, 0px));
        bottom: 0;
        width: min(86vw, 360px);
        max-width: 92vw;
        transform: translateX(-100%);
        /* hidden by default */
        transition: transform .25s ease;
        z-index: 12050;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-top: 16px;
        /* room for close button (was 8px) */

    }

    body.lr-drawer-open .lr-left {
        transform: translateX(0);
    }

    .lr-filters-close {
        position: sticky;
        top: 8px;
        /* a bit more offset so it clears safely */
        margin-left: auto;
        /* pushes to the right */
        margin-right: 8px;
        margin-bottom: 8px;
        width: 30px;
        height: 30px;
        border-radius: 10px;
        border: 1px solid rgba(15, 23, 42, .10);
        background: #fff;
        line-height: 1;
        cursor: pointer;
        z-index: 3;
        /* above drawer contents */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #0f172a;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    }

    .lr-filters-close svg {
        display: block;
        width: 18px;
        height: 18px;
    }

    /* Dim backdrop when drawer is open */
    .lr-dim {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        top: calc(var(--site-header-h, 56px) + env(safe-area-inset-top, 0px));
        bottom: 0;
        background: rgba(12, 18, 28, .45);
        z-index: 12040;
        /* below the drawer */
    }

    body.lr-drawer-open .lr-dim {
        display: block;
    }


    /* Use a column flow to control order on mobile */
    .lr-panels {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* Order: Map above Results (map first) */
    .lr-right {
        order: 1;
    }

    .lr-mid {
        order: 2;
    }

    /* Pager should never overlay content on mobile */
    .lr-pager {
        position: static;
        margin-top: 10px;
        border-top: 1px solid var(--border);
    }

    /* HCE-like content container under the map (no full-bleed; no cropping) */
    .lr-mid {
        padding: 12px 12px 0 !important;
        /* comfortable horizontal breathing room */
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: none !important;
    }

    .lr-results {
        overflow: visible !important;
    }

    .lr-pager {
        padding: 12px 16px 16px !important;
        border-top: 1px solid var(--border);
        width: 100% !important;
        /* normal flow; no negative margins */
        margin: 0 !important;
        justify-content: center;
    }


    /* Modern, taller input on mobile */
    .lr-input--xl {
        height: 52px !important;
        font-size: 16px;
        padding: 0 14px;
    }

    /* Hide desktop-only controls on mobile */
    #lrSearchBtn,
    #lrUseMyLocation {
        display: none !important;
    }

    /* Drawer search group styling */
    .lr-drawer-search {
        display: grid;
        gap: 6px;
        margin: 8px 0 12px;
    }

    .lr-drawer-label {
        font-weight: 900;
        font-size: 13px;
        color: #0f172a;
        letter-spacing: .02em;
    }

    .lr-hint {
        margin: 2px 0 0;
        color: #64748b;
        font-size: 12px;
    }

    /* Drawer theming to match HCE’s left rail */
    .lr-left {
        background: #e6f2ff;
        /* same family as HCE rail */
        border-right: 1px solid rgba(0, 0, 0, .06);
        box-shadow: 0 6px 18px rgba(0, 86, 179, .12);
    }

    /* Make the section title look like a compact banner chip */
    .lr-panel-title {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: 2px 0 12px;
        padding: 12px 14px;
        color: #fff;
        font-size: 15px;
        font-weight: 900;
        background: linear-gradient(180deg, #0a64c6 0%, #0056b3 100%);
        border: 1px solid #004a99;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 86, 179, .18), inset 0 0 0 1px rgba(255, 255, 255, .06);
    }

    /* Close control — right aligned, brand blue (parity with HCE) */
    .lr-filters-close {
        position: sticky;
        top: 8px;
        left: auto;
        right: 8px;
        margin-left: auto;
        margin-right: 8px;

        width: 30px;
        height: 30px;
        border-radius: 10px;

        background: #fff;
        color: var(--cch-blue-2);
        /* #0056b3 icon color via currentColor */
        border: 1px solid #004a99;
        box-shadow: 0 2px 10px rgba(0, 86, 179, .12);

        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        cursor: pointer;
        z-index: 3;
    }

    .lr-filters-close:hover {
        filter: brightness(1.02);
    }

    .lr-filters-close svg {
        width: 18px;
        height: 18px;
    }

    /* Drawer search looks like a card inside the blue rail, like HCE inputs */
    .lr-drawer-search {
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 10px;
        margin: 8px 0 12px;
    }

    .lr-drawer-label {
        font-weight: 900;
        font-size: 13px;
        color: #0f172a;
    }

    .lr-hint {
        color: #64748b;
        font-size: 12px;
    }


}

/* --- Ultra-narrow stacking & tap targets --- */
@media (max-width: 520px) {

    /* Cards become single-column to avoid cramped side-by-side layout */
    .lr-card {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }

    .lr-card-col--right {
        justify-items: start;
        /* align right column content to the left when stacked */
        grid-template-rows: auto auto auto;
        width: 100%;
    }

    /* Make action buttons wrap into rows and stretch nicely for thumbs */
    .lr-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .lr-actions .lr-btn.small {
        height: 40px;
        font-size: 13px;
        width: 100%;
    }

    /* Slightly larger distance text and friendlier spacing */
    .lr-distance {
        font-size: 14px;
    }

    /* Pager buttons: easier to tap */
    .lr-pagebtn {
        min-width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 14px;
    }
}

/* Prevent accidental horizontal scroll on tiny devices */
.lr-wrap {
    overflow-x: hidden;
}

/* Allow edge-to-edge map inside LR only on mobile */
@media (max-width: 860px) {
    .lr-wrap {
        overflow-x: visible !important;
    }
}

/* --- Bottom Ad container (matches the modern blog ad styling) --- */
.lr-bottom-ad {
    margin-top: 16px;
}

.lr-adbox {
    position: relative;
    background: linear-gradient(145deg, #ffffff, #f6faff);
    border: 1px solid #d5e6ff;
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(0, 86, 179, .12);
    padding: 10px;
    min-height: 180px; /* modest floor so layout is stable even before fill */
    display: grid;
    place-items: center;
}

.lr-adbox .adsbygoogle {
    width: 100%;
    min-height: 140px; /* gives responsive unit a reasonable floor */
}

.lr-adbox-label {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 12px;
    color: #7a8cab;
    background: rgba(213, 230, 255, .75);
    border: 1px solid #d5e6ff;
    border-radius: 999px;
    padding: 2px 8px;
}

/* Tighten on small screens */
@media (max-width: 560px) {
    .lr-adbox { min-height: 160px; padding: 8px; }
    .lr-adbox .adsbygoogle { min-height: 120px; }
}
