:root {
    --background: #11100e;
    --panel: #1a1815;
    --text: #f2eee6;
    --muted: #aaa397;
    --accent: #c8a96b;
    --border: rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 169, 107, 0.55) rgba(255, 255, 255, 0.04);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 169, 107, 0.55) rgba(255, 255, 255, 0.04);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(200, 169, 107, 0.85), rgba(160, 128, 76, 0.9));
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.04);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(220, 188, 118, 0.95), rgba(180, 142, 86, 1));
}

.portfolio {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 32px;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 32px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 400;
}

.location-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-section {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
}

#map {
    width: 100%;
    height: 720px;
    background: var(--panel);
}

/* Leaflet popup restyling */

.leaflet-container {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #191714;
    color: var(--text);
}

.leaflet-popup-content-wrapper {
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 1000;
    width: min(92vw, 360px) !important;
    max-width: min(92vw, 360px) !important;
    max-height: min(60vh, 360px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0;
    pointer-events: none;
    transition: max-width 0.2s ease;
}

.leaflet-popup {
    z-index: 1100;
}

.leaflet-popup-content-wrapper .property-popup,
.leaflet-popup-content-wrapper .popup-image,
.leaflet-popup-content-wrapper .property-link,
.leaflet-popup-content-wrapper .description-toggle {
    pointer-events: auto;
}

.leaflet-tile-pane {
    filter:
        brightness(1.18)
        contrast(0.92)
        saturate(0.7);
}

.leaflet-popup-content {
    margin: 12px;
    width: auto !important;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.property-popup {
    width: 100%;
    max-width: 100%;
}

.property-popup h2 {
    margin: 0 0 5px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.3rem;
    font-weight: 400;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 10px;
}

.price {
    margin: 0;
    color: var(--accent);
    font-weight: 600;
}

.leaflet-container .property-link,
.leaflet-container .property-link:visited,
.leaflet-container .property-link:hover,
.leaflet-container .property-link:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    color: var(--accent);
    background: rgba(200, 169, 107, 0.12);
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.leaflet-container .property-link:hover,
.leaflet-container .property-link:focus {
    background: rgba(200, 169, 107, 0.22);
    transform: translateY(-1px);
}

.property-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.property-popup .popup-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 160px;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

.property-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px 12px;
    margin: 12px 0 14px;
    padding: 12px;
    border: 1px solid rgba(200, 169, 107, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.feature-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-text {
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.3;
}

.property-modal-overlay,
.image-slideshow-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(6, 6, 6, 0.86);
}

.property-modal-dialog {
    position: relative;
    width: min(100%, 1100px);
    max-height: 90vh;
    overflow: auto;
    background: #191714;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.property-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    font-size: 1.3rem;
    line-height: 1;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.property-modal-content {
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.9fr);
    gap: 24px;
    align-items: start;
}

.property-modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.property-modal-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
}

.property-modal-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.property-modal-thumb {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 0;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    overflow: hidden;
    width: 72px;
    height: 48px;
}

.property-modal-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-modal-body h2 {
    margin: 0 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
    font-weight: 400;
}

.property-modal-price {
    margin: 0 0 12px;
    color: var(--accent);
    font-weight: 600;
}

.property-modal-description {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.6;
}

.property-modal-link {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.property-modal-link:hover {
    text-decoration: underline;
}

.image-slideshow-dialog {
    position: relative;
    width: min(100%, 980px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.image-slideshow-thumbnails {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
}

.image-slideshow-thumb {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 0;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    overflow: hidden;
    width: 64px;
    height: 44px;
}

.image-slideshow-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-slideshow-thumb.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.image-slideshow-image {
    display: block;
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.image-slideshow-nav,
.image-slideshow-close {
    position: absolute;
    top: 12px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    font-size: 1.4rem;
    line-height: 1;
    width: 42px;
    height: 42px;
    cursor: pointer;
}

.image-slideshow-close {
    right: 12px;
}

.image-slideshow-prev {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.image-slideshow-next {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.image-slideshow-caption {
    color: var(--text);
    font-size: 0.95rem;
    text-align: center;
    max-width: 100%;
}

.property-popup p {
    margin: 5px 0;
}

.property-description {
    margin-top: 8px;
}

.description-preview,
.description-full {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.description-toggle {
    margin-top: 6px;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.description-toggle:hover {
    text-decoration: underline;
}

.property-popup .area {
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.property-popup .details {
    color: var(--muted);
}

.leaflet-control-zoom a {
    background: #191714;
    color: var(--text);
    border-color: var(--border);
}

.leaflet-control-zoom a:hover {
    background: #27231e;
    color: white;
}

@media (max-width: 700px) {
    .portfolio {
        padding: 16px;
    }

    .site-header {
        align-items: start;
        flex-direction: column;
        gap: 12px;
    }

    #map {
        height: min(70vh, 650px);
        min-height: 460px;
    }

    .leaflet-popup-content-wrapper {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: 58vh;
    }

    .leaflet-popup-content {
        margin: 10px;
    }

    .property-popup .popup-image {
        height: 140px;
        max-height: 140px;
    }

    .property-features {
        gap: 8px;
        padding: 10px;
    }
}

.premium-label-wrapper {
    background: transparent;
    border: none;
}

.premium-area-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid rgba(234, 215, 170, 0.45);
    border-radius: 999px;
    background: rgba(17, 16, 14, 0.78);
    color: #ead7aa;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.premium-area-subtitle {
    color: rgba(234, 215, 170, 0.72);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.leaflet-overlay-pane svg path {
    filter: drop-shadow(0 0 7px rgba(200, 169, 107, 0.28));
}

.neighbourhood-name {
    display: block;
}

.neighbourhood-subtitle {
    display: block;
    margin-top: 7px;
    color: rgba(234, 215, 170, 0.7);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
}

.property-marker {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #d4b06a;
    color: #111;
    border: 2px solid #fff;
    box-shadow:
        0 0 12px rgba(0, 0, 0, 0.55),
        0 0 18px rgba(212, 176, 106, 0.45);
    transition: 0.2s;
}

.property-marker svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.property-marker:hover {
    transform: scale(1.15);
}