/*
 * EB Event Map
 * Styled after the EB app's Map screen: round pins, group chips, a floating search
 * field and a pin card over the bottom of the map. Uses the theme's font.
 */
.ebm {
    --ebm-accent: #002856;
    --ebm-navy: #002856;
    --ebm-royal: #0066B3;
    --ebm-yellow: #F8DB00;
    --ebm-ink: #0B1F3A;
    --ebm-grey: #55565A;
    --ebm-line: #E3E7ED;
    --ebm-soft: #E9EEF5;
    --ebm-bg: #F2F4F7;
    --ebm-height: 640px;
    --ebm-radius: 18px;
    --ebm-shadow-button: 0 1px 3px rgba(0, 40, 86, .1);
    --ebm-shadow-card: 0 1px 2px rgba(0, 40, 86, .06), 0 4px 14px rgba(0, 40, 86, .05);
    --ebm-shadow-sheet: 0 10px 30px rgba(0, 40, 86, .25);
    margin: 1.5em 0;
    color: var(--ebm-ink);
    line-height: 1.4;
}

.ebm *,
.ebm *::before,
.ebm *::after {
    box-sizing: border-box;
}

.ebm [hidden] {
    display: none !important;
}

.ebm button,
.ebm input {
    font: inherit;
    color: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.ebm button {
    cursor: pointer;
    margin: 0;
}

.ebm button:focus-visible,
.ebm a:focus-visible,
.ebm input:focus-visible,
.ebm .leaflet-marker-icon:focus-visible {
    outline: 2px solid var(--ebm-accent);
    outline-offset: 2px;
}

.ebm__title {
    margin: 0 0 .75em;
    color: var(--ebm-navy);
}

/* Stage -------------------------------------------------------------------- */

.ebm__stage {
    position: relative;
    height: min(var(--ebm-height), 82vh);
    min-height: 280px;
    overflow: hidden;
    border-radius: var(--ebm-radius);
    background: #dfe6ee;
    box-shadow: var(--ebm-shadow-card);
    isolation: isolate;
}

.ebm__map {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #dfe6ee;
    font: inherit;
}

.ebm__status {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 24px;
    text-align: center;
    color: var(--ebm-grey);
}

.ebm__status strong {
    color: var(--ebm-navy);
    font-size: 17px;
}

.ebm__status--static {
    position: static;
}

.ebm__stage--preview {
    height: min(var(--ebm-height), 320px);
    background: var(--ebm-soft);
}

/* Full screen */

.ebm--expanded .ebm__stage {
    position: fixed;
    inset: 0;
    z-index: 100000;
    height: auto;
    border-radius: 0;
}

html.ebm-lock,
html.ebm-lock body {
    overflow: hidden;
}

/* Top: search, chips, results --------------------------------------------- */

.ebm__top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 22px;
    background: linear-gradient(rgba(242, 244, 247, .95) 60%, rgba(242, 244, 247, 0));
    pointer-events: none;
}

.ebm__top > * {
    pointer-events: auto;
}

.ebm__row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ebm__search {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 520px;
    height: 48px;
    margin: 0 auto 0 0;
    padding: 0 14px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 40, 86, .12);
    color: var(--ebm-grey);
    cursor: text;
}

.ebm__search svg {
    flex: none;
}

.ebm .ebm__search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    outline: 0;
    font-size: 15px;
    color: var(--ebm-ink);
    -webkit-appearance: none;
    appearance: none;
}

.ebm__search input::placeholder {
    color: var(--ebm-grey);
    opacity: 1;
}

.ebm__search:focus-within {
    outline: 2px solid var(--ebm-accent);
    outline-offset: 1px;
}

