/* MAP VIEW STYLES */
:root {
    --border: #e5e7eb;
    --muted: #6b7280;
    --bg: #ffffff;
    --chip: #f9fafb;
    --chip-b: #e5e7eb;
    --accent: #111827;
    --accent-ink: #fff;
    --ok-b: #d1fae5;
    --ok-bg: #ecfdf5;
}

.proy-results {
    padding: 1rem;
    background-color: #fff;
    border-radius: .7rem;
    margin-top: .5rem;
    margin-bottom: .5rem; font-weight:700; text-align:center;
}
.results-badge {
    color: #000 !important;
    font-size: 1.7rem;
}
a:hover {
    color: #5916c3;
}
/* Contenedor a 80% */
.site-wrap {
    width: 80%;
    margin: 0 auto;
}

@media (max-width:1024px) {
    .site-wrap {
        width: 100%;
    }
}

/* Grid general: fila principal + lista */
.explorer {
    display: grid;
    gap: .75rem;
    grid-template-rows: auto auto;
}

/* Fila principal: filtros + mapa (70% vh) */
.explorer-row {
    display: grid;
    grid-template-columns: minmax(260px,20rem) 1fr;
    gap: 1rem;
    align-items: stretch;
}

.filters {
    height: 80vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border);
    border-radius: .5rem;
    padding: .75rem;
    background: var(--bg);
}

    .filters .hdr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        margin-bottom: .5rem;
    }

        .filters .hdr h2 {
            font-weight: 700;
            margin: 0;
        }

.controls .control {
    margin-bottom: .75rem;
}

.controls label {
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: .25rem;
    display: block;
}

.filter-dropdown__trigger {
    width: 100%;
    min-height: 2.4rem;
    padding: .45rem 2rem .45rem .65rem;
    border: 1px solid var(--border);
    border-radius: .375rem;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-dropdown__trigger::after {
    border-color: #6b7280 transparent transparent;
    border-style: solid;
    border-width: .35rem .3rem 0;
    content: "";
    position: absolute;
    right: .7rem;
    top: calc(50% - .15rem);
}

.filter-dropdown__trigger[aria-expanded="true"] {
    border-color: #5916c3;
    box-shadow: 0 0 0 .15rem rgba(89, 22, 195, .16);
}

.filter-dropdown-portal {
    position: relative;
    z-index: 2147483000;
}

.filter-dropdown__menu {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: .375rem;
    box-shadow: 0 .75rem 1.75rem rgba(15, 23, 42, .2);
    overflow-x: hidden;
    overflow-y: auto;
    padding: .25rem;
    position: fixed;
    z-index: 2147483000;
}

.filter-dropdown__menu[hidden],
.filter-value-control[hidden] {
    display: none !important;
}

.filter-option,
.filter-period-option {
    background: #fff;
    border: 0;
    border-radius: .25rem;
    color: #1f2937;
    cursor: pointer;
    display: block;
    font: inherit;
    padding: .48rem .6rem;
    text-align: left;
    width: 100%;
}

.filter-option:hover,
.filter-option:focus,
.filter-period-option:hover,
.filter-period-option:focus {
    background: #f5f3ff;
    outline: none;
}

.filter-option.is-selected,
.filter-period-option.is-selected {
    background: #ede9fe;
    color: #4c1d95;
    font-weight: 700;
}

.filter-periods {
    border: 1px solid var(--border);
    border-radius: .375rem;
    height: 10rem;
    overflow-x: hidden;
    overflow-y: auto;
    padding: .25rem;
    scrollbar-gutter: stable;
}

.filters-footer {
    background: var(--bg);
    margin: 0 -.25rem;
    padding: .25rem .25rem .75rem;
}

.actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: .5rem;
}

.btn {
    padding: .375rem .6rem;
    border-radius: .375rem;
}

    .btn:hover {
        background: #f9fafb;
    }

/* Mapa */
.map-viewport {
    height: 80vh;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: .5rem;
    overflow: hidden;
}

/* Lista completa: el documento crece para mostrar todos los proyectos de la página. */
.results {
    height: auto;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: #fff;
    display: grid;
    grid-template-rows: auto auto auto;
    overflow: visible;
}

.results-list {
    overflow: visible;
    padding: .75rem;
    display: grid;
    gap: .5rem;
}

.card {
    border: 1px solid var(--border);
    border-radius: .5rem;
    padding: .6rem .75rem;
    background: #fff;
}

    .card:hover {
        box-shadow: 0 2px 10px rgba(0,0,0,.05);
    }

.card-title {
    font-weight: 700;
    text-decoration: none;
    color: #1f2937;
}

.card .meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .25rem;
}

.chip {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999px;
    border: 1px solid var(--chip-b);
    font-size: .75rem;
    color: #374151;
    background: var(--chip);
}

    .chip.val {
        border-color: var(--ok-b);
        background: var(--ok-bg);
    }

.muted {
    color: var(--muted);
}

/* Paginador al final del listado */
.pager {
    border-top: 1px solid var(--border);
    padding: .5rem;
    background: #fff;
    display: flex;
    gap: .25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pg-btn {
    border: 1px solid var(--border);
    background: #fff;
    padding: .5rem;
    border-radius: .375rem;
    font-size: .85rem;
}

    .pg-btn.active {
        background: #5916c3;
        color: #ffffff;
        border-color: #5916c3;
    }

.pg-ellipsis {
    padding: .25rem .5rem;
    color: #9ca3af;
}

/* Mobile: filtros arriba, mapa debajo */
@media (max-width:1024px) {
    .explorer-row {
        grid-template-columns: 1fr;
    }

    .filters {
        height: min(70vh,36rem);
        min-height: 24rem;
    }

    .map-viewport {
        height: 60vh;
    }

    .results {
        height: auto;
        max-height: auto;
    }
}

@media (max-width:768px) {


    .results {
        height: auto;
        max-height: auto;
    }
}
