/* Blog Manager front-end styles for the Resource Library and Blog Single Post widgets. Everything is scoped under .bm. */
.bm {
    --bm-teal: #1FA39C;
    --bm-teal-d: #127C7E;
    --bm-teal-ink: #0F6E70;
    --bm-mint: #8FD5CD;
    --bm-eyebrow: #309D9F;
    --bm-ink: #23272A;
    --bm-char: #1C2022;
    --bm-text: #4E5559;
    --bm-line: #DAE8E5;
    --bm-mist: #F5FAF9;
    --bm-grad: linear-gradient(120deg, #1FA39C, #127C7E 46%, #0A4348);
    --bm-grad-hover: linear-gradient(120deg, #1B968F, #127C7E 46%, #0A4348);
    --bm-shadow: 0 20px 44px -26px rgba(12, 60, 62, .5);
    --bm-head: "Jost", sans-serif;
    --bm-body: "Poppins", sans-serif;
    --bm-btn: "Jost", sans-serif;
    --bm-cut: clamp(32px, 4.4vw, 72px);
    --bm-pad: clamp(56px, 7vw, 104px);
    --bm-hero-pad: clamp(52px, 6.6vw, 92px);
    --bm-read: 760px;
    --bm-side-w: 320px;
    --bm-side-gap: clamp(36px, 5vw, 64px);
    --bm-sticky-top: 100px;
    font-family: var(--bm-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--bm-text);
}
.bm *, .bm *::before, .bm *::after { box-sizing: border-box; }
.bm a { text-decoration: none; }
.bm img { display: block; max-width: 100%; height: auto; }
.bm p { margin: 0; }
.bm [hidden] { display: none !important; }

/* Layout */
.bm-shell { width: 100%; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.bm-shell--narrow { max-width: 760px; }
.bm-shell--article { max-width: var(--bm-read); }
.bm-article--side .bm-shell--article { max-width: calc(var(--bm-read) + var(--bm-side-w) + 64px); }
.bm-stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.bm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bm-head { display: flex; flex-direction: column; gap: 12px; }
.bm-sec { padding: var(--bm-pad) 20px; background: #fff; }
.bm-sec--mist { background: var(--bm-mist); }
.bm-sec--dark { background: var(--bm-char); color: rgba(255, 255, 255, .82); }
.bm-sec--cut {
    position: relative;
    z-index: 2;
    margin-top: calc(-1 * var(--bm-cut));
    padding-top: calc(var(--bm-pad) + var(--bm-cut));
    clip-path: polygon(0 var(--bm-cut), 100% 0, 100% 100%, 0 100%);
}
.bm-plain { padding: 0 0 40px; background: transparent; }
.bm-plain.bm-sec--dark { padding: 32px 24px; border-radius: 20px; margin-bottom: 40px; }

/* Type */
.bm .bm-eyebrow {
    font-family: var(--bm-head);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .2em;
    line-height: 1.6;
    text-transform: uppercase;
    color: var(--bm-eyebrow);
    border-left: 4px solid var(--bm-teal);
    padding-left: 12px;
    margin: 0;
}
.bm .bm-sec--dark .bm-eyebrow, .bm .bm-hero .bm-eyebrow { color: var(--bm-mint); border-color: var(--bm-mint); }
.bm .bm-h1, .bm .bm-h2, .bm .bm-h3 {
    font-family: var(--bm-head);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--bm-ink);
    margin: 0;
    padding: 0;
    text-wrap: balance;
}
.bm .bm-h1 { font-size: clamp(2rem, 4.8vw, 3.4rem); line-height: .98; letter-spacing: -.015em; }
.bm .bm-h2 { font-size: clamp(1.85rem, 4vw, 3.05rem); line-height: .98; letter-spacing: -.01em; }
.bm .bm-h3 { font-size: 1.2rem; line-height: 1.1; }
.bm .bm-h2 span { color: var(--bm-teal); }
.bm .bm-sec--dark .bm-h2, .bm .bm-sec--dark .bm-h3 { color: #fff; }
.bm .bm-sec--dark .bm-h2 span { color: var(--bm-mint); }
.bm .bm-title {
    font-family: var(--bm-head);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.2;
    color: var(--bm-ink);
    margin: 0;
    padding: 0;
    text-transform: none;
}
.bm .bm-title a { color: inherit; font: inherit; }
.bm .bm-title a:hover { color: var(--bm-teal-ink); }
.bm .bm-label { font-family: var(--bm-head); font-weight: 800; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--bm-teal-ink); }
.bm .bm-by { font-size: 14px; line-height: 1.5; color: var(--bm-text); }
.bm .bm-blurb { font-size: 15px; line-height: 1.65; color: var(--bm-text); }
.bm .bm-go { font-family: var(--bm-head); font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--bm-teal-ink); white-space: nowrap; }
.bm .bm-from { display: inline-block; font-family: var(--bm-body); font-weight: 500; font-size: 12px; line-height: 1.4; color: var(--bm-teal-ink); background: var(--bm-mist); border-radius: 20px; padding: 4px 11px; max-width: 100%; }
.bm .bm-sec--mist .bm-from { background: #E8F3F1; }

/* Buttons */
.bm .bm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--bm-btn);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    letter-spacing: .02em;
    text-transform: none;
    padding: 13px 24px;
    border-radius: 20px;
    border: 0;
    background: var(--bm-grad);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .2s ease, box-shadow .2s ease;
}
.bm .bm-btn:hover, .bm .bm-btn:focus-visible { background: var(--bm-grad-hover); color: #fff; transform: translateY(-2px); box-shadow: var(--bm-shadow); }
.bm .bm-btn--outline { font-family: var(--bm-head); font-weight: 500; background: transparent; color: var(--bm-ink); border: 2px solid var(--bm-ink); padding: 11px 22px; }
.bm .bm-btn--outline:hover, .bm .bm-btn--outline:focus-visible { background: var(--bm-ink); color: #fff; }
.bm .bm-btn--sm { padding: 9px 18px; font-size: 13px; }
.bm .bm-btn--outline.bm-btn--sm { padding: 7px 16px; }

/* Cards */
.bm-card { background: #fff; border: 2px solid var(--bm-line); border-radius: 20px; box-shadow: var(--bm-shadow); min-width: 0; }
.bm-lift { transition: transform .2s ease; }
.bm-lift:hover { transform: translateY(-3px); }
.bm-ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; background: var(--bm-mist); border: 2px solid var(--bm-line); display: grid; place-items: center; color: var(--bm-teal-d); line-height: 0; }
.bm-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bm-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: var(--bm-char); max-width: 100%; }
.bm .bm-art img { width: 100%; height: 100%; object-fit: cover; }
.bm a.bm-art { display: block; }

/* Articles */
.bm-lead { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: start; }
.bm-lead--solo { grid-template-columns: minmax(0, 1fr); }
.bm-lead__big { display: flex; flex-direction: column; overflow: hidden; }
.bm-lead__big .bm-art { border-radius: 0; }
.bm-lead__body { padding: clamp(22px, 3vw, 36px); display: flex; flex-direction: column; gap: 14px; }
.bm .bm-lead__body .bm-title { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; text-transform: uppercase; line-height: 1.02; }
.bm-lead__body .bm-from { align-self: flex-start; }
.bm-acard { display: flex; flex-direction: column; overflow: hidden; }
.bm-acard__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; }
.bm-acard--img .bm-art { border-radius: 0; }
.bm-acard--img .bm-acard__body { padding-top: 18px; }
.bm-acard__foot { display: flex; justify-content: flex-end; padding-top: 4px; }
/* Title cover: an article without a featured image gets its title on the header gradient in place of the picture */
.bm-cover {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    aspect-ratio: 21 / 9;
    padding: 22px 22px 28px;
    overflow: hidden;
    background: linear-gradient(61deg, #1C2022, #17373A 60%, #135E60);
    background-color: var(--bm-char);
    color: #fff;
}
/* A teal sliver along the bottom, cut on the same slant as the page headers */
.bm-cover::after { content: ""; position: absolute; z-index: -1; inset: 0; background: var(--bm-grad); opacity: .55; clip-path: polygon(0 100%, 100% 72%, 100% 100%); }
.bm .bm-cover .bm-label { color: var(--bm-mint); }
.bm .bm-cover .bm-title { color: #fff; font-weight: 800; font-size: 1.5rem; line-height: 1.04; text-transform: uppercase; text-wrap: balance; text-shadow: 0 2px 18px rgba(10, 24, 26, .5); }
.bm .bm-cover--long .bm-title { font-size: 1.28rem; }
.bm .bm-cover .bm-title a:hover { color: var(--bm-mint); }
.bm-acard--cover .bm-acard__body { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
.bm-acard--cover .bm-acard__foot { padding-top: 0; margin-left: auto; }
.bm-lead__big .bm-cover { aspect-ratio: 16 / 9; padding: clamp(22px, 3vw, 36px); padding-bottom: clamp(28px, 3.6vw, 44px); gap: 12px; }
.bm .bm-lead__big .bm-cover .bm-title { font-size: clamp(1.6rem, 3.2vw, 2.6rem); line-height: 1; }
.bm .bm-lead__big .bm-cover--long .bm-title { font-size: clamp(1.4rem, 2.7vw, 2.15rem); }
.bm .bm-thumb--cover { display: grid; place-items: center; border-color: transparent; background: linear-gradient(61deg, #1C2022, #17373A 60%, #135E60); color: var(--bm-mint); line-height: 0; }
.bm .bm-thumb--cover svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Bookshelf */
.bm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bm .bm-chip {
    font-family: var(--bm-body);
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    padding: 7px 15px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, .28);
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    transition: border-color .2s ease;
}
.bm .bm-chip:hover, .bm .bm-chip:focus { background: transparent; color: #fff; border-color: var(--bm-mint); }
.bm .bm-chip[aria-pressed="true"] { background: var(--bm-mint); border-color: var(--bm-mint); color: var(--bm-char); }
.bm .bm-chip:focus-visible, .bm .bm-book:focus-visible { outline: 3px solid var(--bm-mint); outline-offset: 3px; }
.bm-shelf {
    --bm-book-w: 148px;
    --bm-book-h: 222px;
    --bm-shelf-gap: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: var(--bm-shelf-gap) 18px;
    padding-bottom: 12px;
    /* A shelf line under every row of books (rows repeat every book height + row gap) */
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--bm-book-h) + 6px), rgba(255, 255, 255, .16) calc(var(--bm-book-h) + 6px), rgba(255, 255, 255, .16) calc(var(--bm-book-h) + 12px), transparent calc(var(--bm-book-h) + 12px), transparent calc(var(--bm-book-h) + var(--bm-shelf-gap)));
}
.bm .bm-book {
    position: relative;
    flex: 0 0 var(--bm-book-w);
    width: var(--bm-book-w);
    height: var(--bm-book-h);
    border: 0;
    border-radius: 5px 12px 12px 5px;
    padding: 16px 12px 14px 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    color: #fff;
    background: #127C7E;
    cursor: pointer;
    overflow: hidden;
    box-shadow: inset 7px 0 0 rgba(0, 0, 0, .2), 0 16px 26px -16px rgba(0, 0, 0, .7);
    transition: transform .2s ease;
    white-space: normal;
    text-transform: none;
    letter-spacing: 0;
}
.bm .bm-book:hover, .bm .bm-book:focus { transform: translateY(-6px); color: #fff; }
.bm .bm-book b { font-family: var(--bm-head); font-weight: 800; font-size: 15px; line-height: 1.08; text-transform: uppercase; letter-spacing: .01em; overflow-wrap: anywhere; }
.bm .bm-book--long b { font-size: 12.5px; }
.bm .bm-book span { font-family: var(--bm-body); font-weight: 500; font-size: 11px; line-height: 1.3; opacity: .86; }
.bm .bm-book--c2 { background: #2E3539; }
.bm .bm-book--c3 { background: #8FD5CD; color: #12292B; }
.bm .bm-book--c4 { background: #0A4348; }
.bm .bm-book--c5 { background: #E3EFEC; color: #12292B; }
.bm .bm-book--c3:hover, .bm .bm-book--c3:focus, .bm .bm-book--c5:hover, .bm .bm-book--c5:focus { color: #12292B; }
.bm .bm-book--cover { padding: 0; background: var(--bm-char); }
.bm .bm-book--cover img { width: 100%; height: 100%; object-fit: cover; }
/* Book details pop-up (a native <dialog>, so it sits above the page with its own backdrop) */
.bm .bm-modal {
    width: calc(100% - 32px);
    max-width: 560px;
    max-height: calc(100% - 32px);
    padding: 0;
    border: 2px solid var(--bm-line);
    border-radius: 20px;
    background: #fff;
    color: var(--bm-text);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6);
    overflow: auto;
}
.bm .bm-modal::backdrop { background: rgba(20, 34, 36, .62); }
.bm .bm-modal:not([open]) { display: none; }
.bm-modal__body { padding: 30px 28px 28px; }
.bm .bm-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid var(--bm-line);
    border-radius: 50%;
    background: #fff;
    color: var(--bm-ink);
    font-family: var(--bm-body);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.bm .bm-modal__close:hover { background: var(--bm-ink); border-color: var(--bm-ink); color: #fff; }
.bm .bm-modal__close:focus { background: #fff; color: var(--bm-ink); outline: none; }
.bm .bm-modal__close:focus-visible { outline: 3px solid var(--bm-teal); outline-offset: 2px; }
.bm-bookdetail { display: flex; flex-direction: column; gap: 10px; }
.bm-bookdetail--cover { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 22px; align-items: start; }
.bm .bm-bookdetail__cover { width: 120px; border-radius: 4px 10px 10px 4px; box-shadow: 0 16px 26px -16px rgba(0, 0, 0, .6); }
.bm-bookdetail__text { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-right: 26px; }
.bm .bm-bookdetail .bm-title { font-size: 1.4rem; }
.bm .bm-hint { font-size: 14px; color: rgba(255, 255, 255, .7); }

/* Links, downloads, videos */
.bm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 28px 22px; align-items: start; }
.bm-group { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bm .bm-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 20px; color: inherit; }
.bm-thumb { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 12px; overflow: hidden; border: 2px solid var(--bm-line); background: var(--bm-mist); }
.bm .bm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bm .bm-item .bm-title { font-size: 1rem; }
.bm .bm-item .bm-blurb { font-size: 13px; line-height: 1.5; }
.bm a.bm-item:hover .bm-title { color: var(--bm-teal-ink); }
.bm-item__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.bm-empty { padding: 32px 24px; text-align: center; }
.bm .bm-sec--dark .bm-go { color: var(--bm-mint); }
.bm .bm-sec--dark .bm-go:hover { color: #fff; }
.bm .bm-thumb--book { height: 92px; border-radius: 4px 9px 9px 4px; }

/* Resource Archive: tabs, search + topic filter, results, pages */
.bm-archive { scroll-margin-top: var(--bm-sticky-top); }
.bm-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.bm .bm-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--bm-head);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    padding: 9px 18px;
    border: 2px solid var(--bm-line);
    border-radius: 20px;
    background: #fff;
    color: var(--bm-ink);
    transition: transform .2s ease, box-shadow .2s ease;
}
.bm .bm-tab:hover, .bm .bm-tab:focus-visible { border-color: var(--bm-teal); color: var(--bm-teal-ink); transform: translateY(-2px); box-shadow: var(--bm-shadow); }
.bm .bm-tab[aria-current] { border-color: var(--bm-ink); background: var(--bm-ink); color: #fff; }
.bm-tab__n { font-family: var(--bm-body); font-weight: 500; font-size: 12px; opacity: .7; }
.bm-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.bm .bm-filter input[type="search"], .bm .bm-filter select {
    flex: 1 1 260px;
    width: auto;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 10px 18px;
    border: 2px solid var(--bm-line);
    border-radius: 20px;
    background-color: #fff;
    color: var(--bm-ink);
    font-family: var(--bm-body);
    font-size: 15px;
    line-height: 1.4;
    box-shadow: none;
}
.bm .bm-filter select { flex: 0 1 230px; padding-right: 34px; }
.bm .bm-filter input[type="search"]:focus, .bm .bm-filter select:focus { border-color: var(--bm-teal); outline: none; }
.bm .bm-count { font-size: 14px; color: var(--bm-text); }
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 22px; }
.bm-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px 22px; align-items: start; }
.bm-pages { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; padding-top: 8px; }
.bm .bm-pages .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 15px;
    border: 2px solid var(--bm-line);
    border-radius: 20px;
    background: #fff;
    color: var(--bm-ink);
    font-family: var(--bm-head);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    transition: transform .2s ease, box-shadow .2s ease;
}
.bm .bm-pages a.page-numbers:hover, .bm .bm-pages a.page-numbers:focus-visible { border-color: var(--bm-ink); transform: translateY(-2px); box-shadow: var(--bm-shadow); }
.bm .bm-pages .page-numbers.current { border-color: var(--bm-ink); background: var(--bm-ink); color: #fff; }
.bm .bm-pages .page-numbers.dots { border-color: transparent; background: transparent; min-width: 0; padding: 0 4px; }
/* Books tab: the bookshelf on the dark band, so the tabs, count and page links switch to their light-on-dark look */
.bm .bm-sec--dark .bm-tab { border-color: rgba(255, 255, 255, .28); background: transparent; color: #fff; }
.bm .bm-sec--dark .bm-tab:hover, .bm .bm-sec--dark .bm-tab:focus-visible { border-color: var(--bm-mint); color: #fff; box-shadow: none; }
.bm .bm-sec--dark .bm-tab[aria-current] { border-color: var(--bm-mint); background: var(--bm-mint); color: var(--bm-char); }
.bm .bm-sec--dark .bm-filter input[type="search"], .bm .bm-sec--dark .bm-filter select { border-color: transparent; }
.bm .bm-sec--dark .bm-filter input[type="search"]:focus, .bm .bm-sec--dark .bm-filter select:focus { border-color: var(--bm-mint); }
.bm .bm-sec--dark .bm-count { color: rgba(255, 255, 255, .7); }
.bm .bm-sec--dark .bm-pages .page-numbers { border-color: rgba(255, 255, 255, .28); background: transparent; color: #fff; }
.bm .bm-sec--dark .bm-pages a.page-numbers:hover, .bm .bm-sec--dark .bm-pages a.page-numbers:focus-visible { border-color: var(--bm-mint); box-shadow: none; }
.bm .bm-sec--dark .bm-pages .page-numbers.current { border-color: var(--bm-mint); background: var(--bm-mint); color: var(--bm-char); }
.bm .bm-sec--dark .bm-pages .page-numbers.dots { border-color: transparent; }

/* Article page */
.bm-hero { background: linear-gradient(61deg, #1C2022, #17373A 60%, #135E60); background-color: var(--bm-char); color: rgba(255, 255, 255, .85); padding: var(--bm-hero-pad) 20px calc(var(--bm-hero-pad) + var(--bm-cut)); }
.bm-hero .bm-shell { gap: 18px; }
.bm .bm-hero .bm-h1 { color: #fff; text-shadow: 0 2px 24px rgba(10, 24, 26, .5); max-width: var(--bm-read); }
.bm .bm-crumb { font-family: var(--bm-body); font-weight: 500; font-size: 14px; color: rgba(255, 255, 255, .75); }
.bm .bm-crumb a { color: var(--bm-mint); }
.bm .bm-crumb a:hover { color: #fff; }
.bm-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.bm-meta > span, .bm .bm-meta > a {
    font-family: var(--bm-body);
    font-weight: 500;
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 20px;
    padding: 6px 14px;
}
.bm .bm-meta > a:hover { background: rgba(255, 255, 255, .2); }
.bm-meta--light > span, .bm .bm-meta--light > a { color: var(--bm-teal-ink); background: var(--bm-mist); border-color: var(--bm-line); }
.bm-feature { border-radius: 20px; overflow: hidden; }
.bm-feature--ratio { position: relative; }
.bm .bm-feature--ratio img { width: 100%; height: 100%; object-fit: cover; }
.bm .bm-prose { font-size: 17px; line-height: 1.8; color: #3C4347; overflow-wrap: break-word; }
.bm .bm-prose p { margin: 0 0 1.15em; }
.bm .bm-prose > :last-child { margin-bottom: 0; }
.bm .bm-prose a { color: var(--bm-teal-ink); text-decoration: underline; }
.bm .bm-prose h2, .bm .bm-prose h3, .bm .bm-prose h4 { font-family: var(--bm-head); font-weight: 800; color: var(--bm-ink); line-height: 1.15; margin: 1.6em 0 .6em; text-wrap: balance; }
.bm .bm-prose h2 { font-size: 1.7rem; text-transform: uppercase; }
.bm .bm-prose h3 { font-size: 1.3rem; }
.bm .bm-prose h4 { font-size: 1.1rem; }
.bm .bm-prose ul, .bm .bm-prose ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.bm .bm-prose li { margin-bottom: .4em; }
.bm .bm-prose blockquote { margin: 1.4em 0; padding: 0 0 0 18px; border-left: 4px solid var(--bm-teal); font-family: var(--bm-head); font-weight: 700; font-size: 1.35rem; line-height: 1.35; color: var(--bm-teal-ink); }
.bm .bm-prose blockquote p { margin: 0; }
.bm .bm-prose img, .bm .bm-prose figure { border-radius: 16px; margin: 1.4em 0; }
.bm-conn { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: 20px; padding: 18px; align-items: center; }
.bm-conn--noart { grid-template-columns: minmax(0, 1fr); padding: 22px; }
.bm-conn .bm-art { border-radius: 12px; }
.bm-conn__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; align-items: flex-start; }
.bm-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.bm .bm-prose > :first-child { margin-top: 0; }
.bm .bm-prose > p:first-child { font-size: 1.18em; line-height: 1.65; color: var(--bm-ink); }
.bm .bm-prose h2, .bm .bm-prose h3 { scroll-margin-top: calc(var(--bm-sticky-top) + 20px); }
.bm-foot { display: flex; padding-top: 28px; border-top: 2px solid var(--bm-line); }

/* Article page: reading column with a sidebar */
.bm-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--bm-side-w); gap: 28px var(--bm-side-gap); align-items: start; }
.bm-main { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
/* Stays under the site header while the article scrolls. In a short window the last card runs off the bottom and comes back into view at the end of the article */
.bm-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; position: sticky; top: var(--bm-sticky-top); }
/* position: sticky does nothing inside a page that sets overflow-x: hidden on html and body (many themes do); clip looks the same and lets it work */
html:has(.bm-side), body:has(.bm-side) { overflow-x: clip; }
.bm-panel { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.bm .bm-toc ul { list-style: none; margin: 0 -10px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bm .bm-toc li { margin: 0; padding: 0; }
.bm .bm-toc a { display: block; font-size: 14px; line-height: 1.4; color: var(--bm-text); padding: 7px 10px; border-radius: 10px; }
.bm .bm-toc .bm-toc__sub a { padding-left: 24px; }
.bm .bm-toc a:hover { color: var(--bm-teal-ink); }
.bm .bm-toc a[aria-current] { background: var(--bm-mist); color: var(--bm-teal-ink); font-weight: 600; }
.bm-goes .bm-art { border-radius: 12px; }
.bm-goes__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bm .bm-minis { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bm .bm-minis li { margin: 0; padding: 14px 0; border-top: 1px solid var(--bm-line); }
.bm .bm-minis li:first-child { border-top: 0; padding-top: 0; }
.bm .bm-minis li:last-child { padding-bottom: 0; }
.bm .bm-mini { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: center; color: inherit; }
.bm .bm-mini--img { grid-template-columns: 56px minmax(0, 1fr); }
.bm-mini .bm-thumb { width: 56px; height: 56px; }
.bm-mini__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bm .bm-mini .bm-title { display: block; font-size: 1rem; }
.bm .bm-mini .bm-by { font-size: 13px; }
.bm a.bm-mini:hover .bm-title { color: var(--bm-teal-ink); }

@media (max-width: 960px) {
    /* Sidebar moves below the article; the contents list is dropped, since it would sit after the text it points to */
    .bm-article--side .bm-shell--article { max-width: var(--bm-read); }
    .bm-layout { grid-template-columns: minmax(0, 1fr); }
    .bm-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; }
    .bm .bm-toc { display: none; }
}
@media (max-width: 860px) {
    .bm-lead { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .bm-shelf { --bm-book-w: 128px; --bm-book-h: 192px; gap: var(--bm-shelf-gap) 14px; }
    .bm .bm-book b { font-size: 13.5px; }
    .bm .bm-book--long b { font-size: 11.5px; }
    .bm-conn, .bm-more { grid-template-columns: minmax(0, 1fr); }
    .bm-bookdetail--cover { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; }
    .bm .bm-bookdetail__cover { width: 84px; }
    .bm .bm-item { grid-template-columns: auto minmax(0, 1fr); }
    .bm .bm-item .bm-go { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
    .bm .bm-btn, .bm-lift, .bm .bm-book, .bm .bm-tab, .bm .bm-pages .page-numbers { transition: none; }
    .bm .bm-btn:hover, .bm-lift:hover, .bm .bm-book:hover, .bm .bm-tab:hover, .bm .bm-pages a.page-numbers:hover { transform: none; }
}
