/* Spec 269: the OpenStreetMap club maps - the place picker of the page look and the public map of clubs (/clubs).
   Leaflet's own sheet loads later (leafletLoader.js), so the map rules here carry one class more than its rules. */

/* The place picker: the "type it myself" switch, the map and the lookup note. */
.club-place-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-weight: 600;
    color: var(--tt-ink);
    cursor: pointer;
}

.club-place-switch-input {
    width: 18px;
    height: 18px;
    accent-color: var(--tt-accent);
}

.club-place .club-place-map {
    margin: 0 0 6px;
}

.club-place .planner-form-grid {
    margin-top: 10px;
}

.club-place-looking {
    margin: 8px 0 0;
}

.club-place-note {
    margin-top: 8px;
}

/* Both maps keep Leaflet's layers (z-index up to 1000) inside, under the menus and dialogs of the page. */
.club-place-map,
.club-finder-map {
    position: relative;
    z-index: 0;
    isolation: isolate;
}

/* Both maps: the theme's text, controls and popups instead of Leaflet's white boxes. */
:is(.club-place-map, .club-finder-map).leaflet-container {
    font-family: var(--tt-font-text);
    background: var(--tt-area);
}

:is(.club-place-map, .club-finder-map) .leaflet-bar a {
    background: var(--tt-field);
    color: var(--tt-ink);
    border-bottom-color: var(--tt-line);
}

:is(.club-place-map, .club-finder-map) .leaflet-bar a:hover {
    background: var(--tt-surface);
    color: var(--tt-accent);
}

/* Above leaflet.css, which the loader adds later: the credit on the site's own field, readable on any tile. */
.leaflet-container:is(.club-place-map, .club-finder-map) .leaflet-control-attribution {
    background: var(--tt-field);
    color: var(--tt-muted);
}

.leaflet-container:is(.club-place-map, .club-finder-map) .leaflet-control-attribution a {
    color: var(--tt-accent);
}

:is(.club-place-map, .club-finder-map) :is(.leaflet-popup-content-wrapper, .leaflet-popup-tip) {
    background: var(--tt-area);
    color: var(--tt-ink);
    border: 1px solid var(--tt-line);
    border-radius: 0;
}

:is(.club-place-map, .club-finder-map) .leaflet-popup-content {
    margin: 12px 14px;
    font-size: .95rem;
    line-height: 1.4;
}

:is(.club-place-map, .club-finder-map) a.leaflet-popup-close-button {
    color: var(--tt-muted);
}

/* The public map of clubs. */
.club-finder-page [hidden] {
    display: none !important;
}

.club-finder-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.club-finder-title-row .page-back-btn {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    margin-top: .25rem;
}

.club-finder-title-row .auth-header {
    min-width: 0;
    margin: 0;
    text-align: left;
}

.club-finder-search {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 .5rem;
}

.club-finder-search .game-filter-input {
    flex: 1 1 14rem;
    min-width: 0;
}

.auth-container .club-finder-search .game-card-btn {
    width: auto;
    margin: 0;
    padding: .55rem 1rem;
}

.club-finder-status {
    min-height: 1.4em;
    margin: 0 0 .5rem;
    color: var(--tt-muted);
}

.club-finder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.club-finder-map {
    height: clamp(320px, 58vh, 560px);
    border: 1px solid var(--tt-line);
}

.club-finder-side {
    min-width: 0;
}

.club-finder-side-title {
    margin: 0 0 .5rem;
    font-family: var(--tt-font-display);
    font-size: 1.05rem;
    color: var(--tt-ink);
}

.club-finder-more,
.club-finder-none {
    margin: 0 0 .5rem;
    color: var(--tt-muted);
}

.club-finder-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
}

.club-finder-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    min-width: 0;
}

li.club-finder-card {
    padding: .6rem .75rem;
    border: 1px solid var(--tt-line);
    background: var(--tt-field);
}

.club-finder-logo,
.club-finder-initials {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
}

.club-finder-logo {
    object-fit: cover;
    border: 1px solid var(--tt-line);
}

.club-finder-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: var(--tt-accent-soft);
    color: var(--tt-ink);
    border: 1px solid var(--tt-line);
}

.club-finder-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
    min-width: 0;
}

.club-finder-name {
    color: var(--tt-ink);
    overflow-wrap: anywhere;
}

.club-finder-city {
    color: var(--tt-muted);
    font-size: .9rem;
}

a.game-card-btn.club-finder-open {
    width: auto;
    margin: .35rem 0 0;
    padding: .4rem .8rem;
    text-decoration: none;
}

/* Wide screens: the list beside the map, scrolling on its own. */
@media (min-width: 900px) {
    .auth-container.club-finder-page .club-public-stack {
        max-width: 1100px;
    }

    .auth-container.club-finder-page .club-public-card-wide {
        max-width: none;
    }

    .club-finder-layout {
        grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    }

    .club-finder-side {
        max-height: clamp(320px, 58vh, 560px);
        overflow-y: auto;
    }
}
