/* Location page. Shares the site .wrap width and the public brand tokens.
   Linked from the site layout separately from site.css. */

.location-page,
.location-section,
.location-feature-section,
.location-explorer {
    --surface: var(--paper);
}

/* Hero grows with breadcrumbs and intro while keeping the exact shared .page-hero width and white eyebrow. */
#location-hero.page-hero {
    height: auto;
    min-height: 276px;
    padding-block: 38px 44px;
}

#location-hero .page-hero__inner {
    gap: 14px;
}

#location-hero h1 {
    font-family: var(--serif);
    font-size: clamp(36px, 4vw, 56px);
    line-height: 1.08;
    letter-spacing: -.03em;
}

#location-hero .page-hero__intro {
    max-width: 820px;
    font-size: 16px;
}

#location-hero .crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: rgba(255, 255, 255, .86);
    font: 600 13px/1.4 var(--sans);
    letter-spacing: .02em;
}

#location-hero .crumbs a {
    color: inherit;
    text-decoration: none;
}

#location-hero .crumbs a:hover,
#location-hero .crumbs a:focus-visible {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#location-hero .crumbs a[aria-current="page"] {
    color: #fff;
}

.location-section {
    padding-block: clamp(40px, 5vw, 76px);
}

.location-feature-section {
    padding-block: clamp(56px, 6.5vw, 100px);
}

/* Compact introduction */
.location-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: clamp(24px, 4vw, 72px);
    align-items: start;
}

.location-intro__copy,
.location-intro__aside {
    min-width: 0;
}

.location-intro h2 {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(32px, 3.4vw, 52px);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.08;
}

.location-intro__aside {
    display: grid;
    gap: 14px;
    align-content: start;
    padding-top: 8px;
}

.location-intro__body {
    margin: 0;
    color: color-mix(in srgb, var(--ink) 84%, #fff);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.75;
}

.location-intro + .preview-note,
.preview-note + .preview-note,
.preview-note + .location-explorer,
.location-intro + .location-explorer {
    margin-top: clamp(22px, 3vw, 40px);
}

/* Filter bar */
.location-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    width: 100%;
    margin-bottom: 18px;
}

.location-filters {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
    padding: 4px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 86%, #fff);
    scrollbar-width: thin;
}

.location-filter {
    appearance: none;
    margin: 0;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font: 700 13px/1.2 var(--sans);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.location-filter:hover {
    background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.location-filter.is-active,
.location-filter[aria-pressed="true"] {
    background: var(--brand);
    color: #fff;
}

.location-filter:focus-visible,
.location-place-btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.location-count {
    margin: 0 0 0 auto;
    color: var(--ink);
    font: 700 14px/1.3 var(--sans);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Explorer: stacked on small screens, equal-height split from 960px */
.location-explorer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.location-explorer__right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    order: -1;
    min-width: 0;
}

.location-explorer__left {
    position: static;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 90%, #fff);
}

.location-list-viewport {
    position: static;
    max-height: none;
    padding: 8px;
    overflow: visible;
}

.location-map-frame {
    position: relative;
    height: clamp(300px, 70vw, 340px);
    overflow: hidden;
    border: 1px solid #fff;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--brand-deep) 8%, transparent);
}

.location-map-canvas,
.location-map-fallback {
    position: absolute;
    inset: 0;
}

.location-map-canvas {
    z-index: 1;
    width: 100%;
    height: 100%;
}

.location-map-canvas .leaflet-container {
    width: 100%;
    height: 100%;
    background: var(--surface);
    font-family: var(--sans);
}

.location-map-fallback {
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px;
    background:
        radial-gradient(circle at 84% 12%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 42%),
        linear-gradient(165deg, color-mix(in srgb, var(--brand) 16%, var(--surface)), var(--surface));
}

.location-map-fallback:has(.location-map-embed) {
    padding: 0;
    background: var(--paper);
}

.location-map-embed,
.location-map-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.location-map-fallback__card {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 6px;
    justify-items: start;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(10px);
}

.location-map-fallback:has(.location-map-embed) .location-map-fallback__card {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
}

.location-map-fallback__eyebrow,
.location-address-card__eyebrow {
    margin: 0;
    font: 700 13px/1.3 var(--sans);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.location-map-fallback__eyebrow {
    color: var(--brand-deep);
}

.location-map-fallback__name,
.location-map-fallback__address {
    margin: 0;
    color: var(--ink);
}

.location-map-fallback__name {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.2;
}

.location-map-fallback__address {
    font: 600 14px/1.45 var(--sans);
}

/* Place list */
.location-place-item {
    margin: 0;
}

.location-place-item--property {
    margin-bottom: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.location-place-btn {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "mark copy distance";
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--brand) 16%, rgba(255, 255, 255, .85));
    border-radius: 15px;
    background: rgba(255, 255, 255, .62);
    color: var(--ink);
    font-family: var(--sans);
    text-align: left;
    cursor: pointer;
    appearance: none;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.location-place-btn--property {
    background: rgba(255, 255, 255, .72);
}

.location-place-btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--brand) 30%, #fff);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 7px 18px color-mix(in srgb, var(--brand) 8%, transparent);
}

.location-place-btn.is-selected,
.location-place-btn[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--brand) 42%, #fff);
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 12%, transparent);
}

