/* ==========================================================================
   The pages people browse by place: a state's cities (/locations/washington),
   a city's services (/locations/washington/vancouver-wa) and the header of
   one service in one city (/locations/washington/vancouver-wa/plumbing).

   Every selector is namespaced under .places / .places-* (locations.css is the
   location picker's, a different thing), in the home page's
   style: white, near-black headings, gray supporting text, the brand green
   for actions, and the system sans-serif. Nothing here reaches the site's
   header or footer, or the directory's list of companies.
   ========================================================================== */

.places {
    --places-green: var(--serden-evergreen);
    --places-green-hover: var(--serden-evergreen-hover);
    --places-sage: var(--serden-sage);
    --places-ink: #1D1D1F;
    --places-gray: #6E6E73;
    --places-line: #E5E5EA;
    --places-field: #D2D2D7;
    --places-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --places-section: clamp(56px, 7vw, 96px);

    background-color: #fff;
    font-family: var(--places-font);
    color: var(--places-ink);
}

.places-shell {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 40px);
}

/* ------------------------------------------------------------------ head */

/* The top padding clears the fixed header. */
.places-head {
    padding: 136px 0 0;
}

.places-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 0 0 clamp(20px, 3vw, 32px);
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: var(--places-gray);
}

.places-crumbs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.places-crumbs li + li::before {
    content: "/";
    content: "/" / "";
    color: var(--places-field);
}

.places-crumbs a {
    color: var(--places-gray);
    text-decoration: none;
}

.places-crumbs a:hover,
.places-crumbs a:focus-visible {
    color: var(--places-green);
    text-decoration: underline;
}

.places-crumbs [aria-current="page"] {
    color: var(--places-ink);
}

.places-eyebrow {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--places-green);
}

.places h1 {
    margin: 0;
    font-family: var(--places-font);
    font-size: clamp(2.25rem, 1.55rem + 2.9vw, 4rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--places-ink);
    text-wrap: balance;
}

.places-sub {
    margin: 12px 0 0;
    font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
    line-height: 1.45;
    color: var(--places-gray);
}

/* The box that narrows the list below as someone types (list-filter.js). */
.places-find {
    position: relative;
    margin: clamp(20px, 2.5vw, 28px) 0 0;
}

.places-find i {
    position: absolute;
    top: 50%;
    left: 18px;
    font-size: 15px;
    color: var(--places-gray);
    transform: translateY(-50%);
    pointer-events: none;
}

.places-find input {
    width: 100%;
    height: 52px;
    padding: 0 18px 0 48px;
    border: 1px solid var(--places-field);
    border-radius: 14px;
    background-color: #fff;
    font-family: var(--places-font);
    font-size: 17px;
    color: var(--places-ink);
    -webkit-appearance: none;
    appearance: none;
}

.places-find input::placeholder {
    color: var(--places-gray);
}

.places-find input:focus {
    border-color: var(--places-green);
    outline: 2px solid var(--places-green);
    outline-offset: 1px;
}

/* All, then each first letter the list has. The chosen one is green with a line under it. */
.places-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 0 2px;
    margin: 20px 0 0;
    border-bottom: 1px solid var(--places-line);
}

.places-letters button {
    min-width: 36px;
    height: 42px;
    margin-bottom: -1px;
    padding: 0 8px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    font-family: var(--places-font);
    font-size: 16px;
    font-weight: 600;
    color: var(--places-ink);
    cursor: pointer;
}

.places-letters button:hover {
    color: var(--places-green);
}

.places-letters button[aria-pressed="true"] {
    border-bottom-color: var(--places-green);
    color: var(--places-green);
}

.places-letters button:focus-visible,
.places-list a:focus-visible,
.places-link:focus-visible,
.places-btn:focus-visible {
    outline: 2px solid var(--places-green);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ list */

.places-body {
    padding: clamp(28px, 3.5vw, 40px) 0 var(--places-section);
}

.places-body h2 {
    margin: 0 0 14px;
    font-family: var(--places-font);
    font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--places-ink);
}

.places-group + .places-group {
    margin-top: clamp(32px, 4vw, 48px);
}