.ebm__chips {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 2px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ebm__chips::-webkit-scrollbar {
    display: none;
}

.ebm .ebm__chip {
    flex: none;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--ebm-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: none;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: var(--ebm-ink);
    white-space: nowrap;
}

.ebm .ebm__chip.is-active {
    border-color: transparent;
    font-weight: 600;
}

.ebm__panel {
    max-width: 520px;
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
    border-radius: var(--ebm-radius);
    background: #fff;
    box-shadow: var(--ebm-shadow-sheet);
}

.ebm__none {
    margin: 0;
    padding: 12px;
    font-size: 14px;
    color: var(--ebm-grey);
}

.ebm .ebm__place {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 12px;
    background: none;
    box-shadow: none;
    text-align: left;
}

.ebm .ebm__place:hover,
.ebm .ebm__place:focus-visible {
    background: var(--ebm-bg);
}

.ebm__place-dot {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.ebm__place-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ebm__place-text strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--ebm-navy);
}

.ebm__place-text span {
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 300;
    color: var(--ebm-grey);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Layer list */

.ebm__layer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 9px 10px;
    font-size: 15px;
    color: var(--ebm-navy);
    cursor: pointer;
}

.ebm__layer-name {
    flex: 1;
    min-width: 0;
}

.ebm__swatch {
    flex: none;
    width: 18px;
    height: 14px;
    border-radius: 3px;
}

.ebm__swatch--line {
    height: 4px;
}

.ebm .ebm__layer input {
    position: relative;
    flex: none;
    width: 40px;
    height: 24px;
    margin: 0;
    border: 0;
    border-radius: 12px;
    background: var(--ebm-line);
    cursor: pointer;
    transition: background .15s;
    -webkit-appearance: none;
    appearance: none;
}

.ebm .ebm__layer input::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    margin: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 40, 86, .25);
    transition: transform .15s;
}

.ebm .ebm__layer input:checked {
    background: var(--ebm-accent);
}

.ebm .ebm__layer input:checked::before {
    transform: translateX(16px);
}

/* Round buttons ------------------------------------------------------------ */

.ebm .ebm__round,
.ebm .ebm__zoom button {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--ebm-shadow-button);
    color: var(--ebm-navy);
}

.ebm .ebm__round.is-active {
    background: var(--ebm-yellow);
    box-shadow: none;
}

.ebm__row .ebm__round {
    margin-top: 2px;
}

.ebm__side {
    position: absolute;
    right: 16px;
    bottom: 24px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ebm__zoom {
    position: absolute;
    left: 16px;
    bottom: 36px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--ebm-shadow-button);
}

.ebm .ebm__zoom button {
    width: 40px;
    height: 40px;
    border-radius: 0;
    box-shadow: none;
}

.ebm .ebm__zoom button + button {
    border-top: 1px solid var(--ebm-line);
}

@media (pointer: coarse) {
    .ebm__zoom {
        display: none;
    }
}

.ebm--selected .ebm__side,
.ebm--selected .ebm__zoom {
    display: none;
}

/* Pins and labels ---------------------------------------------------------- */

.ebm .ebm-pin-icon,
.ebm .ebm-label-icon,
.ebm .ebm-here-icon {
    border: 0;
    background: none;
}

.ebm-pin {
    position: relative;
    width: 36px;
    height: 36px;
}

.ebm-pin__dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 40, 86, .35);
    transition: transform .15s ease;
}

.ebm-pin.is-selected .ebm-pin__dot {
    transform: scale(1.222);
}

