/**
 * Établissements Map - Styles
 */

/* Map wrapper */
.etablissements-map-wrapper {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

/* Map container */
.etablissements-map {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Editor placeholder */
.etablissements-map-editor {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.etablissements-map-editor:hover {
    border-color: #0073aa;
    background: #f8f8f8;
}

.etablissements-map-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.etablissements-map-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #0073aa;
    margin-bottom: 15px;
}

.etablissements-map-placeholder p {
    margin: 8px 0;
}

/* Custom popup styles */
.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.4;
    padding: 0 !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.etablissement-custom-popup .leaflet-popup-content-wrapper {
    padding: 0 !important;
}

.etablissement-custom-popup .leaflet-popup-tip {
    background: white !important;
}

/* Popup Card */
.etablissement-popup-card {
    width: 280px;
    max-width: 280px;
    background: white;
    overflow: hidden;
}

.popup-card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
}

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

/* Tags chipset overlay */
.popup-card-tags {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 20px);
    z-index: 10;
}

.popup-card-tag {
    display: inline-block;
    background: white;
    color: #000;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    border: none;
    line-height: 1.2;
    white-space: nowrap;
}

.popup-card-content {
    padding: 12px;
}

.popup-card-title {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-card-excerpt {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-card-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.popup-card-address svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #000;
}

.popup-card-address span {
    flex: 1;
}

.popup-card-link {
    display: inline-block;
    color: #000 !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline !important;
    text-underline-offset: 2px;
    transition: color 0.3s ease;
    cursor: pointer;
}

.popup-card-link:hover {
    color: #FFED00 !important;
    text-decoration: underline !important;
}

/* Responsive */
@media (max-width: 768px) {
    .etablissements-map {
        height: 400px !important;
        min-height: 400px;
    }
    
    .etablissements-map-wrapper {
        margin: 15px 0;
    }
}

/* Fix Leaflet attribution positioning */
.leaflet-control-attribution {
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.8) !important;
}

/* Custom marker cluster styles (if needed later) */
.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.6);
}
