/**
 * LumenWP District Lookup - v1.5.0 Clean Stylesheet
 * Handcrafted for High Performance & Compact Leaflet Popups
 */

:root {
    --dl-brand: #0073aa;
    --dl-brand-hover: #005a87;
    --dl-panel-bg: #1e293b; /* Dark theme card overlay */
    --dl-radius: 8px;
}

/* Master Layout Container spans full-width relative space */
.dl-main-layout-container {
    position: relative;
    width: 100%;
    height: 650px;
    border-radius: var(--dl-radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.dl-main-layout-container *,
.dl-main-layout-container *::before,
.dl-main-layout-container *::after {
    box-sizing: inherit;
}

/* Full screen map canvas behind overlay panels */
#dl-leaflet-map-canvas {
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 1;
}

/* FLOATING DASHBOARD PANEL: Placed over the map top-left corner */
.dl-sidebar-content-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    min-width: 460px;
    background: var(--dl-panel-bg);
    padding: 22px;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 500; /* Forces panel above Leaflet map tiles */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dl-search-header-box h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: #ffffff !important;
}

.dl-search-description {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
    margin: 0 0 12px 0;
}

/* Row wrapper for Input and Actions */
.dl-input-routing-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dl-input-routing-wrapper input[type="text"] {
    flex-grow: 1;
    height: 40px;
    padding: 0 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font-size: 14px;
}

.dl-input-routing-wrapper button {
    height: 40px;
    padding: 0 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: var(--dl-brand);
    color: #ffffff;
    white-space: nowrap;
    transition: background 0.2s;
}

.dl-input-routing-wrapper button:hover {
    background: var(--dl-brand-hover);
}

.dl-input-routing-wrapper .dl-clear-button {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.leaflet-popup-content h1, .leaflet-popup-content h3, .leaflet-popup-content h2,.leaflet-popup-content h4,.leaflet-popup-content h5{margin:0;}

/* ==========================================================================
   FORCE COMPACT LEAFLET POPUP OVERRIDES
   ========================================================================== */

/* 1. Slim down general map bubble wrapper boundaries */
.leaflet-popup-content-wrapper {
    background: #ffffff;
    padding: 0; 
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 0; 
    width: 240px; /* Shrunk total card horizontal area down from 280px */
}

.leaflet-popup-tip {
    background: #ffffff;
}

/* 2. Micro Content Packing Adjustments */
.dl-active-district-card {
    padding: 20px;
    margin: 0 !important;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Reduce photo height to keep popups vertically low profile */
.dl-district-avatar {
    width: 100%;
    overflow: hidden;
    margin: 0 0 10px 0;
    border-radius: 10px 10px 0 0; 
}

.dl-active-district-card .dl-district-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
}

/* Compress internal tracking spaces */
.dl-district-body {
    padding: 0 14px 14px 14px;
}

h2.dl-district-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a; 
    margin: 0 0 3px 0;
    line-height: 1.2;
}

.dl-meta-district-tag {
    font-size: 11.5px;
    color: #64748b;
    margin: 0 0 6px 0;
}

.dl-cpt-editor-content {
    font-size: 12px;
    line-height: 1.4;
    color: #475569; 
    margin: 0 0 12px 0;
}

