/* =======================================================================
 * Areas Served — Atlas (Light Paper / Warm Ivory)
 *
 * Ivory ground with deep espresso ink for maximum legibility. The Figma
 * tan (#9E7F61) is retained as an atmospheric accent only — corner ticks,
 * eyebrow dots, dashed rule lines, CTA anchor strip — never as body bg.
 * Brand green is the lone saturated accent; everything else is warm
 * neutrals doing quiet editorial work.
 * ==================================================================== */

.prp-atlas {
    --atlas-ink:         #1A1510;   /* deep espresso */
    --atlas-ink-strong:  #0F0B07;
    --atlas-ink-muted:   #4A3B2C;   /* body-weight brown */
    --atlas-ink-dim:     #7A6B56;   /* subtle labels */

    --atlas-bg:          #FAF5EC;   /* page ivory — warm, readable */
    --atlas-bg-alt:      #F1E7D1;   /* soft hero glow */
    --atlas-surface:     #FFFFFF;   /* county card top */
    --atlas-surface-2:   #FBF4E3;   /* county card bottom */

    --atlas-rule:        rgba(26, 21, 16, 0.12);
    --atlas-rule-strong: rgba(26, 21, 16, 0.22);

    --atlas-tan:         #9E7F61;   /* accent only — ticks, dashes, CTA strip */
    --atlas-tan-dark:    #6D533A;

    --atlas-accent:      #01A34D;
    --atlas-accent-hi:   #01BF5A;
    --atlas-accent-soft: rgba(1, 163, 77, 0.14);

    background: var(--atlas-bg);
    color: var(--atlas-ink);
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    padding-bottom: 0;
}

.prp-atlas > *,
.prp-atlas *,
.prp-atlas *::before,
.prp-atlas *::after { box-sizing: border-box; }

/* ── Hero ── */
.prp-atlas__hero {
    position: relative;
    padding: 104px 24px 88px;
    border-bottom: 1px solid var(--atlas-rule);
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 65% at 18% 10%, rgba(255, 255, 255, 0.55), transparent 65%),
        radial-gradient(ellipse 70% 55% at 92% 90%, var(--atlas-bg-alt), transparent 70%),
        var(--atlas-bg);
}

/* Contour-line texture — subtle espresso ink on ivory paper */
.prp-atlas__topo {
    position: absolute;
    inset: -10%;
    pointer-events: none;
    opacity: 0.55;
    background:
        repeating-radial-gradient(
            ellipse 900px 560px at 22% 35%,
            transparent 0,
            transparent 46px,
            rgba(26, 21, 16, 0.055) 47px,
            transparent 48px
        ),
        repeating-radial-gradient(
            ellipse 620px 440px at 80% 75%,
            transparent 0,
            transparent 54px,
            rgba(109, 83, 58, 0.08) 55px,
            transparent 56px
        );
    mask-image: radial-gradient(ellipse 80% 90% at 50% 50%, #000 60%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 50%, #000 60%, transparent 100%);
}

.prp-atlas__hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1160px;
    margin: 0 auto;
    animation: prp-atlas-fade 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.prp-atlas__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 15px 7px 10px;
    border-radius: 9999px;
    border: 1px solid var(--atlas-tan);
    background: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--atlas-tan-dark);
    box-shadow: 0 1px 2px rgba(26, 21, 16, 0.04);
}

.prp-atlas__eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--atlas-accent);
    box-shadow: 0 0 0 3px rgba(1, 163, 77, 0.24);
    animation: prp-atlas-pulse 2.4s ease-in-out infinite;
}

.prp-atlas__title {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: clamp(54px, 10vw, 132px);
    line-height: 0.94;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin: 26px 0 22px;
    color: var(--atlas-ink-strong);
}

.prp-atlas__title em {
    font-style: italic;
    font-weight: 500;
    color: var(--atlas-accent);
    text-transform: none;
    font-family: 'Oswald', sans-serif;
    letter-spacing: -0.01em;
    position: relative;
    padding: 0 0.04em;
}

.prp-atlas__title em::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.06em;
    height: 0.14em;
    background: linear-gradient(90deg, transparent, rgba(1, 163, 77, 0.55) 15%, rgba(1, 163, 77, 0.55) 85%, transparent);
    transform: skewX(-8deg);
}

.prp-atlas__lede {
    max-width: 640px;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--atlas-ink-muted);
}

.prp-atlas__lede strong {
    color: var(--atlas-ink);
    font-weight: 600;
}

