/* =============================================================================
   Wrongmove — site styles
   Tone: Savills-inspired — serif headings, generous whitespace, photo-forward.
   Not luxury-only: intended to feel professional across price points.
   ============================================================================= */

:root {
    --wm-ink:           #1a1a1a;
    --wm-body:          #2c2c2c;
    --wm-muted:         #6b6b6b;
    --wm-subtle:        #8a8a8a;
    --wm-line:          #e8e6e0;
    --wm-bg:            #ffffff;
    --wm-bg-soft:       #faf8f3;
    --wm-bg-warm:       #f3efe5;
    --wm-accent:        #5c4a2a;  /* warm muted gold — used sparingly */
    --wm-link:          #1a1a1a;
    --wm-link-hover:    #5c4a2a;
}

html, body {
    min-height: 100%;
    margin: 0;
    background: var(--wm-bg);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--wm-body);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin-bottom: 0;
}

/* headings use serif — classic estate-agent prestige cue */
h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, 'Times New Roman', serif;
    font-weight: 500;
    color: var(--wm-ink);
    letter-spacing: -0.01em;
    line-height: 1.15;
}

h1 { letter-spacing: -0.02em; }

/* links stay inky by default, warm gold on hover */
a {
    color: var(--wm-link);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: var(--wm-link-hover); }

/* navbar — minimal, line-under */
.navbar.wm-nav {
    background: var(--wm-bg);
    border-bottom: 1px solid var(--wm-line);
    padding-top: 1rem;
    padding-bottom: 1rem;
    box-shadow: none;
}
.navbar.wm-nav .navbar-brand {
    font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--wm-ink);
    padding: 0;
}
.navbar.wm-nav .nav-link {
    color: var(--wm-ink);
    font-weight: 500;
    font-size: 0.925rem;
    padding: 0.25rem 1rem;
    letter-spacing: 0.01em;
}
.navbar.wm-nav .nav-link:hover { color: var(--wm-link-hover); }

/* hero */
.wm-hero {
    background-color: var(--wm-bg-soft);
    padding: 4rem 0 3rem;
    border-bottom: 1px solid var(--wm-line);
}
.wm-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.75rem);
    font-weight: 500;
    margin-bottom: 1rem;
}
.wm-hero .lead {
    color: var(--wm-muted);
    font-size: 1.125rem;
}

/* hero search card */
.wm-search-card {
    background: var(--wm-bg);
    border: 1px solid var(--wm-line);
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.04);
}
.wm-search-card .form-control,
.wm-search-card .form-select {
    border-radius: 2px;
    border-color: var(--wm-line);
    font-size: 0.95rem;
    padding: 0.6rem 0.75rem;
}
.wm-search-card .form-control:focus,
.wm-search-card .form-select:focus {
    border-color: var(--wm-ink);
    box-shadow: none;
}

/* buttons — flat, squared, ink-black */
.btn-dark, .btn-ink {
    background: var(--wm-ink);
    border-color: var(--wm-ink);
    color: #fff;
    border-radius: 2px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.6rem 1.25rem;
    transition: background 0.15s ease;
}
.btn-dark:hover, .btn-ink:hover {
    background: #000;
    border-color: #000;
    color: #fff;
}

.btn-outline-dark {
    color: var(--wm-ink);
    border-color: var(--wm-ink);
    border-radius: 2px;
    font-weight: 500;
}

/* cards — flatter, squarer */
.card {
    border: 1px solid var(--wm-line);
    border-radius: 4px;
    overflow: hidden;
    background: var(--wm-bg);
    box-shadow: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
    border-color: var(--wm-ink);
}
.listing-card { color: inherit; }
.listing-card:hover { transform: translateY(-1px); }

.card .card-title {
    font-family: 'Inter', sans-serif;  /* prices feel more confident sans-serif */
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--wm-ink);
}

/* badges — flatter, no bold background */
.badge {
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 0.4em 0.7em;
}

/* breadcrumbs */
.breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 0;
}
.breadcrumb-item a { color: var(--wm-muted); }
.breadcrumb-item.active { color: var(--wm-ink); }

