/* Missouri State Parks - Interactive Explore (v1.7)
 *
 * Theme-aware version — text/headings/links inherit from the active theme.
 *
 * ArcGIS JS SDK web map + filter checkboxes + result card grid
 *   1. Full-width ArcGIS web map on top (native JS SDK)
 *   2. Filter checkboxes below (Locations + Lodging left, Things to Do right in columns)
 *   3. Results grid — cards with Missouri silhouette + pin
 */

.moparks-explore-interactive {
    position: relative;
}

/* ---- Map (ArcGIS JS SDK) ---- */

.moparks-explore-map {
    width: 100%;
    height: 500px;
    border-radius: var(--moparks-radius, 8px);
    border: 1px solid var(--moparks-border, rgba(0,0,0,0.12));
    margin-bottom: 2rem;
    overflow: hidden;
}

/* ---- Filter Section ---- */

.moparks-explore-filter-section {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.moparks-explore-filter-heading {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: inherit;
}

.moparks-explore-filter-col--locations {
    flex-shrink: 0;
    min-width: 200px;
}

.moparks-explore-filter-col--things {
    flex: 1;
    min-width: 0;
}

/* Things to Do — column flow so items fill top-to-bottom without row-height gaps */
.moparks-explore-things-grid {
    column-count: 3;
    column-gap: 0.75rem;
}

/* ---- Checkboxes ---- */

.moparks-filter-option {
    break-inside: avoid;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.25rem 0;
    font-size: 0.85rem;
    color: inherit;
    cursor: pointer;
    line-height: 1.3;
}

.moparks-filter-option:hover {
    opacity: 0.85;
}

.moparks-filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 1px 0 0 0;
    cursor: pointer;
}

/* ---- Results Header ---- */

.moparks-explore-count-bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--moparks-border, rgba(0,0,0,0.12));
}

.moparks-explore-results-heading {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: inherit;
}

.moparks-explore-count {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ---- Results Grid ---- */

.moparks-explore-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

/* ---- Facility Cards ---- */

.moparks-explore-card {
    background: inherit;
    border: 1px solid var(--moparks-border, rgba(0,0,0,0.12));
    border-radius: var(--moparks-radius, 8px);
    overflow: hidden;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.moparks-explore-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Missouri silhouette area */
.moparks-explore-card-map {
    background: rgba(0,0,0,0.04);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.moparks-mo-svg {
    width: 100%;
    max-width: 160px;
    height: auto;
}

/* Card body */
.moparks-explore-card-body {
    padding: 0.75rem 1rem 1rem;
    text-align: center;
}

.moparks-explore-card-title {
    margin: 0 0 0.3rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: inherit;
    line-height: 1.3;
}

.moparks-explore-card-title a {
    color: inherit;
    text-decoration: none;
}

.moparks-explore-card-title a:hover {
    text-decoration: underline;
}

.moparks-explore-card-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.15rem 0.4rem;
    font-size: 0.78rem;
    opacity: 0.7;
}

.moparks-explore-card-meta span + span::before {
    content: '|';
    margin-right: 0.4rem;
    opacity: 0.4;
}

/* ---- Loading State ---- */

.moparks-loading .moparks-explore-map,
.moparks-loading .moparks-explore-results {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ---- Responsive ---- */

@media (max-width: 1024px) {
    .moparks-explore-results {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .moparks-explore-map {
        height: 350px;
    }

    .moparks-explore-filter-section {
        flex-direction: column;
        gap: 1.5rem;
    }

    .moparks-explore-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .moparks-explore-results {
        grid-template-columns: 1fr;
    }
}

/* Reset Divi global td styles bleeding into ArcGIS popups */
.esri-widget td,
.esri-widget th,
.esri-widget tr,
.esri-widget table,
.esri-widget tr td,
.esri-widget tr th,
.entry-content .esri-widget tr td,
.entry-content .esri-widget tr th {
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
    background: none !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    font-family: inherit !important;
    max-width: none !important;
    border-collapse: collapse !important;
}
