/**
 * document-map.css
 * Place at: wp-content/themes/YOUR-THEME/css/document-map.css
 */

/* ── Pulse animation for large clusters ────────────────────── */
@keyframes clusterPulse {
    0%   { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.55); }
    70%  { box-shadow: 0 0 0 18px rgba(236, 72, 153, 0);  }
    100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0);     }
}

/* ── Outer section wrapper ──────────────────────────────────── */
.document-map-section {
    width: 100%;
    position: relative;
    font-family: inherit;
}

/* ── Map + panel container ──────────────────────────────────── */
#document-map-container {
    position: relative;
    width: 100%;
    height: 620px;         /* Adjust to taste */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* ── The map canvas ─────────────────────────────────────────── */
#document-map {
    width: 100%;
    height: 100%;
}

/* ── Slide-in document list panel ───────────────────────────── */
#document-list-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 90%;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity  0.3s ease;
    overflow: hidden;
}

#document-list-panel.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* ── Panel header ───────────────────────────────────────────── */
.panel-header {
    padding: 16px 18px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

#panel-back-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
    margin-bottom: 8px;
    transition: background 0.15s, color 0.15s;
}

#panel-back-btn:hover {
    background: #374151;
    color: #fff;
}

#panel-location-title {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

#panel-doc-count {
    font-size: 13px;
    color: #6b7280;
}

/* ── Document list ──────────────────────────────────────────── */
#document-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
}

#document-list::-webkit-scrollbar {
    width: 5px;
}
#document-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.doc-list-item {
    border-bottom: 1px solid #f3f4f6;
}

.doc-list-item:last-child {
    border-bottom: none;
}

.doc-list-link {
    display: block;
    padding: 12px 18px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.doc-list-link:hover {
    background: #f0f9ff;
}

.doc-list-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1d4ed8;
    margin-bottom: 3px;
    line-height: 1.4;
}

.doc-list-address {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.doc-list-excerpt {
    display: block;
    font-size: 12px;
    color: #374151;
    line-height: 1.5;

    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    #document-map-container {
        height: 480px;
        border-radius: 8px;
    }

    #document-list-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        height: 55%;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity  0.3s ease;
    }

    #document-list-panel.hidden {
        transform: translateY(100%);
    }
}