/* Search + legend toolbar */
.prp-atlas__toolbar {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.prp-atlas__search {
    position: relative;
    flex: 1 1 320px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: 58px;
    border: 1px solid var(--atlas-rule-strong);
    border-radius: 9999px;
    background: #ffffff;
    color: var(--atlas-ink-muted);
    box-shadow: 0 1px 2px rgba(26, 21, 16, 0.04);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.prp-atlas__search:focus-within {
    color: var(--atlas-ink);
    /* no border-color change, no focus ring */
}

.prp-atlas__search-input:focus,
.prp-atlas__search-input:focus-visible,
.prp-atlas__search-input:active {
    outline: none;
    box-shadow: none;
    border: none;
}

.prp-atlas__search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--atlas-ink);
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.prp-atlas__search-input::placeholder {
    color: var(--atlas-ink-dim);
}
.prp-atlas__search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.prp-atlas__legend {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--atlas-ink-muted);
}

.prp-atlas__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.prp-atlas__legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.prp-atlas__legend-item--linked .prp-atlas__legend-swatch {
    background: var(--atlas-accent);
    box-shadow: 0 0 0 2px rgba(1, 163, 77, 0.28);
}

.prp-atlas__legend-item--served .prp-atlas__legend-swatch {
    background: transparent;
    border: 1.5px solid var(--atlas-ink-dim);
}

/* ── County grid ── */
.prp-atlas__grid {
    max-width: 1160px;
    margin: 0 auto;
    padding: 80px 24px 104px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
    position: relative;
}

.prp-atlas__county {
    position: relative;
    padding: 30px 28px 32px;
    background:
        linear-gradient(180deg, var(--atlas-surface) 0%, var(--atlas-surface-2) 100%);
    border: 1px solid var(--atlas-rule);
    border-radius: 18px;
    box-shadow:
        0 1px 2px rgba(26, 21, 16, 0.05),
        0 12px 28px rgba(26, 21, 16, 0.08);
    animation: prp-atlas-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--col-i, 1) * 0.08s + 0.15s);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.prp-atlas__county:hover {
    border-color: rgba(1, 163, 77, 0.40);
    transform: translateY(-2px);
    box-shadow:
        0 1px 2px rgba(26, 21, 16, 0.05),
        0 22px 40px rgba(26, 21, 16, 0.12);
}

/* Corner ticks — map-frame suggestion */
.prp-atlas__county::before,
.prp-atlas__county::after {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    border: 1.5px solid var(--atlas-tan);
    opacity: 0.75;
    pointer-events: none;
}
.prp-atlas__county::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}
.prp-atlas__county::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.prp-atlas__county-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 10px;
    padding-bottom: 16px;
    margin-bottom: 14px;
    border-bottom: 1px dashed var(--atlas-tan);
}

.prp-atlas__county-num {
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.2em;
    color: var(--atlas-tan-dark);
}

.prp-atlas__county-name {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 26px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--atlas-ink-strong);
    margin: 0;
    line-height: 1;
}

.prp-atlas__county-count {
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--atlas-ink-dim);
}

/* Cities list */
.prp-atlas__cities {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 2px;
}

.prp-atlas__city {
    position: relative;
    padding: 0;
    margin: 0;
    list-style: none;
}

.prp-atlas__city::before,
.prp-atlas__city::after {
    content: none !important;
    display: none !important;
}

/* Plain (also-served) city */
.prp-atlas__city--plain .prp-atlas__city-name {
    display: block;
    padding: 6px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--atlas-ink-muted);
    letter-spacing: 0.005em;
    transition: color 0.2s ease;
}

.prp-atlas__city--plain:hover .prp-atlas__city-name {
    color: var(--atlas-ink);
}

/* Linked (dedicated-page) city */
.prp-atlas__city-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    color: var(--atlas-ink);
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.005em;
    line-height: 1.4;
    position: relative;
    transition: color 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.prp-atlas__city-link::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--atlas-accent);
    box-shadow: 0 0 0 3px rgba(1, 163, 77, 0.22);
    transform: translateY(-50%);
    opacity: 0.95;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.prp-atlas__city-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 20px;
    bottom: 2px;
    height: 1px;
    background: var(--atlas-accent);
    opacity: 0;
    transform: scaleX(0.6);
    transform-origin: left center;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.prp-atlas__city-link:hover,
.prp-atlas__city-link:focus {
    color: var(--atlas-accent);
    outline: none;
    transform: translateX(2px);
    text-decoration: none;
}

.prp-atlas__city-link:hover::before,
.prp-atlas__city-link:focus::before {
    box-shadow: 0 0 0 5px rgba(1, 163, 77, 0.28);
}

.prp-atlas__city-link:hover::after,
.prp-atlas__city-link:focus::after {
    opacity: 0.85;
    transform: scaleX(1);
}