.location-place-icon,
.location-place-num {
    grid-area: mark;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid color-mix(in srgb, var(--brand) 18%, #fff);
    border-radius: 50%;
    background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--tint-cool) 45%, #fff));
    color: var(--accent-ink);
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.location-place-icon .icon {
    width: 17px;
    height: 17px;
}

.location-place-num {
    width: auto;
    min-width: 34px;
    padding: 0 6px;
    border-radius: 999px;
    font: 700 13px/1 var(--sans);
    font-variant-numeric: tabular-nums;
}

.location-place-btn.is-selected .location-place-icon,
.location-place-btn[aria-pressed="true"] .location-place-icon,
.location-place-btn.is-selected .location-place-num,
.location-place-btn[aria-pressed="true"] .location-place-num {
    border-color: color-mix(in srgb, var(--brand) 48%, #fff);
    background: linear-gradient(135deg, var(--brand-lift), var(--brand-deep));
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-deep) 24%, transparent);
}

.location-place-copy {
    display: grid;
    grid-area: copy;
    gap: 2px;
    min-width: 0;
}

.location-place-name {
    color: var(--ink);
    font: 700 16px/1.35 var(--sans);
    overflow-wrap: anywhere;
}

.location-place-kicker {
    color: var(--brand-deep);
    font: 700 13px/1.3 var(--sans);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.location-place-address {
    color: color-mix(in srgb, var(--ink) 72%, #fff);
    font: 600 13px/1.4 var(--sans);
    overflow-wrap: anywhere;
}

.location-place-distance {
    display: inline-flex;
    grid-area: distance;
    align-items: center;
    justify-self: end;
    padding: 6px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand) 12%, var(--surface));
    color: var(--brand-deep);
    font: 700 13px/1.2 var(--sans);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.location-group {
    display: grid;
    gap: 2px;
}

.location-group + .location-group {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.location-group__heading {
    margin: 16px 12px 6px;
    color: var(--ink);
    font: 700 13px/1.3 var(--sans);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.location-group__items {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Selected-place card */
.location-detail {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 22px 24px 24px;
    border: 1px solid color-mix(in srgb, var(--brand) 42%, transparent);
    border-radius: 18px;
    background: linear-gradient(115deg, color-mix(in srgb, var(--brand) 90%, #000), color-mix(in srgb, var(--brand-deep) 94%, #000));
    color: #fff;
    box-shadow: 0 14px 34px color-mix(in srgb, var(--brand-deep) 14%, transparent), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.location-detail__eyebrow {
    margin: 0;
    color: var(--accent-hero);
    font: 700 12px/1.3 var(--sans);
    letter-spacing: .14em;
    text-transform: uppercase;
}

.location-detail__name {
    margin: 0;
    color: #fff;
    font-family: var(--serif);
    font-size: clamp(26px, 2.4vw, 34px);
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.location-detail__meta {
    margin: 0;
    color: rgba(255, 255, 255, .92);
    font: 600 15px/1.45 var(--sans);
}

.location-detail__description {
    margin: 0;
    color: rgba(255, 255, 255, .86);
    font: 400 15px/1.65 var(--sans);
}

.location-detail__meta:empty,
.location-detail__description:empty,
.location-detail__actions:not(:has(a, button)) {
    display: none;
}

.location-detail__media img,
[data-detail-image] {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 14px;
}

.location-detail__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.location-detail__actions .btn {
    justify-self: start;
}

.location-detail__actions .btn--dark {
    background: rgba(255, 255, 255, .92);
    border-color: rgba(255, 255, 255, .96);
    color: var(--brand-deep);
    box-shadow: inset 0 1px 0 #fff, 0 8px 20px rgba(0, 0, 0, .2);
}

.location-detail__actions .btn--dark:hover,
.location-detail__actions .btn--dark:focus-visible {
    background: #fff;
    border-color: #fff;
    color: var(--brand-deep);
    box-shadow: inset 0 1px 0 #fff, 0 12px 26px rgba(0, 0, 0, .28);
}

.location-detail__actions .btn--light {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .52);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32);
}

.location-detail__actions .btn--light:hover,
.location-detail__actions .btn--light:focus-visible {
    background: rgba(255, 255, 255, .24);
    border-color: rgba(255, 255, 255, .82);
    color: #fff;
}

/* Custom Leaflet markers. The map script supplies the elements. */
.location-pin.leaflet-div-icon,
.leaflet-marker-icon.location-pin {
    background: transparent;
    border: 0;
    overflow: visible;
}

.location-pin__badge {
    display: grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--brand-deep) 32%, transparent);
    color: #fff;
    font: 700 13px/1 var(--sans);
    font-variant-numeric: tabular-nums;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.location-pin__badge .icon,
.location-pin__badge svg {
    width: 16px;
    height: 16px;
}

.location-pin--property .location-pin__badge {
    width: 38px;
    min-width: 38px;
    height: 38px;
    background: var(--brand);
    color: #fff;
}

.location-pin--property .location-pin__badge .icon,
.location-pin--property .location-pin__badge svg {
    width: 20px;
    height: 20px;
}

.location-pin--place .location-pin__badge {
    background: var(--surface);
    color: var(--brand);
}

.location-pin.is-selected {
    z-index: 500 !important;
}

.location-pin.is-selected .location-pin__badge {
    background: var(--brand);
    color: #fff;
    border-color: #fff;
    transform: scale(1.14);
    box-shadow:
        0 0 0 3px var(--accent),
        0 0 0 8px color-mix(in srgb, var(--accent) 38%, transparent),
        0 10px 22px color-mix(in srgb, var(--brand-deep) 35%, transparent);
}

/* Address feature under the map */
.location-feature-section--has-photo {
    padding: 0;
    background: var(--surface-warm);
}

.location-feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(24px, 4vw, 64px);
    align-items: center;
}

.location-feature--has-photo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    width: 100%;
}

.location-feature__media {
    min-width: 0;
    min-height: 320px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--brand-deep);
}

.location-feature__media:has(.location-address-card) {
    border-radius: 18px;
    background: transparent;
}

.location-feature--has-photo .location-feature__media {
    position: relative;
    min-height: 460px;
    height: 100%;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
}

.location-feature__img,
.location-feature__media img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
}

.location-feature--has-photo .location-feature__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.location-address-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    min-height: 380px;
    padding: clamp(24px, 3vw, 40px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--brand) 42%, transparent);
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(115deg, color-mix(in srgb, var(--brand) 90%, #000), color-mix(in srgb, var(--brand-deep) 94%, #000));
    box-shadow: 0 14px 34px color-mix(in srgb, var(--brand-deep) 14%, transparent), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.location-address-card::before {
    content: "";
    position: absolute;
    inset: 22px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 14px;
    background:
        linear-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(90deg, rgba(255, 255, 255, .16) 1px, transparent 1px) 0 0 / 28px 28px;
    pointer-events: none;
    mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
}

.location-address-card > * {
    position: relative;
    z-index: 1;
}

.location-address-card__eyebrow {
    color: var(--accent-hero);
}

.location-address-card__name {
    margin: 0;
    color: #fff;
    font-family: var(--serif);
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.12;
}

.location-address-card__address {
    display: grid;
    margin: 0;
    color: #fff;
    font-style: normal;
    font: 600 16px/1.55 var(--sans);
}

.location-address-card__badge {
    align-self: flex-start;
    margin: 4px 0 0;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    color: #fff;
    font: 700 13px/1.2 var(--sans);
    font-variant-numeric: tabular-nums;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.location-address-card__pending {
    margin: 0;
    color: rgba(255, 255, 255, .9);
    font: 600 14px/1.5 var(--sans);
}

.location-feature__copy {
    display: grid;
    gap: 14px;
    align-content: center;
    justify-items: start;
    min-width: 0;
}

.location-feature--has-photo .location-feature__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(44px, 5.5vw, 80px) clamp(28px, 6vw, 88px);
}

.location-feature__copy h2 {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(32px, 3.6vw, 52px);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.08;
}

.location-feature__copy p:not(.eyebrow) {
    margin: 0;
    color: color-mix(in srgb, var(--ink) 84%, #fff);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.75;
}

.location-feature__copy .btn {
    margin-top: 6px;
}

.location-list-viewport {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--brand) 45%, transparent) transparent;
}

.location-list-viewport::-webkit-scrollbar {
    width: 10px;
}

.location-list-viewport::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand) 45%, transparent);
    background-clip: padding-box;
}

