/* placeholder panel, only what it takes to sit over the map and scroll */
.interpreters-panel {
    width: 21rem;
    padding: var(--space-xs);
    border: 1px solid var(--border);
    background: var(--surface);
    font-family: var(--font);
}

/* title w/ the clear button on its right, the row keeps its height when the button hides */
.interpreters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
    min-height: 2rem;
}

.interpreters-panel h2 {
    margin: 0;
    font-size: 1.5rem;
}

/* only shows while an interpreter is selected */
.interpreters-clear {
    padding: 0.3rem 0.5rem 0.15rem; /* josefin sans sits high, nudge the text down so it looks centered */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: var(--text-sm);
    cursor: pointer;
}

.interpreters-clear:hover,
.interpreters-clear:focus-visible {
    background: rgb(25 34 29 / 8%);
    color: var(--text);
}

.interpreters-clear[hidden] {
    display: none;
}

.interpreters-panel ul {
    max-height: 24rem;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

/* what the list is narrowed to, w/ a way back to every interpreter */
.interpreters-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
    margin: var(--space-xs) 0;
    padding: var(--space-xs) 0.5rem;
    background: color-mix(in srgb, var(--accent-bright) 10%, transparent);
    border-left: 3px solid var(--accent-bright);
    font-size: var(--text-sm);
}

.interpreters-filter[hidden],
.interpreters-empty[hidden] {
    display: none;
}

.interpreters-filter p {
    margin: 0;
    padding-top: 0.15rem; /* josefin sans sits high */
}

.interpreters-show-all {
    flex: none;
    padding: 0.3rem 0.5rem 0.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.interpreters-show-all:hover,
.interpreters-show-all:focus-visible {
    background: rgb(25 34 29 / 8%);
}

.interpreters-empty {
    margin: var(--space-xs) 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* name button on the left, site link on the right */
.interpreter {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* buttons for keyboard use, but they read as plain text labels */
.interpreters-panel li button {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-xs);
    width: 100%;
    padding: var(--space-xs) 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.interpreters-panel li button[aria-pressed="true"] {
    font-weight: 700;
}

/* how many of a family, group, or place's languages each interpreter covers */
.interpreter-count {
    flex: none;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 400;
}

/* opens the interpreter's site, kept apart from the name so selecting and visiting stay two actions */
.interpreter-site {
    display: grid;
    flex: none;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
}

.interpreter-site:hover,
.interpreter-site:focus-visible {
    border-color: var(--accent-bright);
    background: color-mix(in srgb, var(--accent-bright) 10%, transparent);
    color: var(--accent-bright);
    outline: none; /* the accent border shows focus */
}
