/* Right-click on the logo (inc/brand_menu.php): a small window under the logo, with a tip pointing at it, with
   the logo files and the brand colours. Self-contained: it shows on every page, whatever the page's own styles. */

.bm {
    --bm-ink: #14272c;
    --bm-muted: #5f686b;
    --bm-line: #e3eaed;
    --bm-soft: #f3f6f7;
    --bm-accent: #f37720;
    --bm-ease: 140ms ease;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10050;
    box-sizing: border-box;
    width: 300px;
    max-width: calc(100vw - 16px);
    padding: 16px;
    border: 1px solid var(--bm-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(20, 39, 44, .16), 0 2px 6px rgba(20, 39, 44, .08);
    color: var(--bm-ink);
    font-family: "Cabin", sans-serif;
    font-size: 15px;
    line-height: 1.3;
    text-align: left;
    transform-origin: var(--bm-tip, 50%) top;
    animation: bm-in 140ms ease-out;
}
.bm[hidden] { display: none; }
.bm[data-side="above"] { transform-origin: var(--bm-tip, 50%) bottom; }
/* the tip: a square turned 45°, with the window's border on the two sides that show */
.bm::before {
    content: "";
    position: absolute;
    left: var(--bm-tip, 50%);
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border: 1px solid var(--bm-line);
    background: #fff;
    transform: rotate(45deg);
}
.bm[data-side="below"]::before { top: -8px; border-right: 0; border-bottom: 0; border-top-left-radius: 3px; }
.bm[data-side="above"]::before { bottom: -8px; border-left: 0; border-top: 0; border-bottom-right-radius: 3px; }
.bm:focus { outline: 0; }
.bm *,
.bm *::before,
.bm *::after { box-sizing: border-box; }
@keyframes bm-in {
    from { opacity: 0; transform: translateY(-4px) scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
    .bm { animation: none; }
}
.bm ul { margin: 0; padding: 0; list-style: none; }
.bm li::before { content: none; }
.bm p { margin: 0; }
.bm .bm-title { margin-bottom: 12px; font-size: 15px; font-weight: 700; }

/* the logos: a small preview, the name and the two files */
.bm-logos { display: grid; gap: 4px; }
.bm-logo { display: flex; align-items: center; gap: 10px; }
.bm-logo-preview {
    flex: none;
    display: grid;
    place-items: center;
    width: 76px;
    height: 44px;
    padding: 6px 8px;
    border-radius: 9px;
    background: var(--bm-soft);
}
.bm-logo-preview--dark { background: var(--bm-ink); }
.bm-logo-preview img { display: block; max-width: 100%; max-height: 32px; }
.bm-logo-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.bm .bm-dl {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid var(--bm-line);
    border-radius: 8px;
    color: var(--bm-ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
    transition: border-color var(--bm-ease), background-color var(--bm-ease);
}

/* the colours: a row of chips with the hex under each; the chip shows a tick once copied */
.bm .bm-sub {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 16px 0 8px;
    padding-top: 14px;
    border-top: 1px solid var(--bm-line);
    font-size: 14px;
    font-weight: 700;
}
.bm-sub span { font-size: 12px; font-weight: 400; color: var(--bm-muted); }
.bm-colours { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.bm .bm-colour {
    display: grid;
    justify-items: center;
    gap: 5px;
    width: 100%;
    margin: 0;
    padding: 6px 0 5px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--bm-ink);
    font: inherit;
    cursor: pointer;
    transition: background-color var(--bm-ease);
}
.bm-colour-chip {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bm-chip);
    box-shadow: inset 0 0 0 1px rgba(20, 39, 44, .1);
}
.bm-colour-chip svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity var(--bm-ease); }
.bm-colours li:nth-child(3) .bm-colour-chip svg { stroke: var(--bm-ink); } /* sand is light: dark tick */
.bm-colour[data-state="copied"] .bm-colour-chip svg { opacity: 1; }
.bm-colour-hex { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; color: var(--bm-muted); }

.bm .bm-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    margin-top: 14px;
    border-radius: 999px;
    background: var(--bm-soft);
    color: var(--bm-ink);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--bm-ease);
}
.bm-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

@media (hover: hover) {
    .bm .bm-dl:hover { border-color: var(--bm-ink); background: var(--bm-soft); color: var(--bm-ink); }
    .bm .bm-colour:hover { background: var(--bm-soft); }
    .bm .bm-more:hover { background: #e7edef; color: var(--bm-ink); }
}
.bm :focus-visible { outline: 2px solid #d9650f; outline-offset: 2px; }
.bm-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
