/* Events map (default layout). Tokens come from nexdirectory-design-system.css. */
#nexdirectory-map-default-wrapper #nexdirectory-map-apply,
#nexdirectory-map-default-wrapper #nexdirectory-map-filters-apply {
    /* Theme button rules frequently force a text colour; keep the accent contrast. */
    color: var(--nd-on-accent) !important;
    -webkit-text-fill-color: currentColor;
    background: var(--nd-accent);
    font-size: var(--nd-text-sm);
    font-weight: 600;
    letter-spacing: 0;
}
#nexdirectory-map-default-wrapper #nexdirectory-map-apply:hover,
#nexdirectory-map-default-wrapper #nexdirectory-map-filters-apply:hover {
    background: var(--nd-accent-hover);
}
#nexdirectory-map-default-wrapper .nexdirectory-map-sidebar label {
    font-size: var(--nd-text-xs);
}
#nexdirectory-map-default-wrapper .nexdirectory-map-sidebar :is(input[type="text"], input[type="date"], select) {
    font-size: var(--nd-text-sm);
}
#nexdirectory-map-default-wrapper #nexdirectory-map-use-location,
#nexdirectory-map-default-wrapper #nexdirectory-map-search-area {
    min-height: 40px;
    font-size: var(--nd-text-xs);
    font-weight: 600;
}
#nexdirectory-map-default-wrapper #nexdirectory-map-sort {
    font-size: var(--nd-text-sm);
    font-weight: 500;
}
@media (min-width: 1024px) {
    #nexdirectory-map-default-wrapper [data-nexdirectory-map-sidebar-shell="1"] {
        align-self: flex-start;
    }
    #nexdirectory-map-default-wrapper .nexdirectory-map-content-row.nexdirectory-map-content-row {
        overflow: visible;
    }
    #nexdirectory-map-default-wrapper #nexdirectory-map-sidebar-panel.nexdirectory-map-sidebar {
        position: static;
        top: auto;
        height: auto;
        max-height: none;
        overflow: visible;
    }
    #nexdirectory-map-default-wrapper #nexdirectory-map-sidebar-panel .nexdirectory-map-sidebar-scroll {
        min-height: auto;
        max-height: none;
        overflow: visible;
    }
}

/* Leaflet popups. Leaflet writes popup width inline, so width keeps !important. */
.nexdirectory-map-popup-theme .leaflet-popup-content-wrapper,
.leaflet-popup.nexdirectory-map-popup-frame .leaflet-popup-content-wrapper {
    padding: 0;
    overflow: hidden;
    border-radius: var(--nd-radius-lg);
    border: 1px solid var(--nd-line);
    box-shadow: var(--nd-shadow-4);
}
.nexdirectory-map-popup-theme .leaflet-popup-content,
.leaflet-popup.nexdirectory-map-popup-frame .leaflet-popup-content {
    margin: 0;
    width: min(340px, calc(100vw - 36px)) !important;
    min-width: 260px;
    font-family: var(--nd-font);
}
.nexdirectory-map-popup-theme .leaflet-popup-tip {
    background: var(--nd-surface);
}
.nexdirectory-map-popup-theme .leaflet-popup-close-button,
.leaflet-popup.nexdirectory-map-popup-frame .leaflet-popup-close-button {
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--nd-ink-2);
    box-shadow: var(--nd-shadow-2);
    border: 1px solid var(--nd-line);
    line-height: 30px;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
}
.nexdirectory-map-popup-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--nd-surface);
}
.nexdirectory-map-popup-image-link {
    display: block;
    width: 100%;
    margin: 0;
    line-height: 0;
    text-decoration: none;
    background: var(--nd-surface-2);
    overflow: hidden;
}
.nexdirectory-map-popup-image {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    margin: 0;
    transition: transform var(--nd-dur-3) var(--nd-ease);
}
.nexdirectory-map-popup-image-link:hover .nexdirectory-map-popup-image { transform: scale(1.04); }
.nexdirectory-map-popup-body {
    padding: 14px 16px 16px;
}
.nexdirectory-map-popup-title {
    margin: 0;
    font: 700 1.05rem/1.3 var(--nd-font-display);
    letter-spacing: -0.01em;
    color: var(--nd-ink);
}
.nexdirectory-map-popup-title a {
    color: inherit;
    text-decoration: none;
}
.nexdirectory-map-popup-title a:hover {
    color: var(--nd-accent);
}
.nexdirectory-map-popup-meta {
    margin: 8px 0 0;
    color: var(--nd-muted);
    font-size: var(--nd-text-sm);
    line-height: 1.5;
}
.nexdirectory-map-popup-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.nexdirectory-map-popup-meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--nd-surface-2);
    border: 1px solid var(--nd-line);
    font-size: var(--nd-text-xs);
    color: var(--nd-muted);
}
.nexdirectory-map-popup-cta,
.nexdirectory-map-popup-cta:visited {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: var(--nd-btn-radius);
    border: 1px solid transparent;
    background: var(--nd-accent);
    color: var(--nd-on-accent) !important;
    text-decoration: none;
    font-size: var(--nd-text-sm);
    font-weight: 600;
    padding: 0 14px;
    transition: background-color var(--nd-dur-2) var(--nd-ease), box-shadow var(--nd-dur-2) var(--nd-ease);
}
.nexdirectory-map-popup-cta:hover {
    background: var(--nd-accent-hover);
    box-shadow: 0 8px 18px -10px rgba(var(--nd-accent-rgb), 0.7);
}
