/*
    Button Menu (Features\Menu\ButtonMenu.ascx, drawn by Features\Menu\ButtonMenuRenderer.vb). Everything is under .BM, so it looks
    the same on any site and sets nothing outside the menu.
        .BM-S-Small / Medium / Large        the menu's size
        .BM-L-<Layout>                      a section's layout: Tiles, Toolbar, List, Cards, PictureCards, Icons
        .BM-Look-Classic / Modern / Glass   Classic = the skin's own buttons; Modern = flat and rounded; Glass = frosted
        .BM-Anim-None / Subtle / Lively     movement under the mouse; Lively also brings the buttons in one after another
        .BM-Fit                             cards only as tall as their own words
        .BM-Editing                         the editor (ButtonMenuEdit.aspx, ButtonMenuEdit.js)
*/
.BM { --bm-gap: 8px; --bm-radius: 6px; --bm-accent: #337ab7; margin: 4px 0 12px; }
.BM-S-Small { --bm-gap: 6px; }
.BM-S-Large { --bm-gap: 12px; }

.BM .BM-Section { margin: 0 0 6px; }
.BM .BM-Heading { margin: 14px 0 8px; font-weight: 600; }
.BM .BM-Section:first-child .BM-Heading { margin-top: 4px; }
.BM .BM-Items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--bm-gap); }
.BM .BM-Item { position: relative; margin: 0; padding: 0; }
.BM .BM-Button { position: relative; }
.BM .BM-Button:focus-visible, .BM .BM-Arrow:focus-visible { outline: 3px solid var(--bm-accent); outline-offset: 2px; }
.BM .BM-Button.disabled, .BM .BM-Button[aria-disabled="true"] { opacity: .5; cursor: default; pointer-events: none; }
.BM .BM-Icon { flex: 0 0 auto; }
.BM .BM-Glyph { line-height: 1; }
.BM .BM-Badge { position: absolute; top: -6px; right: -6px; font-size: 11px; padding: 2px 6px; background: #d9534f; color: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.BM .dropdown-menu .BM-Icon { margin-right: 6px; vertical-align: -3px; }
.BM .dropdown-menu .BM-Badge { position: static; margin-left: 6px; }
.BM .dropdown-menu > li > a { cursor: pointer; }

/* ---------- Tiles: icon over the text, even squares, as many to a row as fit ---------- */
.BM .BM-L-Tiles .BM-Items { display: grid; grid-template-columns: repeat(auto-fill, var(--bm-tile)); grid-auto-rows: minmax(var(--bm-tile-h), auto); }
.BM-S-Small .BM-L-Tiles { --bm-tile: 84px; --bm-tile-h: 76px; --bm-tile-font: 12px; }
.BM-S-Medium .BM-L-Tiles { --bm-tile: 104px; --bm-tile-h: 92px; --bm-tile-font: 13px; }
.BM-S-Large .BM-L-Tiles { --bm-tile: 132px; --bm-tile-h: 116px; --bm-tile-font: 14px; }
.BM .BM-L-Tiles .BM-Item { display: flex; }
.BM .BM-L-Tiles .BM-Button { flex: 1 1 auto; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 4px; white-space: normal; line-height: 1.2; font-size: var(--bm-tile-font); overflow-wrap: anywhere; text-align: center; }

/* ---------- Toolbar: one line of buttons, icon beside the text ---------- */
.BM .BM-L-Toolbar .BM-Items { flex-wrap: wrap; align-items: stretch; }
.BM .BM-L-Toolbar .BM-Items.BM-OneLine { flex-wrap: nowrap; overflow: hidden; padding: 8px 8px 2px 0; margin-top: -8px; }   /* room for a badge, which sits over the corner */
.BM .BM-L-Toolbar .BM-Button { display: inline-flex; align-items: center; gap: 6px; height: 100%; }
.BM .BM-L-Toolbar .BM-Item.BM-More { flex: 0 0 auto; }
.BM .BM-L-Toolbar .BM-Item.BM-Hidden { display: none; }

/* ---------- List: one button to a line, across the width ---------- */
.BM .BM-L-List .BM-Items { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.BM .BM-L-List .BM-Item { display: flex; }
.BM .BM-L-List .BM-Button { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; text-align: left; white-space: normal; }
.BM .BM-L-List .BM-HasChoices .BM-Button { padding-right: 40px; }

/* ---------- Icons only: the text is the tooltip ---------- */
.BM .BM-L-Icons .BM-Button { display: inline-flex; align-items: center; justify-content: center; width: var(--bm-icon-box); height: var(--bm-icon-box); padding: 0; }
.BM-S-Small .BM-L-Icons { --bm-icon-box: 40px; }
.BM-S-Medium .BM-L-Icons { --bm-icon-box: 52px; }
.BM-S-Large .BM-L-Icons { --bm-icon-box: 72px; }

/* ---------- Cards: icon, text in bold, the Description under it ---------- */
.BM .BM-L-Cards .BM-Items, .BM .BM-L-PictureCards .BM-Items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--bm-card), 100%), 1fr)); gap: 12px; }
.BM-S-Small .BM-L-Cards { --bm-card: 200px; }
.BM-S-Medium .BM-L-Cards { --bm-card: 240px; }
.BM-S-Large .BM-L-Cards { --bm-card: 300px; }
.BM.BM-Fit .BM-L-Cards .BM-Items, .BM.BM-Fit .BM-L-PictureCards .BM-Items { align-items: start; }
.BM .BM-L-Cards .BM-Item, .BM .BM-L-PictureCards .BM-Item { display: flex; }
.BM .BM-Card { flex: 1 1 auto; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: rgba(128,128,128,.10);
    color: inherit; text-decoration: none; text-align: left; border: 0; font: inherit; width: 100%; }
