@media screen and (min-width: 1200px) {
	#content {
      max-width: 1350px;
  	}
}

#colony-map-container {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    border: 1px solid #ccc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}


/* Kills hidden paragraph tags WordPress sometimes adds around shortcodes */
p:has(> #colony-map-container) {
    display: none !important;
    margin: 0 !important;
}

#colony-leaflet-map {
    width: 100%;
    aspect-ratio: 2000 / 1431; 
    background: transparent; 
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. Map Polygons */
.plot-polygon-unsold, .plot-polygon-sold {
    cursor: pointer;
}

/* 3. Popup Container Styling */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important; 
    padding: 8px !important;
}

/* Dynamic Status Colors */
.popup-unsold .leaflet-popup-content-wrapper,
.popup-unsold .leaflet-popup-tip {
    background-color: #27ae60 !important; 
    color: #ffffff !important;
}

.popup-sold .leaflet-popup-content-wrapper,
.popup-sold .leaflet-popup-tip {
    background-color: #d35400 !important; 
    color: #ffffff !important;
}

/* 4. Internal Popup Content Customization */
.leaflet-popup-content {
    width: max-content !important; /* Adjusts perfectly to the text width */
    min-width: 140px !important;   /* Prevents it from looking too tiny on empty plots */
    max-width: 280px !important;   /* Stops it from getting too wide if a name is very long */
    margin: 12px 16px !important;
}

.cim-popup {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.cim-popup h3.cim-title {
    margin: 0 0 8px 0;
    font-size: 19px;
    font-weight: bold;
    color: #ffffff !important; 
}

.cim-popup hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.4); 
    margin: 8px 0;
}

/* Make the close 'x' icon white */
.leaflet-container a.leaflet-popup-close-button {
    color: #ffffff !important;
    font-size: 18px !important;
    padding: 6px 6px 0 0 !important;
    font-weight: bold;
}
.leaflet-container a.leaflet-popup-close-button:hover {
    color: #eeeeee !important;
    background: transparent !important;
}

/* Sleek outline badge design */
.cim-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px; /* Creates a modern pill shape */
    margin: 0 0 8px 0;
    background-color: transparent; 
    border: 1px solid rgba(255, 255, 255, 0.6); /* Clean white outline */
    color: #ffffff;
}

.cim-detail {
    margin: 4px 0;
}

/* Admin Data Box */
.cim-admin-fields {
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.15); 
    border-left: 4px solid #ffffff;
    border-radius: 0 4px 4px 0;
}

.cim-admin-tag {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
    color: #ffffff;
    opacity: 0.9;
    margin: 0 0 6px 0 !important;
}

/* Mobile Optimization to prevent popup overflow */
@media screen and (max-width: 480px) {
    .leaflet-popup-content {
        max-width: 230px !important; /* Slightly narrower for small phones */
        margin: 10px !important;
    }
}