/* Groups finder map (page-groups.php). Loaded only on the Groups page, after Leaflet's own stylesheet. */
.about-block--white + .groups-finder { padding-top: 0; }   /* follows straight on from the white intro block */

.groups-finder .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.groups-finder-preview {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    background: #fff4d6;
    color: #6b4f00;
    font-size: 0.8rem;
    font-weight: 600;
}
.groups-finder-intro { max-width: 46rem; margin-bottom: 1.2rem; }

/* Search */
.groups-finder-search { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.groups-finder-search input {
    flex: 1 1 320px;
    min-width: 0;
    padding: 0.75rem 1.1rem;
    border: 1.5px solid rgba(75, 107, 68, 0.35);
    border-radius: 2rem;
    font: inherit;
    font-size: 1rem;
    background: #fff;
}
.groups-finder-search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(75, 107, 68, 0.18); }
.groups-finder-go,
.groups-finder-locate {
    padding: 0.75rem 1.3rem;
    border-radius: 2rem;
    border: 1.5px solid var(--green);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}
.groups-finder-go { background: var(--green); color: #fff; }
.groups-finder-go:hover { background: var(--green-dark); border-color: var(--green-dark); }
.groups-finder-locate { background: #fff; color: var(--green); }
.groups-finder-locate:hover { background: #eef2ec; }
.groups-finder-go:disabled,
.groups-finder-locate:disabled { opacity: 0.6; cursor: wait; }

/* Activity filter + small buttons */
.groups-finder-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-bottom: 1rem; }
.groups-finder-filter-label { margin-right: 0.3rem; font-size: 0.9rem; font-weight: 600; }
.groups-finder-filter-count { margin-left: 0.3rem; font-size: 0.8rem; color: var(--text-muted, #666); }
.groups-finder-chip {
    padding: 0.35rem 0.8rem;
    border: 1.5px solid rgba(75, 107, 68, 0.35);
    border-radius: 2rem;
    background: #fff;
    color: var(--green-dark);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    transition: background var(--transition), border-color var(--transition);
}
.groups-finder-chip:hover { border-color: var(--green); background: #eef2ec; }
.groups-finder-chip.is-on { background: var(--green); border-color: var(--green); color: #fff; }

/* Result panel */
.groups-finder-result:empty { display: none; }
.groups-finder-result {
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    border-left: 4px solid var(--green);
    border-radius: var(--radius-card);
    background: #f3f6f1;
}
.groups-finder-result-head { margin: 0 0 0.7rem; font-size: 1.05rem; }
.groups-finder-result-note { margin: 0.8rem 0 0.5rem; font-size: 0.9rem; }
.groups-finder-result-note a { color: var(--green); text-decoration: underline; }
.groups-finder-result .groups-finder-card { display: flex; gap: 1rem; align-items: flex-start; }
.groups-finder-result .groups-finder-card-img { flex: 0 0 120px; width: 120px; height: 90px; margin: 0; }
.groups-finder-nearest,
.groups-finder-alts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.groups-finder-alts { margin-top: 0.9rem; font-size: 0.85rem; }

/* Map + list */
.groups-finder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 1rem; }
.groups-finder-map {
    position: relative;
    z-index: 0;   /* keep Leaflet's panes under the sticky site header */
    height: min(70vh, 640px);
    min-height: 420px;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: #e8efe9;
}
.groups-finder .leaflet-container { font: inherit; }
.groups-finder-list { max-height: min(70vh, 640px); overflow-y: auto; }
.groups-finder-list-heading { margin: 0 0 0.4rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted, #666); }
.groups-finder-list ul { list-style: none; margin: 0; padding: 0; }
.groups-finder-list button {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.55rem;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text);
    font-size: 0.9rem;
    text-align: left;
}
.groups-finder-list button:hover,
.groups-finder-list button.is-active { background: #eef2ec; }
.groups-finder-list button.is-active { font-weight: 700; }
.groups-finder-list-note { flex-basis: 100%; padding-left: 1.4rem; font-size: 0.75rem; font-weight: 400; color: var(--text-muted, #666); }
.groups-finder-swatch { flex: 0 0 14px; height: 14px; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 3px; }
.groups-finder-swatch.is-pin { border-radius: 50%; }

/* Group card (popups and results) */
.groups-finder-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; line-height: 1.3; color: var(--green-dark); }
.groups-finder-card-img { display: block; width: 100%; height: 110px; margin-bottom: 0.6rem; object-fit: cover; border-radius: 6px; }
.groups-finder-card-area { margin: 0 0 0.35rem; font-size: 0.82rem; color: #555; }
.groups-finder-card-desc { margin: 0 0 0.5rem; font-size: 0.86rem; line-height: 1.5; color: #444; }
.groups-finder-card-contact { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.groups-finder-card-contact li { margin: 0.2rem 0; overflow-wrap: anywhere; }
.groups-finder-card-contact a { color: var(--green); text-decoration: underline; }
.groups-finder-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; margin: 0 0 0.55rem; padding: 0; }
.groups-finder-tags li { padding: 0.12rem 0.55rem; border-radius: 2rem; background: #e7eee4; color: var(--green-dark); font-size: 0.72rem; font-weight: 600; }
.groups-finder-tags li.is-match { background: var(--green); color: #fff; }

.groups-finder-popup .leaflet-popup-content { margin: 14px 16px; font-size: 0.9rem; line-height: 1.45; }
.groups-finder-popup .leaflet-popup-content-wrapper { border-radius: 10px; }
.groups-finder-popup .groups-finder-nearest { flex-direction: column; align-items: stretch; }
.groups-finder-popup .groups-finder-chip { border-radius: 1rem; text-align: left; }
.groups-finder-missing { margin: 0.75rem 0 0; padding-top: 0.6rem; border-top: 1px solid rgba(0, 0, 0, 0.08); font-size: 0.85rem; color: #555; }
.groups-finder-missing a { color: var(--green); font-weight: 600; text-decoration: underline; }
.groups-finder-tip { font-weight: 600; }

/* Map / Satellite toggle (Leaflet control, top right) */
.groups-finder-basemap {
    display: flex;
    overflow: hidden;
    border-radius: 2rem;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}
.groups-finder-basemap button {
    padding: 0.45rem 0.9rem;
    border: 0;
    background: #fff;
    color: var(--green-dark);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}
.groups-finder-basemap button + button { border-left: 1px solid rgba(0, 0, 0, 0.12); }
.groups-finder-basemap button:hover { background: #eef2ec; }
.groups-finder-basemap button.is-on { background: var(--green); color: #fff; }

/* Markers */
.groups-finder-pin,
.groups-finder-search-pin { background: none; border: 0; }
.groups-finder-search-pin svg { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }
.leaflet-tooltip.groups-finder-search-label {
    max-width: 240px;
    padding: 0.3rem 0.65rem;
    border: 0;
    border-radius: 6px;
    background: #b3261e;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: normal;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.leaflet-tooltip-top.groups-finder-search-label::before { border-top-color: #b3261e; }
.groups-finder-result-match { margin: -0.4rem 0 0.7rem; font-size: 0.8rem; color: var(--text-muted, #666); }

.groups-finder-credit { margin-top: 0.6rem; font-size: 0.75rem; color: var(--text-muted, #777); }
.groups-finder-credit a { color: inherit; text-decoration: underline; }

@media (max-width: 900px) {
    .groups-finder-layout { grid-template-columns: 1fr; }
    .groups-finder-list { max-height: none; }
    .groups-finder-list ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.1rem 0.5rem; }
}
@media (max-width: 600px) {
    .groups-finder-map { height: 62vh; min-height: 360px; }
    .groups-finder-go,
    .groups-finder-locate { flex: 1 1 auto; }
    .groups-finder-result .groups-finder-card { display: block; }
    .groups-finder-result .groups-finder-card-img { width: 100%; height: 120px; margin-bottom: 0.6rem; }
}