/* section rhythm */
.wm-section {
    padding: 3rem 0;
}
.wm-section-title {
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

/* footer */
.wm-footer {
    border-top: 1px solid var(--wm-line);
    background: var(--wm-bg);
    color: var(--wm-muted);
    font-size: 0.875rem;
    padding: 2.5rem 0 3rem;
    margin-top: 4rem;
}
.wm-footer a { color: var(--wm-muted); }
.wm-footer a:hover { color: var(--wm-ink); }

/* feature labels / eyebrows */
.wm-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--wm-subtle);
}

/* heart / favourite button */
.wm-heart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--wm-line);
    color: var(--wm-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.wm-heart:hover {
    color: #c0392b;
    border-color: #c0392b;
    background: #fff;
}
.wm-heart.is-saved {
    color: #c0392b;
    border-color: #c0392b;
}
.wm-heart:active { transform: scale(0.92); }
.wm-heart svg { width: 18px; height: 18px; }

.wm-heart-absolute {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
}

/* listing detail — price display, data cells, gallery hero */
.wm-price {
    font-family: 'Inter', sans-serif;   /* prices read confident in sans */
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--wm-ink);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.1;
    margin: 0;
}

.wm-data-cell {
    background: var(--wm-bg);
    border: 1px solid var(--wm-line);
    border-radius: 4px;
    padding: 1rem;
    height: 100%;
    transition: border-color 0.15s ease;
}
.wm-data-cell:hover { border-color: var(--wm-ink); }
.wm-data-cell .wm-value {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--wm-ink);
    line-height: 1.1;
    margin: 0.25rem 0;
}
.wm-data-cell .wm-value.muted { color: var(--wm-muted); font-weight: 500; }

.wm-gallery-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--wm-line);
    display: block;
}
.wm-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x mandatory;
}
.wm-gallery-thumbs .thumb {
    flex-shrink: 0;
    scroll-snap-align: start;
    background: transparent;
    border: 1px solid var(--wm-line);
    border-radius: 3px;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.wm-gallery-thumbs .thumb:hover,
.wm-gallery-thumbs .thumb.active { border-color: var(--wm-ink); }
.wm-gallery-thumbs .thumb img { display: block; border-radius: 2px; }

/* ============================ map search page ============================ */
.wm-mapbar {
    background: var(--wm-bg);
    border-bottom: 1px solid var(--wm-line);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.wm-mapbar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.wm-mapbar-left   { display: flex; align-items: center; gap: 0.75rem; }
.wm-mapbar-loc    { display: flex; gap: 0.25rem; min-width: 260px; }
.wm-mapbar-loc input { min-width: 200px; }
.wm-mapbar-filters { display: flex; align-items: flex-end; gap: 1.25rem; flex: 1 1 auto; min-width: 320px; }
.wm-mapbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.wm-mapbar-count       { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 1rem; color: var(--wm-ink); }
.wm-mapbar-count-label { font-size: 0.75rem; color: var(--wm-muted); margin-right: 0.5rem; }

.wm-filter          { min-width: 110px; display: flex; flex-direction: column; gap: 0.35rem; }
.wm-filter-wide     { min-width: 180px; }
.wm-filter-slider   { padding: 0.35rem 0.6rem 0.4rem; }
.wm-filter-val      { font-size: 0.75rem; color: var(--wm-muted); text-align: center; letter-spacing: 0.02em; }

/* noUiSlider overrides to match site aesthetic */
.noUi-target      { background: #e8e6e0; border: none; box-shadow: none; height: 3px; }
.noUi-connect     { background: var(--wm-ink); }
.noUi-horizontal .noUi-handle {
    width: 16px; height: 16px; right: -8px; top: -7px;
    border-radius: 50%;
    border: 1px solid var(--wm-ink);
    background: #fff;
    box-shadow: none;
    cursor: grab;
}
.noUi-handle:before, .noUi-handle:after { display: none; }
.noUi-horizontal .noUi-handle:focus { outline: 2px solid var(--wm-accent); outline-offset: 1px; }

.wm-map-canvas {
    width: 100%;
    height: calc(100vh - 170px);
    min-height: 480px;
}

/* =========================== map pin price bubble =========================== */
/* The marker SVG is built in JS; this styles the popup (InfoWindow) content. */
.wm-pop {
    width: 360px;
    max-width: 82vw;
    font-family: 'Inter', sans-serif;
    color: var(--wm-body);
}
.wm-pop-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f3efe5;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
}
.wm-pop-gallery img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.wm-pop-gallery img.active { opacity: 1; }

.wm-pop-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--wm-ink);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    transition: background 0.15s ease;
    z-index: 2;
}
.wm-pop-nav:hover { background: #fff; }
.wm-pop-nav[data-dir="prev"] { left: 8px; }
.wm-pop-nav[data-dir="next"] { right: 8px; }

.wm-pop-dots {
    position: absolute;
    bottom: 8px;
    left: 0; right: 0;
    display: flex; justify-content: center; gap: 4px;
    z-index: 2;
}
.wm-pop-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.55);
    transition: background 0.15s ease;
}
.wm-pop-dots span.active { background: #fff; }

.wm-pop-gallery .wm-heart {
    position: absolute; top: 10px; right: 10px; z-index: 3;
    background: rgba(255,255,255,0.92);
}

.wm-pop-count {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.02em;
}

.wm-pop-body { padding: 0.85rem 1rem 0.9rem; }
.wm-pop-price {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--wm-ink);
    margin: 0 0 0.15rem;
    line-height: 1.1;
}
.wm-pop-addr { font-size: 0.85rem; color: var(--wm-muted); margin: 0 0 0.65rem; }