.ebm-badge {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.ebm-img {
    display: block;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}

.ebm-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ebm-label {
    display: none;
    width: 140px;
    overflow: hidden;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: var(--ebm-navy);
    text-shadow: 0 0 3px rgba(255, 255, 255, .95), 0 0 3px rgba(255, 255, 255, .95), 0 0 2px #fff;
    pointer-events: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ebm-pin .ebm-label {
    position: absolute;
    top: 40px;
    left: 50%;
    margin-left: -70px;
}

.ebm--labels .ebm-label {
    display: -webkit-box;
}

.ebm--dark .ebm-label {
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 0, 0, .85), 0 0 3px rgba(0, 0, 0, .85), 0 0 2px #000;
}

.ebm-here {
    width: 20px;
    height: 20px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #1A73E8;
    box-shadow: 0 0 0 6px rgba(26, 115, 232, .2), 0 1px 4px rgba(0, 0, 0, .3);
}

.ebm .leaflet-interactive:focus {
    outline: none;
}

.ebm .leaflet-control-attribution {
    padding: 1px 6px;
    border-radius: 0 8px 0 0;
    background: rgba(255, 255, 255, .75);
    font-size: 10px;
    color: var(--ebm-grey);
}

.ebm .leaflet-control-attribution a {
    color: inherit;
}

/* Card ---------------------------------------------------------------------- */

.ebm__card {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 4;
    width: min(520px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    overflow-y: auto;
    padding: 16px;
    border-radius: var(--ebm-radius);
    background: #fff;
    box-shadow: var(--ebm-shadow-sheet);
    transform: translateX(-50%);
    animation: ebm-up .3s ease;
}

@keyframes ebm-up {
    from {
        opacity: 0;
        transform: translate(-50%, 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ebm__card {
        animation: none;
    }

    .ebm-pin__dot {
        transition: none;
    }
}

.ebm__photo {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 12px;
    border-radius: 12px;
    object-fit: cover;
}

.ebm__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ebm__tile {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.ebm__head-text {
    flex: 1;
    min-width: 0;
    align-self: center;
}

.ebm .ebm__head-text h3 {
    margin: 0;
    padding: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ebm-navy);
}

.ebm .ebm__head-text p {
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 300;
    color: var(--ebm-grey);
    white-space: pre-line;
}

.ebm .ebm__close {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: -4px -4px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    box-shadow: none;
    color: var(--ebm-grey);
}

.ebm .ebm__close:hover {
    background: var(--ebm-bg);
}

.ebm__info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    margin-top: 12px;
    overflow-y: auto;
}

.ebm__hours {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13.5px;
    color: var(--ebm-navy);
    white-space: pre-line;
}

.ebm__hours svg {
    flex: none;
    margin-top: 2px;
    color: var(--ebm-royal);
}

.ebm__fact {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: var(--ebm-grey);
}

.ebm__fact strong {
    font-size: 13.5px;
    font-weight: 600;
    text-align: right;
    color: var(--ebm-navy);
}

.ebm .ebm__body {
    margin: 0;
    font-size: 13.5px;
    font-weight: 300;
    line-height: 1.45;
    white-space: pre-line;
}

.ebm__actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.ebm__actions + .ebm__actions {
    margin-top: 8px;
}

.ebm .ebm__action {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: var(--ebm-soft);
    box-shadow: none;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    color: var(--ebm-navy);
}

.ebm .ebm__action--primary {
    background: var(--ebm-accent);
    color: #fff;
}

.ebm .ebm__action:hover {
    filter: brightness(.96);
}

/* Messages ------------------------------------------------------------------ */

.ebm__toast,
.ebm__hint {
    position: absolute;
    left: 50%;
    z-index: 5;
    max-width: calc(100% - 32px);
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(0, 40, 86, .92);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    transform: translateX(-50%);
    pointer-events: none;
}

.ebm__toast {
    bottom: 24px;
}

.ebm__hint {
    top: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity .2s;
}

.ebm--hint .ebm__hint {
    opacity: 1;
}

/* List of places (list="yes") ---------------------------------------------- */

.ebm__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.ebm__list-group {
    padding: 12px 8px 8px;
    border-radius: var(--ebm-radius);
    background: #fff;
    box-shadow: var(--ebm-shadow-card);
}

.ebm .ebm__list-group h3 {
    margin: 0 0 4px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ebm-grey);
}

/* Narrow maps --------------------------------------------------------------- */

@media (max-width: 600px) {
    .ebm__top {
        padding: 12px 12px 20px;
    }

    .ebm__chips {
        margin: 0 -12px;
        padding: 2px 12px;
    }

    .ebm__side {
        right: 12px;
    }
}