/* Alphabetical down each column, three across on desktop. */
.places-list {
    columns: 3;
    column-gap: clamp(24px, 4vw, 56px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.places-list li {
    break-inside: avoid;
}

.places-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--places-line);
    font-size: 17px;
    line-height: 1.3;
    color: var(--places-ink);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.places-list a i {
    flex: none;
    font-size: 0.75em;
    color: var(--places-ink);
}

.places-list a:hover,
.places-list a:focus-visible {
    border-bottom-color: transparent;
    border-radius: 10px;
    background-color: var(--places-sage);
    font-weight: 600;
    color: var(--places-green);
    text-decoration: none;
}

.places-list a:hover i,
.places-list a:focus-visible i {
    color: var(--places-green);
}

.places-empty {
    margin: 12px 0 0;
    font-size: 17px;
    line-height: 1.5;
    color: var(--places-gray);
}

.places-link {
    font-weight: 600;
    color: var(--places-green);
    text-decoration: none;
    text-underline-offset: 3px;
}

.places-link:hover,
.places-link:focus-visible {
    color: var(--places-green-hover);
    text-decoration: underline;
}

/* ------------------------------------------------ one service in one city */

/* "Best plumbers near Greenbrier, AR", a ZIP code box and Find Pros, centred above the companies. */
.places-hero {
    padding: 132px 0 0;
    border-bottom: 1px solid var(--places-line);
    text-align: center;
}

.places-hero .places-crumbs {
    margin-bottom: clamp(28px, 4vw, 48px);
}

/* The headline and the form. On white, as before, for a category without a photo. */
.places-hero-band {
    position: relative;
    isolation: isolate;
    padding: 0 0 clamp(40px, 5vw, 64px);
}

/*
   With the category's photo (CategoryHeroPhotos), the breadcrumb stays on white and the photo runs edge to edge
   from just under it to the bottom of the header. The photos are 3:1 with their subject on the right and a quiet
   middle; a white wash keeps every line of text readable: strongest down the middle, where the headline and the
   form are, and lighter towards the sides, so the trade still shows. Pale gray shows while the photo loads.
*/
.places-hero--photo .places-crumbs {
    margin-bottom: 20px;
}

.places-hero--photo .places-hero-band {
    padding: clamp(44px, 5.5vw, 72px) 0;
}

.places-hero-photo {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background-color: #F5F5F7;
    pointer-events: none;
}

.places-hero-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
}

.places-hero-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgb(255 255 255 / 50%) 0%,
        rgb(255 255 255 / 84%) 24%,
        rgb(255 255 255 / 90%) 38%,
        rgb(255 255 255 / 90%) 62%,
        rgb(255 255 255 / 84%) 76%,
        rgb(255 255 255 / 46%) 100%);
}

/* On the photo the line under the headline is a darker gray, and the ZIP code box lifts off it. */
.places-hero--photo .places-sub {
    font-weight: 500;
    color: #3A3A3C;
}

.places-hero--photo .places-zip-field input {
    box-shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 6px 18px rgb(0 0 0 / 8%);
}

.places-hero h1 {
    max-width: 22ch;
    margin: 0 auto;
    font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem);
}

.places-hero .places-sub {
    margin-top: 14px;
}

.places-zip {
    display: grid;
    gap: 12px;
    width: min(100%, 380px);
    margin: clamp(24px, 3vw, 32px) auto 0;
}

.places-zip-field {
    position: relative;
}

.places-zip-field i {
    position: absolute;
    top: 50%;
    left: 18px;
    font-size: 16px;
    color: var(--places-gray);
    transform: translateY(-50%);
    pointer-events: none;
}

.places-zip-field input {
    width: 100%;
    height: 56px;
    padding: 0 18px 0 46px;
    border: 1px solid var(--places-field);
    border-radius: 14px;
    background-color: #fff;
    font-family: var(--places-font);
    font-size: 18px;
    color: var(--places-ink);
}

.places-zip-field input::placeholder {
    color: var(--places-gray);
}

.places-zip-field input:focus {
    border-color: var(--places-green);
    outline: 2px solid var(--places-green);
    outline-offset: 1px;
}

.places-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 12px 28px;
    border: 0;
    border-radius: 999px;
    background-color: var(--places-green);
    font-family: var(--places-font);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.places-btn:hover,
.places-btn:focus-visible {
    background-color: var(--places-green-hover);
    color: #fff;
    text-decoration: none;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 991.98px) {
    .places-head {
        padding-top: 128px;
    }

    .places-hero {
        padding-top: 124px;
    }

    .places-list {
        columns: 2;
    }
}

@media (max-width: 575.98px) {
    .places-head {
        padding-top: 116px;
    }

    .places-hero {
        padding-top: 112px;
    }

    /* A phone shows about a third of the photo's width: its right-hand side, where the trade is, under an even
       wash, since the text fills the width. */
    .places-hero-photo img {
        object-position: 78% 50%;
    }

    .places-hero-photo::after {
        background: rgb(255 255 255 / 86%);
    }

    .places-list {
        columns: 1;
    }

    .places-letters button {
        min-width: 32px;
        padding: 0 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .places-list a,
    .places-btn {
        transition: none;
    }
}
