/* Therapeut List Block — plugin-scoped design tokens (independent of Kadence palette) */
.therapeut-list-container {
    --tv-accent: #282828;
    --tv-text-dark: #282828;
    --tv-text: #333333;
    --tv-text-light: #4d4d4d;
    --tv-text-muted: #646464;
    --tv-border: #e0e0e0;
    --tv-bg-subtle: #faf5ef;
    --tv-bg: #ffffff;
    --tv-radius: 4px;
    --tv-gray-400: #CBD5E0;

    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    overflow: visible;
}

/* Filter Bar */
.therapeut-filters {
    background: var(--tv-bg);
    border: 1px solid var(--tv-border);
    border-radius: var(--tv-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .therapeut-filters {
        position: sticky;
        top: 50px;
        z-index: 100;
    }
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 1rem;
    align-items: end;
}

.filter-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tv-text);
}

.filter-field input,
.filter-field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tv-border);
    border-radius: var(--tv-radius);
    font-size: 1rem;
    background: #fff;
}

.filter-field--narrow {
    max-width: fit-content;
    width: auto;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

/* Button hover: beige tone matching site design system (LIST-05) */
.filter-actions .button.button-primary,
.filter-actions .button.button-secondary {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.filter-actions .button.button-primary:hover,
.filter-actions .button.button-primary:focus {
    background-color: #f5e6d0;
    border-color: #e0c9a6;
    color: var(--tv-text-dark);
    box-shadow: none;
}

.filter-actions .button.button-secondary:hover,
.filter-actions .button.button-secondary:focus {
    background-color: #f5e6d0;
    border-color: #e0c9a6;
    color: var(--tv-text-dark);
    box-shadow: none;
}

/* Mobile Filter Toggle (hidden on desktop) */
.filter-toggle {
    display: none;
}

/* Result Count */
.therapeut-result-count {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--tv-text);
}

/* Therapist Cards Grid */
.therapeut-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.therapeut-card {
    background: var(--tv-bg);
    border: 1px solid var(--tv-border);
    border-radius: var(--tv-radius);
    padding: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.therapeut-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.therapeut-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.therapeut-card__name {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--tv-text-dark);
}

.therapeut-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.therapeut-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--tv-bg-subtle);
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--tv-text);
}

.therapeut-card__location {
    color: var(--tv-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.therapeut-card__excerpt {
    color: var(--tv-text);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Empty State */
.therapeut-empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--tv-text);
}

.therapeut-empty-state ul {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 400px;
    margin: 1rem auto;
}

.therapeut-empty-state li::before {
    content: '→ ';
    margin-right: 0.5rem;
    color: var(--tv-text-muted);
}

/* Pagination */
.therapeut-pagination {
    margin-top: 2rem;
    text-align: center;
}

.therapeut-pagination .page-numbers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.therapeut-pagination .page-numbers li {
    display: inline-block;
}

.therapeut-pagination .page-numbers a,
.therapeut-pagination .page-numbers span {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tv-border);
    border-radius: var(--tv-radius);
    text-decoration: none;
    color: var(--tv-text);
    min-width: 2.5rem;
    text-align: center;
    transition: background-color 0.2s ease;
}

.therapeut-pagination .page-numbers .current {
    background: var(--tv-accent);
    color: #fff;
    border-color: var(--tv-accent);
}

.therapeut-pagination .page-numbers a:hover {
    background: var(--tv-bg-subtle);
}

.therapeut-pagination .page-numbers .dots {
    border-color: transparent;
    background: none;
}

/* Map Integration - Layout */
.therapeut-layout {
    display: block;
    overflow: visible;
}

@media (min-width: 768px) {
    .therapeut-layout {
        display: grid;
        grid-template-columns: 60% 40%;
        gap: 1.5rem;
        align-items: start;
    }

    .therapeut-results-column {
        min-width: 0; /* Prevent grid blowout */
    }

    .therapeut-map-column {
        position: sticky;
        top: calc(50px + 1rem);
        height: calc(100vh - 50px - 2rem);
        max-height: 700px;
    }
}

/* Map Container */
.therapeut-map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--tv-radius);
    border: 1px solid var(--tv-border);
    overflow: hidden; /* Clip map tiles at border-radius */
}

