/* The search modal that opens on load on the homepage, city, business-city and state
   internet pages. One stylesheet for all four so they can't drift apart.

   The modal has one job: get a location into the input. So the input is the only loud
   element (accent border + halo). The Residential/Business tabs, whatever sits under the
   input and the footer all stay quiet on purpose.

   Pages opt in with {% block extra_stylesheets %}. Each page keeps its own ids, body
   class and open/close JS; this file only styles the .search-modal* classes. */

/* ---- Overlay + box ---- */

.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.35);
    z-index: 10009;
    display: none;
}

.search-modal-overlay.active {
    display: block;
}

.search-modal {
    position: fixed;
    z-index: 10010;
    top: var(--modal-top, 50px);
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 560px;
    border-radius: 20px;
    background: #fff;
    color: #111827;
    padding: 38px 36px 22px;
    box-shadow:
        0 24px 64px rgba(15, 23, 42, 0.28),
        0 4px 12px rgba(15, 23, 42, 0.10);
    display: none;
    text-align: center;
}

.search-modal.active {
    display: block;
}

/* Close button floats in the corner so it doesn't cost the heading a row */
.search-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #9aa1ad;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.search-modal-close:hover {
    background: #f1f3f6;
    color: #374151;
}

/* ---- Heading + subtext ----
   These carry the extra .search-modal so they beat the base `.content-section h1` and
   `.content-section p` rules (the modal sits inside .content-section).

   Vertical rhythm down to the input, measured ink to ink on desktop (text baseline to
   the next line's cap top, not box to box):
       title -> subtext        ~28px   (heading margin 16)
       subtext -> tabs         ~31px   (subtext margin 18)
       tab underline -> input   20px   (tabs margin 20)
   Title + subtext are one group and tabs + input are another, so the gap between the
   groups is the largest, but only gently. If you change a font size or line-height
   here, re-check these three rather than the margins. */

.search-modal .search-modal-heading {
    margin: 0 0 16px 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #111827;
    text-wrap: balance;
}

.search-modal .search-modal-subtext {
    margin: 0 0 18px 0;
    color: #5b6472;
    font-size: 15px;
    line-height: 1.45;
    text-align: center;
    text-wrap: balance;
}

.search-modal-subtext a,
.search-modal-note a {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}

.search-modal-subtext a:hover,
.search-modal-note a:hover {
    text-decoration: underline;
}

/* ---- Residential/Business tabs ----
   Quiet text tabs centered above the input. Radios stay in the DOM (visually hidden,
   not display:none) so they keep keyboard focus and arrow keys. */

.search-modal-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 13px;
}

.search-modal-tabs input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.search-modal-tabs label {
    padding: 4px 1px;
    cursor: pointer;
    color: #8a94a3;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.search-modal-tabs label:hover {
    color: #4a5568;
}

.search-modal-tabs input[type="radio"]:checked + label {
    color: #1f2937;
    border-bottom-color: #4f46e5;
}

.search-modal-tabs input[type="radio"]:focus-visible + label {
    outline: 2px solid #4f46e5;
    outline-offset: 3px;
    border-radius: 3px;
}

/* ---- The address input ----
   A thin accent border plus a faint halo, so it reads as "start here" without shouting.
   The halo deepens a little on focus. The !importants beat
   net-generic.css (loaded on city pages), which sets its own geocoder width and an
   !important box-shadow. */

.search-modal .mapboxgl-ctrl-geocoder {
    /* Fills the modal up to a cap, centered (the modal's content area is 488px on desktop).
       The phone/tablet block below lifts the cap, so the box stays full width there. */
    width: 100%;
    min-width: 0;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 14px;
    border: 1.5px solid #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10) !important;
    min-height: 56px;
    transition: box-shadow 0.2s ease;
}

.search-modal .mapboxgl-ctrl-geocoder:focus-within {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18) !important;
}

.search-modal .mapboxgl-ctrl-geocoder input {
    height: 56px;
    font-size: 17px;
    padding-left: 48px;
    border-radius: 12px;
}

/* The container's halo is the focus indicator */
.search-modal .mapboxgl-ctrl-geocoder input:focus {
    outline: none;
}

.search-modal .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon {
    top: 50%;
    transform: translateY(-50%);
}

.search-modal .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon-search {
    left: 14px;
    width: 22px;
    height: 22px;
    fill: #4f46e5;
}

