/* ==========================================================================
   locations.css — Areas We Serve cards + locality page components
   Used by index.html, contact.html and every page under /locations/
   ========================================================================== */

/* --- Areas We Serve: card grid ------------------------------------------ */
.areas-section {
    padding: 1rem 0 2rem;
}

.areas-head {
    max-width: 720px;
    margin-bottom: 2.25rem;
}

.areas-head .areas-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.areas-head .areas-sub {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 1.25rem;
}

/* Safety net: the .reveal-* classes start at opacity 0 and rely on the
   IntersectionObserver in scripts.js to add .reveal-in. If that never runs
   (JS blocked or an earlier script error), this section would otherwise
   render as a tall block of blank space. Force it visible after 2s. */
.areas-section .area-card,
.areas-section.reveal-up,
.areas-section .areas-head {
    animation: loc-reveal-fallback 0.01s linear 2s forwards;
}

@keyframes loc-reveal-fallback {
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

.area-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.5rem 1.4rem 1.35rem;
    background: var(--white);
    border: 1px solid rgba(107, 16, 88, 0.10);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text-main);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
}

/* Gradient wash that fades in on hover */
.area-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(140deg, var(--bg-purple) 0%, rgba(255, 255, 255, 0) 65%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

/* Accent bar along the top edge */
.area-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s cubic-bezier(0.19, 1, 0.22, 1);
}

.area-card:hover,
.area-card:focus-visible {
    transform: translateY(-6px);
    border-color: rgba(107, 16, 88, 0.28);
    box-shadow: var(--shadow-lg);
}

.area-card:hover::before,
.area-card:focus-visible::before {
    opacity: 1;
}

.area-card:hover::after,
.area-card:focus-visible::after {
    transform: scaleX(1);
}

.area-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.area-card-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.area-pin {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--primary);
    transition: background 0.35s ease, color 0.35s ease;
}

.area-pin svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.area-card:hover .area-pin {
    background: var(--primary);
    color: var(--white);
}

.area-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.area-distance {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary);
}

.area-distance::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--secondary);
}

.area-services {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.15rem;
}

.area-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.area-more svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

.area-card:hover .area-more svg {
    transform: translateX(4px);
}

/* --- Locality page: landmark chips -------------------------------------- */
.loc-landmarks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
}

.loc-landmarks li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    background: var(--bg-purple);
    border: 1px solid rgba(107, 16, 88, 0.10);
    border-radius: 999px;
    font-size: 0.83rem;
    color: var(--text-main);
}

.loc-landmarks li svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Locality page: distance / travel-time stats ------------------------ */
.loc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.loc-stat {
    padding: 1.1rem 1.2rem;
    background: var(--bg-light);
    border: 1px solid rgba(107, 16, 88, 0.09);
    border-radius: 14px;
}

.loc-stat-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.loc-stat-value {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
}

/* --- Locality page: grouped link columns -------------------------------- */
.loc-linkcols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.loc-linkcol {
    display: flex;
    flex-direction: column;
    padding: 1.4rem 1.35rem;
    background: var(--white);
    border: 1px solid rgba(107, 16, 88, 0.10);
    border-radius: 16px;
}

.loc-linkcol-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    padding-bottom: 0.7rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid rgba(107, 16, 88, 0.10);
}

.loc-linkcol ul {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.loc-linkcol ul a {
    display: inline-block;
    font-size: 0.92rem;
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

.loc-linkcol ul a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.loc-linkcol-all {
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    opacity: 0.85;
    transition: var(--transition);
}

.loc-linkcol-all:hover {
    opacity: 1;
}

/* --- Locality page: treatment / resource link grid ---------------------- */
.loc-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.loc-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    background: var(--white);
    border: 1px solid rgba(107, 16, 88, 0.12);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

.loc-links a::after {
    content: '\2192';
    color: var(--primary);
    opacity: 0.5;
    transition: var(--transition);
}

.loc-links a:hover {
    background: var(--bg-purple);
    border-color: rgba(107, 16, 88, 0.3);
    color: var(--primary);
    transform: translateX(3px);
}

.loc-links a:hover::after {
    opacity: 1;
    transform: translateX(3px);
}

/* --- Locality page: map frame ------------------------------------------- */
.loc-map-frame {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(107, 16, 88, 0.12);
    box-shadow: var(--shadow-sm);
    line-height: 0;
}

.loc-map-frame iframe {
    display: block;
    width: 100%;
    height: 380px;
    border: 0;
}

.loc-nap {
    margin-top: 1.1rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-light);
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.85;
}

.loc-nap strong {
    color: var(--text-main);
}

.loc-nap a {
    color: var(--primary);
    font-weight: 600;
}

/* --- Locality page: generic bordered panel ------------------------------ */
.loc-panel {
    padding: 1.75rem;
    background: var(--white);
    border: 1px solid rgba(107, 16, 88, 0.10);
    border-radius: 18px;
}

.loc-panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.85rem;
}

.loc-panel p {
    color: var(--text-muted);
    line-height: 1.85;
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 768px) {
    .areas-grid {
        grid-template-columns: 1fr;
    }

    .area-card {
        padding: 1.35rem 1.25rem 1.2rem;
    }

    .loc-map-frame iframe {
        height: 300px;
    }

    .loc-links {
        grid-template-columns: 1fr;
    }

    .loc-panel {
        padding: 1.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .area-card,
    .area-card::before,
    .area-card::after,
    .area-pin,
    .area-more svg,
    .loc-links a {
        transition: none;
    }

    .area-card:hover {
        transform: none;
    }
}