#therapeut-map {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.therapeut-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tv-bg);
    color: var(--tv-text-muted);
    font-size: 0.95rem;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.therapeut-map-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Search Area Button */
.search-area-btn {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 0.5rem 1.25rem;
    background: #fff;
    border: 1px solid var(--tv-border);
    border-radius: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
    color: var(--tv-text-dark);
}

.search-area-btn:hover {
    background: var(--tv-bg-subtle);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile View Toggle (hidden on desktop) */
.view-toggle {
    display: none;
}

.view-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* Bottom Sheet (mobile marker click) */
.marker-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-height: 40vh;
    overflow-y: auto;
}

.marker-bottom-sheet.visible {
    transform: translateY(0);
}

.marker-bottom-sheet .sheet-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--tv-text-muted);
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-bottom-sheet .therapeut-mini-card h4 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    color: var(--tv-text-dark);
}

.marker-bottom-sheet .therapeut-mini-card p {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: var(--tv-text);
}

.marker-bottom-sheet .therapeut-mini-card .button {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1.25rem;
    min-height: 44px;
}

/* Hide bottom sheet on desktop */
@media (min-width: 768px) {
    .marker-bottom-sheet {
        display: none;
    }
}

/* Map Popup (desktop marker click — Google Maps InfoWindow) */
.gm-style .gm-style-iw {
    border-radius: var(--tv-radius) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    max-width: 250px;
}

.gm-style .gm-style-iw-d {
    padding: 0.5rem !important;
    overflow: auto !important;
}

.therapeut-popup h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--tv-text-dark);
}

.therapeut-popup p {
    margin: 0 0 0.25rem;
    font-size: 0.85rem;
    color: var(--tv-text);
}

.therapeut-popup a {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tv-accent);
    text-decoration: underline;
}

/* Card Highlight (map-list sync) */
.therapeut-card.highlighted {
    box-shadow: 0 0 0 3px var(--tv-accent);
    transition: box-shadow 0.3s ease;
}

/* Over-200 Hint */
.therapeut-map-hint {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--tv-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6d4c00;
}


/* Mobile Responsive (< 768px) */
@media (max-width: 767px) {
    /* Show mobile filter toggle */
    .filter-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding: 1rem;
        margin-bottom: 1rem;
        background: var(--tv-bg-subtle);
        border: 1px solid var(--tv-border);
        border-radius: var(--tv-radius);
        font-size: 1rem;
        cursor: pointer;
        min-height: 44px;
        text-align: left;
    }

    .filter-toggle__icon {
        font-size: 1.5rem;
        line-height: 1;
    }

    /* Hide filters by default on mobile */
    .therapeut-filters {
        display: none;
    }

    .therapeut-filters.is-visible {
        display: block;
    }

    /* Stack filter fields vertically */
    .filter-row {
        grid-template-columns: 1fr;
    }

    .filter-field--narrow {
        max-width: 100%;
    }

    /* Stack filter actions vertically */
    .filter-actions {
        flex-direction: column;
        width: 100%;
    }

    .filter-actions button,
    .filter-actions a {
        width: 100%;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Compact card padding on mobile */
    .therapeut-card {
        padding: 1rem;
    }

    /* Ensure pagination links are tappable */
    .therapeut-pagination .page-numbers a,
    .therapeut-pagination .page-numbers span {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile view toggle (shown on mobile) */
    .view-toggle {
        display: flex;
        background: var(--tv-bg-subtle);
        border-radius: 2rem;
        padding: 0.25rem;
        margin-bottom: 1rem;
    }

    .view-toggle label {
        flex: 1;
        padding: 0.75rem 1.5rem;
        text-align: center;
        border-radius: 2rem;
        cursor: pointer;
        transition: all 0.2s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--tv-text);
    }

    .view-toggle input:checked + label {
        background: var(--tv-accent);
        color: #fff;
    }

    /* Mobile: map column hidden by default, shown via JS toggle */
    .therapeut-map-column {
        display: none;
        height: calc(100vh - 300px);
        min-height: 400px;
    }

    .therapeut-map-column.active {
        display: block;
    }

    /* Mobile: hide list when map is active */
    .therapeut-results-column.hidden {
        display: none;
    }
}