.prp-atlas__city-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: var(--atlas-accent);
    opacity: 0.65;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.prp-atlas__city-link:hover .prp-atlas__city-arrow {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* Empty state during filtering */
.prp-atlas__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 56px 16px;
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    font-size: 20px;
    letter-spacing: 0.02em;
    color: var(--atlas-ink-muted);
}

.prp-atlas__empty a {
    color: var(--atlas-accent);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

.prp-atlas__grid.is-filtering .prp-atlas__county {
    animation: none;
}

/* ── Closing CTA — warm tan anchor ── */
.prp-atlas__cta {
    border-top: 1px solid var(--atlas-rule);
    background:
        radial-gradient(ellipse 70% 85% at 50% 0%, rgba(250, 245, 236, 0.25), transparent 70%),
        var(--atlas-tan);
    padding: 64px 24px 80px;
    color: #FFFFFF;
    position: relative;
}

/* Subtle contour lines on the tan strip too — continuity with the hero */
.prp-atlas__cta::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-radial-gradient(
        ellipse 700px 380px at 85% 50%,
        transparent 0,
        transparent 58px,
        rgba(26, 21, 16, 0.07) 59px,
        transparent 60px
    );
    mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, #000 60%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, #000 60%, transparent 100%);
}

.prp-atlas__cta-inner {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.prp-atlas__cta-text {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: 24px;
    letter-spacing: 0.01em;
    color: #FFFFFF;
    margin: 0;
    max-width: 48ch;
    text-shadow: 0 1px 0 rgba(26, 21, 16, 0.15);
}

.prp-atlas__cta-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
}

.prp-atlas__cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 9999px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.prp-atlas__cta-btn--ghost {
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    color: #FFFFFF;
    background: transparent;
}
.prp-atlas__cta-btn--ghost:hover,
.prp-atlas__cta-btn--ghost:focus {
    border-color: #FFFFFF;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.14);
    text-decoration: none;
    transform: translateY(-1px);
}

.prp-atlas__cta-btn--solid {
    background: var(--atlas-accent-hi);
    color: #0A0A0A;
    border: 1.5px solid var(--atlas-accent-hi);
}
.prp-atlas__cta-btn--solid:hover,
.prp-atlas__cta-btn--solid:focus {
    transform: translateY(-1px);
    background: #02D964;
    color: #0A0A0A;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(1, 191, 90, 0.40);
}

.prp-atlas__cta-btn svg {
    width: 14px;
    height: 12px;
    transition: transform 0.25s ease;
}

.prp-atlas__cta-btn:hover svg {
    transform: translateX(3px);
}

/* ── Animations ── */
@keyframes prp-atlas-fade {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes prp-atlas-rise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes prp-atlas-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(1, 163, 77, 0.24); }
    50%      { box-shadow: 0 0 0 7px rgba(1, 163, 77, 0.05); }
}

@media (prefers-reduced-motion: reduce) {
    .prp-atlas__hero-inner,
    .prp-atlas__county,
    .prp-atlas__eyebrow-dot,
    .prp-atlas__city-link,
    .prp-atlas__city-arrow {
        animation: none !important;
        transition: none !important;
    }
}

/* ── Responsive ── */
@media (max-width: 960px) {
    .prp-atlas__hero {
        padding: 80px 20px 64px;
    }
    .prp-atlas__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 60px 20px 80px;
    }
    .prp-atlas__toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .prp-atlas__search {
        flex: 1 1 auto;
        width: 100%;
        height: 52px;
        padding: 0 18px;
    }
    .prp-atlas__legend {
        order: 2;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 14px 18px;
    }
}

@media (max-width: 480px) {
    .prp-atlas__toolbar {
        margin-top: 28px;
        gap: 12px;
    }
    .prp-atlas__search {
        height: 48px;
        padding: 0 14px;
        gap: 10px;
    }
    .prp-atlas__search-input {
        font-size: 14px;
    }
    .prp-atlas__search-input::placeholder {
        /* Trim the long placeholder so it doesn't overflow on phones */
        text-overflow: ellipsis;
    }
    .prp-atlas__legend {
        font-size: 10px;
        letter-spacing: 0.10em;
        gap: 10px 16px;
    }
    .prp-atlas__legend-swatch {
        width: 8px;
        height: 8px;
    }
    .prp-atlas__legend-item {
        gap: 6px;
    }
}

@media (max-width: 680px) {
    .prp-atlas__grid {
        grid-template-columns: 1fr;
    }
    .prp-atlas__cities {
        grid-template-columns: repeat(2, 1fr);
    }
    .prp-atlas__title {
        font-size: clamp(44px, 13vw, 80px);
    }
    .prp-atlas__cta-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .prp-atlas__cities {
        grid-template-columns: 1fr;
    }
}
