/* ===== HUNTING MAP (/hunting-map/) =====
   Palette matches main.css: --primary-color #2c5530, --dark-green #1a3d1f,
   --light-green #4a7c59, --secondary-color #8b4513, --accent-color #d4a574.
   Header offset matches main.css LAYOUT: 66px fixed navbar on desktop,
   56px below the lg breakpoint. */

.hunting-map-wrap {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

#hunting-map {
    width: 100%;
    height: calc(100vh - 66px - 12rem); /* navbar + page heading/intro allowance */
    min-height: 480px;
    z-index: 1; /* keep Leaflet below the site navbar */
}

/* Empty / error messages overlay the (still visible) map */
.hunting-map-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000; /* above Leaflet panes */
    max-width: 320px;
    padding: 1rem 1.5rem;
    text-align: center;
    color: var(--text-light, #6c757d);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 0.5rem;
    box-shadow: var(--shadow, 0 4px 6px rgba(0, 0, 0, 0.1));
    pointer-events: none; /* never blocks map pan/zoom */
}

.hunting-map-message--error {
    color: #842029;
    border-color: #f5c2c7;
    background: rgba(248, 215, 218, 0.95);
}

/* ===== Filter sidebar ===== */
#hunting-map-filters {
    position: sticky;
    top: calc(66px + 1rem); /* below the fixed navbar when scrolling */
}

/* ===== Marker cluster colors (site palette) ===== */
.marker-cluster-small {
    background-color: rgba(74, 124, 89, 0.35); /* --light-green */
}

.marker-cluster-small div {
    background-color: rgba(74, 124, 89, 0.9);
    color: #fff;
}

.marker-cluster-medium {
    background-color: rgba(44, 85, 48, 0.35); /* --primary-color */
}

.marker-cluster-medium div {
    background-color: rgba(44, 85, 48, 0.9);
    color: #fff;
}

.marker-cluster-large {
    background-color: rgba(26, 61, 31, 0.4); /* --dark-green */
}

.marker-cluster-large div {
    background-color: rgba(26, 61, 31, 0.95);
    color: #fff;
}

.marker-cluster span {
    font-weight: 700;
}

/* ===== Popup card (echoes .listing-card from search.html) ===== */
.map-popup-card {
    border: none;
    box-shadow: none;
    min-width: 200px;
}

.map-popup-card .card-body {
    padding: 0.75rem 1rem;
}

.map-popup-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark, #2c3e50);
}

.map-popup-card .card-text {
    color: var(--text-light, #6c757d);
    margin-bottom: 0.75rem;
}

.map-popup-card .btn-primary {
    background-color: var(--primary-color, #2c5530);
    border-color: var(--primary-color, #2c5530);
}

.map-popup-card .btn-primary:hover,
.map-popup-card .btn-primary:focus {
    background-color: var(--dark-green, #1a3d1f);
    border-color: var(--dark-green, #1a3d1f);
}

.map-popup-card .btn-outline-secondary {
    color: var(--secondary-color, #8b4513);
    border-color: var(--secondary-color, #8b4513);
}

.map-popup-card .btn-outline-secondary:hover,
.map-popup-card .btn-outline-secondary:focus {
    background-color: var(--secondary-color, #8b4513);
    border-color: var(--secondary-color, #8b4513);
    color: #fff;
}

.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(0, 0, 0, 0.15));
}

.leaflet-popup-content {
    margin: 0.75rem;
}

/* ===== Mobile / tablet (< lg): filter bar collapses above the map ===== */
@media (max-width: 991.98px) {
    #hunting-map {
        height: 60vh;
        min-height: 320px;
    }

    /* The collapse toggle owns visibility on small screens */
    #hunting-map-filters {
        position: static;
    }
}

@media (min-width: 992px) {
    /* Keep the sidebar form expanded on desktop even though it carries
       Bootstrap's .collapse class for the mobile toggle */
    #hunting-map-filters.collapse:not(.show) {
        display: block;
    }
}