@media (min-width: 960px) {
    .location-intro {
        align-items: center;
    }

    .location-explorer__grid {
        grid-template-columns: minmax(340px, 5fr) minmax(0, 7fr);
        gap: clamp(20px, 2.2vw, 32px);
        align-items: stretch;
    }

    .location-explorer__right {
        order: 0;
    }

    .location-map-frame {
        height: clamp(400px, 44vw, 500px);
    }

    .location-detail {
        min-height: 164px;
    }

    .location-explorer__left {
        position: relative;
        min-height: 0;
    }

    .location-list-viewport {
        position: absolute;
        inset: 0;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .location-feature {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 959px) {
    .location-intro {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .location-intro__aside {
        padding-top: 0;
    }

    .location-place-btn {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "mark copy"
            "mark distance";
    }

    .location-place-distance {
        justify-self: start;
        margin-top: 4px;
    }

    .location-place-item[data-mobile-collapsed="1"] {
        display: none !important;
    }

    .location-load-more-wrap {
        display: flex;
        justify-content: center;
        padding-top: 14px;
    }

    .location-load-more-wrap[hidden] {
        display: none;
    }

    .location-load-more {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 900px) {
    .location-feature--has-photo {
        grid-template-columns: minmax(0, 1fr);
    }

    .location-feature--has-photo .location-feature__media {
        min-height: 0;
        height: clamp(240px, 56vw, 340px);
    }

    .location-feature--has-photo .location-feature__copy {
        padding: 36px var(--gutter) 44px;
    }
}

@media (max-width: 700px) {
    #location-hero.page-hero {
        min-height: 220px;
        padding-block: 28px 32px;
    }

    .location-count {
        margin-left: 0;
    }

    .location-address-card {
        min-height: 300px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .location-filter,
    .location-place-btn,
    .location-place-icon,
    .location-place-num,
    .location-pin__badge {
        transition: none;
    }

    .location-place-btn:hover {
        transform: none;
    }
}