.BM a.BM-Card:hover, .BM a.BM-Card:focus { background: rgba(128,128,128,.20); color: inherit; text-decoration: none; }
.BM .BM-Card.active { box-shadow: inset 4px 0 0 var(--bm-accent); }
.BM .BM-Words { display: block; min-width: 0; }
.BM .BM-Words .BM-Text { display: block; font-size: 1.1em; margin-bottom: 2px; }
.BM .BM-Desc { display: block; opacity: .85; }
.BM .BM-Card > .caret { margin-left: auto; align-self: center; }

/* ---------- Picture Cards: a full color picture down the left of the card ---------- */
.BM-S-Small .BM-L-PictureCards { --bm-card: 260px; --bm-pic: 96px; --bm-pic-h: 88px; }
.BM-S-Medium .BM-L-PictureCards { --bm-card: 300px; --bm-pic: 128px; --bm-pic-h: 104px; }
.BM-S-Large .BM-L-PictureCards { --bm-card: 360px; --bm-pic: 160px; --bm-pic-h: 124px; }
.BM .BM-L-PictureCards .BM-Card { padding: 0; gap: 0; overflow: hidden; align-items: stretch; min-height: var(--bm-pic-h); }
.BM .BM-L-PictureCards .BM-Picture { flex: 0 0 var(--bm-pic); background-size: cover; background-position: center; background-color: rgba(128,128,128,.18); }
.BM .BM-L-PictureCards .BM-NoPicture { display: flex; align-items: center; justify-content: center; }
.BM .BM-L-PictureCards .BM-Words { padding: 12px 14px; align-self: center; }
.BM .BM-L-PictureCards .BM-Badge { top: 6px; right: 6px; }

/* ---------- Split and Dropdown buttons (not on the Toolbar, where Bootstrap's btn-group does it) ---------- */
.BM .BM-HasChoices > .BM-Arrow { position: absolute; top: 4px; right: 4px; z-index: 2; width: 26px; height: 22px; padding: 0; border: 0; border-radius: 4px;
    background: rgba(0,0,0,.08); color: inherit; line-height: 22px; cursor: pointer; }