/* 3. Compact Action Layout Row Split */
.dl-rep-action-container {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.dl-rep-profile-primary-btn {
    flex-grow: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    background: var(--dl-brand, #0073aa);
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.dl-rep-profile-primary-btn:hover {
    background: var(--dl-brand-hover, #005a87);
}

/* Clean up multi-channel social links sizing arrays */
.dl-social-media-badge-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.dl-social-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; 
    height: 32px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none; 
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, filter 0.2s;
}

.dl-social-icon-badge.fb { background: #1877F2; } 
.dl-social-icon-badge.tw { background: #000000; } 
.dl-social-icon-badge.li { background: #0A66C2; } 
.dl-social-icon-badge.ig { background: #E1306C; } 
.dl-social-icon-badge.yt { background: #FF0000; } 

.dl-social-icon-badge:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}


/* ==========================================================================
   MAP INTERFACE UTILITIES (Controls Shifting)
   ========================================================================== */
.dl-main-layout-container .leaflet-left {
    left: auto;
    right: 20px;
}

.dl-main-layout-container .leaflet-top {
    top: 20px;
}


/* ==========================================================================
   MOBILE RESPONSIVE HANDLING
   ========================================================================== */
@media (max-width: 768px) {
    .dl-main-layout-container {
        min-height: 650px;
    }
    .dl-sidebar-content-panel {
        position: absolute;   /* stay an overlay, not in-flow */
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        min-width: 0;
        border-radius: 6px;
    }

    .dl-main-layout-container .leaflet-left {
        left: 10px;
        right: auto;
    }

    .dl-input-routing-wrapper input[type="text"] {
        flex-grow: 1;
        width: 100%;
    }
}


/* ==========================================================================
   UNIVERSAL SINGLE POST FALLBACK LAYOUT (For Non-Builder Sites)
   ========================================================================== */
.dl-universal-member-profile-container {
    margin: 30px auto;
    max-width: 960px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
}

.dl-profile-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.dl-profile-sidebar-avatar {
    flex: 1 1 320px;
    max-width: 100%;
    background: #f8fafc;
    min-height: 380px;
}

.dl-profile-sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dl-profile-main-details {
    flex: 2 1 500px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.dl-profile-member-name {
    font-size: 34px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 0 8px 0 !important;
    letter-spacing: -0.025em;
}

.dl-profile-meta-badge {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    color: #334155;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    width: fit-content;
    margin-bottom: 20px;
}

.dl-profile-biography-narrative {
    font-size: 15px;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 28px;
}

.dl-profile-social-connection-row {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.dl-social-connect-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.dl-profile-social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dl-universal-social-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: transform 0.2s, filter 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dl-universal-social-pill.fb { background: #1877F2; }
.dl-universal-social-pill.tw { background: #000000; }
.dl-universal-social-pill.li { background: #0A66C2; }
.dl-universal-social-pill.ig { background: #E1306C; }
.dl-universal-social-pill.yt { background: #FF0000; }

.dl-universal-social-pill:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

@media (max-width: 640px) {
    .dl-profile-main-details {
        padding: 24px;
    }
    .dl-profile-sidebar-avatar {
        min-height: 260px;
    }
}


/* ==========================================================================
   BREAKDANCE POPUP OVERRIDES & NORMALIZATION
   Strips large section paddings & forces elements to fit inside 240px popups
   ========================================================================== */

/* 1. Strip Breakdance section & container padding bloat */
.leaflet-popup-content .dl-breakdance-popup .bde-section,
.leaflet-popup-content .dl-breakdance-popup .section-container,
.leaflet-popup-content .dl-breakdance-popup div {
    margin: 0 !important;
    min-height: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 2. Constrain Breakdance image elements inside popups */
.leaflet-popup-content .dl-breakdance-popup img,
.leaflet-popup-content .dl-breakdance-popup .bde-image {
    width: 100% !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    margin-bottom: 8px !important;
}


/* ==========================================================================
   BREAKDANCE SOCIAL ICONS OVERRIDE (WITH HIGH-SPECIFICITY HIDE RULE)
   ========================================================================== */

/* 1. Force the social icons container into a neat horizontal row */
.leaflet-popup-content .dl-breakdance-popup .bde-social-icons,
.leaflet-popup-content .dl-breakdance-popup [class*="social"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 10px 0 0 0 !important;
    width: 100% !important;
}

/* 2. Lock individual social icon button dimensions */
.leaflet-popup-content .dl-breakdance-popup .bde-social-icon,
.leaflet-popup-content .dl-breakdance-popup [class*="social"] a,
.leaflet-popup-content .dl-breakdance-popup [class*="social"] > div {
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 3. Override the 100% img rule specifically for social SVGs and Images */
.leaflet-popup-content .dl-breakdance-popup [class*="social"] img,
.leaflet-popup-content .dl-breakdance-popup [class*="social"] svg,
.leaflet-popup-content .dl-breakdance-popup .bde-social-icon svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    object-fit: contain !important;
    margin: 0 !important;
}

/* 4. HIGH SPECIFICITY HIDE RULE: Forces display:none on empty '#' or blank links */
.leaflet-popup-content .dl-breakdance-popup [class*="social"] a[href="#"],
.leaflet-popup-content .dl-breakdance-popup [class*="social"] a[href=""],
.leaflet-popup-content .dl-breakdance-popup .bde-social-icons__icon-wrapper[href="#"],
.leaflet-popup-content .dl-breakdance-popup .bde-social-icons__icon-wrapper[href=""],
.dl-breakdance-popup .bde-social-icons__icon-wrapper[href="#"],
.dl-breakdance-popup .bde-social-icons__icon-wrapper[href=""],
.dl-breakdance-popup .bde-social-icons a[href="#"],
.dl-breakdance-popup .bde-social-icons a[href=""] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
}


/* ==========================================================================
   FORCE HIDE BREAKDANCE EMPTY IMAGES & BUTTONS
   ========================================================================== */

/* 1. Hide Breakdance Image when it outputs the default grey SVG placeholder */
.leaflet-popup-content .dl-breakdance-popup img[src*="data:image/svg+xml"],
.leaflet-popup-content .dl-breakdance-popup .bde-image[src*="data:image/svg+xml"],
.leaflet-popup-content .dl-breakdance-popup [class*="bde-image"] img[src*="data:image/svg+xml"],
.leaflet-popup-content .dl-breakdance-popup img[src=""],
.leaflet-popup-content .dl-breakdance-popup img:not([src]) {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
}

/* ==========================================================================
   HIDE UNLINKED BREAKDANCE BUTTONS (<button> tags)
   ========================================================================== */

/* 1. Hide buttons when Breakdance renders a plain <button> tag (no link assigned) */
.leaflet-popup-content .dl-breakdance-popup .bde-button button,
.leaflet-popup-content .dl-breakdance-popup button.bde-button__button,
.leaflet-popup-content .dl-breakdance-popup .bde-button:has(button) {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
}

/* 2. Hide buttons if an <a> tag is generated with '#' or blank link */
.leaflet-popup-content .dl-breakdance-popup .bde-button a[href="#"],
.leaflet-popup-content .dl-breakdance-popup .bde-button a[href=""],
.leaflet-popup-content .dl-breakdance-popup a.bde-button__button[href="#"],
.leaflet-popup-content .dl-breakdance-popup a.bde-button__button[href=""] {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
}