.search-modal .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--button {
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.search-modal .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon-close {
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.search-modal .mapboxgl-ctrl-geocoder .suggestions {
    text-align: left;
}

/* ---- Under the input, homepage: the cell coverage section ----
   Three dots (.search-modal-divider, below), then a soft button to the coverage map,
   then the Coverage app's store badges. The dots and the space around them set this
   apart from the internet search above. .search-modal-coverage is a fit-content column that
   shrinks to the badge pair's width, so the button is exactly as wide as the two badges.
   Gray fill, no border and a shorter height than the input keep the button second. */

.search-modal-coverage {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: fit-content;
    margin: 0 auto; /* the divider above owns the space between them */
}

.search-modal-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 14px;
    box-sizing: border-box;
    border-radius: 12px;
    background: #f3f4f8;
    color: #374151;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    text-wrap: balance;
    transition: background 0.15s ease, color 0.15s ease;
}

.search-modal-row:hover {
    background: #e9ebfa;
    color: #312e81;
}

.search-modal-row-icon {
    flex: none;
    color: #4f46e5;
}

.search-modal-row-arrow {
    flex: none;
    color: #9aa1ad;
    transition: transform 0.15s ease, color 0.15s ease;
}

.search-modal-row:hover .search-modal-row-arrow {
    color: #4f46e5;
    transform: translateX(2px);
}

.search-modal-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.search-modal-badges a {
    display: block;
    line-height: 0;
}

.search-modal-badges img {
    display: block;
    height: 40px;
    width: auto;
}

/* ---- The three-dot separator, and (city and state pages) the line of text after it ----
   "<place> has N internet options – View all". Deliberately plain: no button chrome.

   The dots are drawn (one 3px circle plus two box-shadow copies), not typed. That makes
   the element exactly as tall as the dots, so its margins are the real space around
   them: the same above and below, on every font. */

.search-modal-divider {
    width: 3px;
    height: 3px;
    margin: 30px auto;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    box-shadow: -13px 0 0 rgba(0, 0, 0, 0.15), 13px 0 0 rgba(0, 0, 0, 0.15);
}

/* A line of text carries about 5px of built-in space above its capitals, which a button
   doesn't. Pulling the note up by that much keeps the space under the dots visually
   equal to the space above them (the margins collapse to 30 - 5). */
.search-modal .search-modal-note {
    margin: -5px 0 0 0;
    color: #5b6472;
    font-size: 15px;
    line-height: 1.45;
    text-align: center;
    text-wrap: balance;
}

/* An SVG caret, not the ▼ glyph: the glyph sat at a different height in every font.
   vertical-align: middle centers it on the lowercase letters next to it; the 1px nudge
   up is by eye (Chris, Nov 2026), since dead center read as slightly low. */
.search-modal-note-arrow {
    margin-left: 5px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

/* ---- Footer ---- */

.search-modal-footer {
    margin-top: 26px;
    color: #7b8494;
    font-size: 13px;
}

.search-modal .search-modal-footer p {
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: 1.5;
}

.search-modal .search-modal-footer p:last-child {
    margin-top: 2px;
    text-wrap: balance;
}

.search-modal-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.search-modal-footer a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* The disclosure link is the one footer link sitting inside a sentence, so it gets an
   underline to show it's a link */
.search-modal-footer p:last-child a {
    text-decoration: underline;
    text-decoration-color: #c5cad3;
    text-underline-offset: 2px;
}

.search-modal-footer .separator {
    margin: 0 0.5rem;
    color: #c5cad3;
}

/* ---- Phones ---- */

@media (max-width: 768px) {
    /* Top padding clears the corner close button: headings run nearly as wide as the box here */
    .search-modal {
        width: 92vw;
        max-width: 92vw;
        padding: 42px 16px 16px;
        border-radius: 18px;
    }

    .search-modal-close {
        top: 6px;
        right: 6px;
    }

    .search-modal .mapboxgl-ctrl-geocoder {
        max-width: none;
    }

    .search-modal .search-modal-heading {
        font-size: 25px;
    }

    .search-modal .search-modal-subtext {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .search-modal .search-modal-note {
        font-size: 14px;
    }


    /* Bigger tap targets; extra padding goes on top so the underline stays tight */
    .search-modal-tabs {
        gap: 8px;
        margin-bottom: 16px;
        font-size: 14px;
    }

    .search-modal-tabs label {
        padding: 10px 6px 5px;
    }

    .search-modal-footer {
        margin-top: 20px;
        font-size: 12.5px;
    }

    /* One line at 375px and up; narrower phones get a balanced two-line wrap */
    .search-modal .search-modal-footer p:last-child {
        font-size: 12px;
    }

    /* Opt-outs: the homepage hides its subtext on phones; city and state pages hide the tabs */
    .search-modal .search-modal-desktop-only {
        display: none;
    }
}