.BM .BM-HasChoices > .BM-Arrow:hover, .BM .BM-HasChoices.open > .BM-Arrow { background: rgba(0,0,0,.18); }
.BM .BM-L-List .BM-HasChoices > .BM-Arrow { top: 50%; transform: translateY(-50%); right: 8px; }
.BM .BM-HasChoices > .dropdown-menu { top: 100%; left: 0; margin-top: 4px; }
.BM .BM-HasChoices > .BM-Button > .caret { margin-left: 4px; }

/* ---------- Look: Modern ---------- */
.BM-Look-Modern .BM-Button.btn { border-radius: 10px; border: 1px solid transparent; background-image: none; text-shadow: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.06); }
.BM-Look-Modern .BM-Button.btn-default { background-color: #fff; border-color: rgba(0,0,0,.08); color: #333; }
.BM-Look-Modern .BM-Button.btn-default:hover { background-color: #f6f8fb; color: #111; }
.BM-Look-Modern .BM-L-Tiles .BM-Button.btn-default, .BM-Look-Modern .BM-L-Icons .BM-Button.btn-default { background: linear-gradient(180deg, #ffffff, #f2f4f7); }
.BM-Look-Modern .BM-Button.btn-primary { background-color: #2f6fda; }
.BM-Look-Modern .BM-Button.btn-success { background-color: #2e9e5b; }
.BM-Look-Modern .BM-Button.btn-info { background-color: #1aa3c8; }
.BM-Look-Modern .BM-Button.btn-warning { background-color: #f0a020; }
.BM-Look-Modern .BM-Button.btn-danger { background-color: #d9443f; }
.BM-Look-Modern .BM-Button.active { box-shadow: inset 0 -3px 0 var(--bm-accent), 0 2px 8px rgba(0,0,0,.08); }
.BM-Look-Modern .BM-Card { background: #fff; border: 1px solid rgba(0,0,0,.07); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.06); }
.BM-Look-Modern a.BM-Card:hover, .BM-Look-Modern a.BM-Card:focus { background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 10px 24px rgba(0,0,0,.10); }
.BM-Look-Modern .BM-Heading { text-transform: uppercase; letter-spacing: .06em; font-size: 13px; opacity: .7; }

/* ---------- Look: Glass ---------- */
.BM-Look-Glass .BM-Button.btn, .BM-Look-Glass .BM-Card { background: rgba(255,255,255,.55); background-image: none; border: 1px solid rgba(255,255,255,.7);
    border-radius: 14px; -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%); text-shadow: none;
    box-shadow: 0 4px 18px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.8); color: #222; }
.BM-Look-Glass .BM-Button.btn:hover, .BM-Look-Glass a.BM-Card:hover { background: rgba(255,255,255,.75); color: #111; }
.BM-Look-Glass .BM-Button.btn-primary { background: rgba(47,111,218,.75); color: #fff; }
.BM-Look-Glass .BM-Button.btn-success { background: rgba(46,158,91,.75); color: #fff; }
.BM-Look-Glass .BM-Button.btn-info { background: rgba(26,163,200,.75); color: #fff; }
.BM-Look-Glass .BM-Button.btn-warning { background: rgba(240,160,32,.8); color: #fff; }
.BM-Look-Glass .BM-Button.btn-danger { background: rgba(217,68,63,.8); color: #fff; }

/* ---------- Animation ---------- */
.BM-Anim-Subtle .BM-Button, .BM-Anim-Lively .BM-Button { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
.BM-Anim-Subtle .BM-Button:not(.disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.BM-Anim-Lively .BM-Button:not(.disabled):hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.BM-Anim-Subtle .BM-Button:not(.disabled):active, .BM-Anim-Lively .BM-Button:not(.disabled):active { transform: translateY(0) scale(.98); transition-duration: .06s; }
.BM-Anim-Subtle .BM-Icon, .BM-Anim-Lively .BM-Icon { transition: transform .25s ease; }
.BM-Anim-Lively .BM-Button:not(.disabled):hover .BM-Icon { transform: scale(1.12) rotate(-4deg); }
.BM-Anim-Lively .BM-L-PictureCards .BM-Picture { transition: transform .4s ease; }
.BM-Anim-Lively .BM-L-PictureCards .BM-Card:hover .BM-Picture { transform: scale(1.06); }
.BM-Anim-Subtle .dropdown-menu, .BM-Anim-Lively .dropdown-menu { transform-origin: top left; }
.BM-Anim-Subtle .open > .dropdown-menu, .BM-Anim-Lively .open > .dropdown-menu { animation: bm-drop .16s ease-out; }
@keyframes bm-drop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* Lively: the buttons come in one after another when the page opens */
.BM-Anim-Lively .BM-Item { animation: bm-in .38s cubic-bezier(.2,.8,.3,1.2) both; }
.BM-Anim-Lively .BM-Item:nth-child(2) { animation-delay: .03s; } .BM-Anim-Lively .BM-Item:nth-child(3) { animation-delay: .06s; }
.BM-Anim-Lively .BM-Item:nth-child(4) { animation-delay: .09s; } .BM-Anim-Lively .BM-Item:nth-child(5) { animation-delay: .12s; }
.BM-Anim-Lively .BM-Item:nth-child(6) { animation-delay: .15s; } .BM-Anim-Lively .BM-Item:nth-child(7) { animation-delay: .18s; }
.BM-Anim-Lively .BM-Item:nth-child(8) { animation-delay: .21s; } .BM-Anim-Lively .BM-Item:nth-child(n+9) { animation-delay: .24s; }
@keyframes bm-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* No movement for people whose device asks for less */
@media (prefers-reduced-motion: reduce) {
    .BM .BM-Item, .BM .BM-Button, .BM .BM-Icon, .BM .BM-Picture, .BM .dropdown-menu { animation: none !important; transition: none !important; transform: none !important; }
}

/* ---------- Shadow ---------- */
.BM-Shadow-Soft .BM-Button.btn, .BM-Shadow-Soft .BM-Card { box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.08); }
.BM-Shadow-3D .BM-Button.btn, .BM-Shadow-3D .BM-Card { border-bottom: 0;
    box-shadow: 0 4px 0 rgba(0,0,0,.22), 0 6px 10px rgba(0,0,0,.18), 0 14px 28px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.45);
    transform: translateY(0); transition: transform .08s ease, box-shadow .08s ease; }
.BM-Shadow-3D .BM-Button.btn:not(.disabled):hover, .BM-Shadow-3D a.BM-Card:hover {
    box-shadow: 0 5px 0 rgba(0,0,0,.22), 0 9px 14px rgba(0,0,0,.18), 0 18px 34px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.45); transform: translateY(-1px); }
.BM-Shadow-3D .BM-Button.btn:not(.disabled):active, .BM-Shadow-3D a.BM-Card:active {
    box-shadow: 0 1px 0 rgba(0,0,0,.22), 0 2px 4px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.3); transform: translateY(3px); }
.BM-Shadow-3D .BM-Items { padding-bottom: 6px; }
@media (prefers-reduced-motion: reduce) { .BM-Shadow-3D .BM-Button, .BM-Shadow-3D .BM-Card { transform: none !important; } }

/* ---------- Busy spinner: the clicked button until the next page opens (ButtonMenu.js); the editor while it saves ---------- */
.BM .BM-Busy { pointer-events: none; }
.BM .BM-Busy > * { opacity: .35; }
.BM .BM-Busy::after, .BME-Status.BME-Saving::before { content: ""; width: 20px; height: 20px; border-radius: 50%;
    border: 3px solid rgba(128,128,128,.3); border-top-color: var(--bm-accent, #337ab7); animation: bm-spin .7s linear infinite; }
.BM .BM-Busy::after { position: absolute; left: 50%; top: 50%; margin: -10px 0 0 -10px; }
.BME-Status.BME-Saving::before { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; --bm-accent: #337ab7; }
@keyframes bm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .BM .BM-Busy::after, .BME-Status.BME-Saving::before { animation-duration: 2s; } }
/* ---------- Phones ---------- */
@media (max-width: 600px) {
    .BM-S-Large .BM-L-Tiles { --bm-tile: 104px; --bm-tile-h: 92px; --bm-tile-font: 13px; }
    .BM .BM-L-Cards .BM-Items, .BM .BM-L-PictureCards .BM-Items { grid-template-columns: 1fr; }
    .BM .BM-HasChoices > .dropdown-menu { position: static; float: none; width: 100%; box-shadow: none; margin-top: 2px; }
}

/* ---------- The editor ---------- */
.BM.BM-Editing .BM-Section { border: 1px dashed rgba(128,128,128,.45); border-radius: 8px; padding: 6px 8px 10px; margin-bottom: 10px; background: rgba(128,128,128,.03); }
.BM.BM-Editing .BM-SectionBar { display: flex; align-items: center; gap: 8px; cursor: grab; border-radius: 6px; padding: 2px 4px; }
.BM.BM-Editing .BM-SectionBar:hover, .BM.BM-Editing .BM-Section.BM-Selected > .BM-SectionBar { background: rgba(51,122,183,.10); }
.BM.BM-Editing .BM-SectionBar .BM-Heading { margin: 4px 0; flex: 1 1 auto; }
.BM.BM-Editing .BM-SectionLayout { font-size: 12px; opacity: .7; }
.BM.BM-Editing .BM-Grip { width: 10px; height: 18px; flex: 0 0 10px; opacity: .5;
    background-image: radial-gradient(currentColor 1.2px, transparent 1.4px); background-size: 5px 5px; }
.BM.BM-Editing .BM-Items { min-height: 44px; border-radius: 6px; }
.BM.BM-Editing .BM-Item, .BM.BM-Editing .BM-Choice { cursor: grab; }
.BM.BM-Editing .BM-Item.BM-HasChoices, .BM.BM-Editing .BM-Item.btn-group { display: flex; flex-direction: column; align-items: stretch; }
.BM.BM-Editing .BM-Item.btn-group > .btn { float: none; }
.BM.BM-Editing .BM-Choices { list-style: none; margin: 4px 0 0 10px; padding: 4px; min-height: 28px; border-left: 2px solid rgba(128,128,128,.35); display: flex; flex-direction: column; gap: 3px; }
.BM.BM-Editing .BM-Choices:empty::before { content: "Drop buttons here to make them its choices"; font-size: 11px; opacity: .6; padding: 4px; }
.BM.BM-Editing .BM-ChoiceButton { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 4px; background: rgba(128,128,128,.10); font-size: 12px; }
.BM.BM-Editing .BM-Selected > .BM-Button, .BM.BM-Editing .BM-Selected > .BM-ChoiceButton { outline: 3px solid #f0a020; outline-offset: 2px; }
.BM.BM-Editing .BM-Dragging { opacity: .35; }
.BM.BM-Editing .BM-DropBefore { box-shadow: -4px 0 0 #f0a020; }
.BM.BM-Editing .BM-L-List .BM-DropBefore, .BM.BM-Editing .BM-Choice.BM-DropBefore, .BM.BM-Editing .BM-Section.BM-DropBefore { box-shadow: 0 -4px 0 #f0a020; }
.BM.BM-Editing .BM-DropInto { background: rgba(240,160,32,.12); outline: 2px dashed #f0a020; }
.BM.BM-Editing .BM-Items:empty::before { content: "Drop buttons here"; font-size: 12px; opacity: .6; padding: 12px; }

/* The editor's form (ButtonMenuEdit.aspx) */
.BME-Form .BME-Table { border-collapse: separate; border-spacing: 0 6px; margin: 4px 0; }
.BME-Form .BME-Table td:first-child { white-space: nowrap; padding-right: 10px; vertical-align: top; padding-top: 4px; }
.BME-Form .BME-Buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.BME-Status { min-height: 20px; font-weight: 600; }/* A Glyphicons Pro glyph sits in its place like a line icon */
.BM-Glyph.glyphicons { line-height: 1; } .BM-Glyph.glyphicons:before { vertical-align: top; }
