/* ==========================================================================
   Location Funnel — ranamoneeb.com · programmatic location pages
   Extends the v3 funnel grammar (service-funnel.css loads first; every
   section still uses .spf-sec / .spf-wrap / .spf-split). This file adds
   the location-only components:
     - .locf-data-*   real Census stat strip
     - .locf-nearby-* proximity chips (real coordinates)
     - .locf-loc*     searchable "all locations" panel (details/summary,
                      links live in the HTML with or without JS)
   Palette matches spf: navy #0f4c81 / ink #0c2d50 / amber #f59e0b.
   ========================================================================== */

/* ---------- stat strip ---------- */
.locf-data {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
}
.locf-tile {
    background: #fff;
    border: 1px solid #e5ebf3;
    border-radius: 16px;
    padding: 18px 18px 14px;
    box-shadow: 0 1px 2px rgba(14, 47, 82, .04);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.locf-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0f4c81, #2563eb);
}
.locf-tile-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7286a0;
    margin-bottom: 8px;
}
.locf-tile-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: #0c2d50;
    line-height: 1.15;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
}
.locf-tile-note {
    display: block;
    font-size: 12.5px;
    color: #8291a6;
    margin-top: 6px;
    line-height: 1.5;
}
.locf-source {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: #8291a6;
    line-height: 1.6;
}

/* ---------- nearby chips ---------- */
.locf-nearby {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.locf-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #fff;
    border: 1.5px solid #e0e9f4;
    border-radius: 16px;
    padding: 17px 17px 17px 20px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(14, 47, 82, .04);
    transition: border-color .18s, transform .18s, box-shadow .18s;
}
.locf-chip:hover {
    border-color: #f59e0b;
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(14, 47, 82, .12);
}
.locf-chip-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.locf-chip-name {
    font-size: 16.5px;
    font-weight: 800;
    color: #0f4c81;
    line-height: 1.3;
}
.locf-chip:hover .locf-chip-name {
    color: #b45309;
}
.locf-chip-pop {
    font-size: 12.5px;
    font-weight: 600;
    color: #8291a6;
    line-height: 1.4;
}
.locf-chip-arrow {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f4c81, #2563eb);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(15, 76, 129, .25);
    transition: transform .18s;
}
.locf-chip-arrow svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.locf-chip:hover .locf-chip-arrow {
    transform: translateX(4px);
}
.locf-nearby-note {
    margin: 18px 0 0;
    font-size: 14px;
    color: #7286a0;
    line-height: 1.65;
}
.locf-nearby-note a { color: #0f4c81; font-weight: 700; text-decoration: none; border-bottom: 2px solid #d7e4f2; }
.locf-nearby-note a:hover { border-color: #f59e0b; }

/* ---------- searchable locations panel ---------- */
.locf-locpanel {
    background: #fff;
    border: 1px solid #e0e9f4;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(14, 47, 82, .05);
}
.locf-locpanel[open] { box-shadow: 0 18px 44px rgba(14, 47, 82, .10); border-color: #cfe0f1; }
.locf-locbtn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    padding: 20px 26px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: linear-gradient(135deg, #0c2d50 0%, #0f4c81 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.01em;
    transition: filter .18s;
}
.locf-locbtn::-webkit-details-marker { display: none; }
.locf-locbtn:hover { filter: brightness(1.12); }
.locf-locbtn-count {
    flex: none;
    background: rgba(245, 158, 11, .22);
    border: 1px solid rgba(251, 191, 36, .55);
    color: #fcd34d;
    font-size: 12.5px;
    font-weight: 800;
    padding: 5px 13px;
    border-radius: 999px;
}
.locf-locbtn-hint {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, .72);
}
.locf-locbtn::after {
    content: '+';
    flex: none;
    width: 30px; height: 30px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s, background .25s;
}
.locf-locpanel[open] .locf-locbtn::after {
    content: '−';
    background: linear-gradient(135deg, #f59e0b, #f97316);
    transform: rotate(180deg);
}
.locf-locbody { padding: 22px 26px 26px; }
.locf-locfilterrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.locf-locfilter {
    flex: 1;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1.5px solid #dfe7f1;
    border-radius: 11px;
    font-size: 15px;
    font-family: inherit;
    color: #1e293b;
    background: #fbfcfe;
    transition: border-color .18s, box-shadow .18s;
}
.locf-locfilter::placeholder { color: #9aa9bc; }
.locf-locfilter:focus {
    outline: none;
    border-color: #0f4c81;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 76, 129, .10);
}
.locf-locfiltermeta {
    flex: none;
    font-size: 13px;
    font-weight: 700;
    color: #7286a0;
    white-space: nowrap;
}
.locf-locgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 6px 4px;
    max-height: 420px;
    overflow-y: auto;
    padding: 2px;
    scrollbar-width: thin;
}
.locf-loclink {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    text-decoration: none;
    color: #12365c;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    transition: background .14s, color .14s;
}
.locf-loclink:hover { background: #eef4fb; color: #0f4c81; }
.locf-loclink.is-here {
    background: #fef3c7;
    color: #92400e;
    font-weight: 800;
}
.locf-loclink.is-here::after {
    content: 'current';
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #b45309;
    flex: none;
}
.locf-locpop {
    flex: none;
    font-size: 11.5px;
    font-weight: 700;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.locf-locempty {
    display: none;
    padding: 18px 4px 6px;
    font-size: 14.5px;
    color: #7286a0;
}
.locf-locempty.is-shown { display: block; }

/* state strip inside the panel */
.locf-statesrow {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eef2f8;
}
.locf-statesrow-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7286a0;
    margin: 0 0 12px;
}
.locf-statesrow-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.locf-statelink {
    text-decoration: none;
    color: #0f4c81;
    background: #f2f6fb;
    border: 1px solid #e0e9f4;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    transition: background .15s, border-color .15s;
}
.locf-statelink:hover { background: #e7f0fb; border-color: #cfe0f1; }
.locf-statelink.is-here {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
    pointer-events: none;
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
    .locf-data { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .locf-tile { padding: 14px 14px 12px; }
    .locf-tile-value { font-size: 19px; }
    .locf-nearby { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .locf-chip { padding: 14px 13px 14px 15px; gap: 10px; }
    .locf-chip-name { font-size: 15px; }
    .locf-chip-arrow { width: 34px; height: 34px; }
    .locf-chip-arrow svg { width: 15px; height: 15px; }
    .locf-locbtn { padding: 17px 18px; font-size: 15.5px; flex-wrap: wrap; gap: 10px; }
    .locf-locbtn-hint { display: none; }
    .locf-locbody { padding: 18px 16px 20px; }
    .locf-locfilterrow { flex-direction: column; align-items: stretch; gap: 8px; }
    .locf-locfiltermeta { text-align: right; }
    .locf-locgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 360px; }
    .locf-loclink { font-size: 13.5px; padding: 8px 10px; }
}
@media (max-width: 480px) {
    .locf-locgrid { grid-template-columns: 1fr; }
    .locf-nearby { grid-template-columns: 1fr; }
}