.wm-pop-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem 0.75rem;
    margin: 0.65rem 0 0.85rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--wm-line);
    border-bottom: 1px solid var(--wm-line);
}
.wm-pop-stat {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--wm-ink);
}
.wm-pop-stat svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--wm-muted); }
.wm-pop-stat.muted    { color: var(--wm-muted); }

.wm-pop-tags          { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.wm-pop-tag {
    font-size: 0.72rem;
    padding: 0.22em 0.6em;
    border-radius: 2px;
    background: var(--wm-bg-soft);
    border: 1px solid var(--wm-line);
    color: var(--wm-muted);
    letter-spacing: 0.02em;
}

.wm-pop-agency { font-size: 0.78rem; color: var(--wm-muted); margin-bottom: 0.75rem; }
.wm-pop-cta    { display: block; text-align: center; text-decoration: none; font-weight: 500; padding: 0.6rem; border-radius: 2px; background: var(--wm-ink); color: #fff; letter-spacing: 0.02em; }
.wm-pop-cta:hover { background: #000; color: #fff; }

/* Google InfoWindow container tweaks so the rounded card shows through */
.gm-style .gm-style-iw-c { padding: 0 !important; border-radius: 4px !important; box-shadow: 0 8px 30px rgba(0,0,0,0.18) !important; }
.gm-style .gm-style-iw-d { overflow: hidden !important; padding: 0 !important; }
.gm-style .gm-style-iw-tc::after { background: #fff; }
.gm-style .gm-ui-hover-effect { top: 6px !important; right: 6px !important; opacity: 0.8; }

/* ======================== save-alert modal ======================== */
.wm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.wm-modal[hidden] { display: none; }
.wm-modal-card {
    position: relative;
    background: #fff;
    border-radius: 4px;
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.wm-modal-close {
    position: absolute; top: 0.5rem; right: 0.75rem;
    background: none; border: none; font-size: 1.5rem;
    color: var(--wm-muted); cursor: pointer; line-height: 1;
}

@@media (max-width: 900px) {
    .wm-mapbar-inner   { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .wm-mapbar-left    { justify-content: space-between; }
    .wm-mapbar-filters { justify-content: space-between; gap: 0.75rem; }
    .wm-filter         { min-width: 0; flex: 1; }
    .wm-filter-wide    { flex: 2; }
    .wm-map-canvas     { height: calc(100vh - 260px); min-height: 360px; }
    .wm-pop            { width: 300px; }
}

/* responsive (site-wide) */
@@media (max-width: 768px) {
    .wm-hero { padding: 2.5rem 0 2rem; }
    .wm-section { padding: 2rem 0; }
}
