#sp-page-builder, .mgpub-dialog, [data-mgcomp-catalog] {
    --mg-book-ink: #10364e;
    --mg-book-copy: #324c60;
    --mg-book-line: #d3e2ea;
    --mg-book-hover-line: #a7c5d5;
    --mg-book-hover-shadow: 0 8px 22px rgb(16 54 78 / 9%);
    --mg-book-radius: 9px;
}

.mg-book-card {
    --mg-book-cover-width: 94px;
    display: grid;
    grid-template-columns: minmax(0, var(--mg-book-cover-width)) minmax(0, 1fr);
    grid-template-areas: "cover copy" "cover description" "cover action";
    grid-template-rows: auto 1fr auto;
    gap: 7px clamp(14px, 2vw, 23px);
    align-content: start;
    align-items: start;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: clamp(14px, 1.6vw, 22px);
    border: 1px solid var(--mg-book-line, #d3e2ea);
    border-radius: var(--mg-book-radius, 9px);
    background: #fff;
    color: var(--mg-book-copy, #324c60);
    font: 400 1rem/1.5 Barlow, Arial, sans-serif;
}

.mg-book-card--mini {
    --mg-book-cover-width: 72px;
    padding: 14px;
    font-size: .94rem;
}

.mg-book-card--maxi {
    --mg-book-cover-width: clamp(110px, 17vw, 210px);
}

.mg-book-card.mg-book-card--maxi {
    padding: clamp(18px, 2.5vw, 34px);
}

.mgpub-dialog .mgpub-detailgrid.mg-book-card--maxi {
    color: var(--mg-book-copy);
    border: 1px solid var(--mg-book-line);
    border-radius: var(--mg-book-radius);
    background: #fff;
}

.mgpub-dialog .mg-book-card--maxi :is(.mgpub-detail-titlelink, .mgpub-detailcoverlink):focus-visible {
    outline: 2px solid #407e9e;
    outline-offset: 3px;
}

.mgpub-dialog .mg-book-card--maxi .mgpub-detailactions { justify-content: end; }

.mg-book-card-cover {
    grid-area: cover;
    min-width: 0;
}

.mg-book-card-copy { grid-area: copy; }
.mg-book-card-cover a {
    display: block;
    border-radius: 3px;
}

.mg-book-card-cover img {
    display: block;
    width: 100%;
    max-height: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: contain;
    border-radius: 3px;
    filter: drop-shadow(0 3px 5px rgb(16 54 78 / 16%));
}

#sp-page-builder .mg-book-card h3 {
    margin: 0 0 4px;
    color: var(--mg-book-ink);
    font: 700 clamp(1.05rem, 1.65vw, 1.33rem)/1.18 Barlow, Arial, sans-serif;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
}

#sp-page-builder .mg-book-card--mini h3 { font-size: 1.06rem; }
#sp-page-builder .mg-book-card--maxi h3 { font-size: clamp(1.32rem, 2.25vw, 1.9rem); }

.mg-book-card-copy h3 a {
    color: inherit;
    text-decoration: none;
}

.mg-book-card-copy h3 a:is(:hover, :focus-visible) {
    text-decoration: underline;
    text-underline-offset: .19em;
}

.mg-book-card-subtitle, .mg-book-card-series, .mg-book-card-description { display: block; overflow-wrap: anywhere; }
.mg-book-card-subtitle { margin-bottom: 3px; }
.mg-book-card-series { font-size: .8em; color: #476579; }
.mg-book-card-description { grid-area: description; }
.mg-book-card-action { grid-area: action; justify-self: end; }
.mg-book-card-action > a { min-inline-size: 190px; }
.mg-book-card--mini .mg-book-card-action > a { min-inline-size: 160px; }

.mg-book-card-related {
    display: table;
    margin-block-start: 10px;
    color: #20516a;
    font-size: .92em;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.mg-book-card-related:is(:hover, :focus-visible) { color: var(--mg-book-ink); }

.mg-book-card :is(.mg-book-card-cover a, h3 a):focus-visible {
    outline: 2px solid #407e9e;
    outline-offset: 3px;
}

.mg-book-card:focus-within {
    border-color: var(--mg-book-hover-line);
    box-shadow: var(--mg-book-hover-shadow);
}

@media (hover: hover) and (pointer: fine) {
    .mg-book-card:hover {
        border-color: var(--mg-book-hover-line);
        box-shadow: var(--mg-book-hover-shadow);
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .mg-book-card { transition: border-color .2s ease, box-shadow .2s ease; }
    .mg-book-card-cover img { transition: transform .2s ease; }
    .mg-book-card:hover .mg-book-card-cover img { transform: translateY(-2px); }
}

@media (max-width: 575px) {
    .mg-book-card {
        --mg-book-cover-width: 72px;
        grid-template-areas: "cover copy" "description description" "action action";
    }
    .mg-book-card--mini { --mg-book-cover-width: 61px; }
}

#sp-page-builder .mg-native-exec-books > .sppb-row-container > .sppb-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    align-items: stretch;
    gap: 20px;
    margin-inline: 0;
}

#sp-page-builder .mg-native-exec-books > .sppb-row-container > .sppb-row > [id^="column-wrap-id-"] {
    width: 100%;
    max-width: none;
    padding-inline: 0;
}

#sp-page-builder .mg-native-exec-books :is(
    [id^="column-wrap-id-"], .sppb-column, .sppb-column-addons, .addon-root-text-block, .sppb-addon-text-block, .sppb-addon-content
),
#sp-page-builder .mg-native-exec-books .addon-root-text-block > [id^="sppb-addon-"] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

#sp-page-builder .mg-native-exec-books .mg-book-card { flex: 1 1 auto; }

.mgpub-book, article[data-mgcomp-card][data-kind="book"] {
    border-color: var(--mg-book-line, #d3e2ea);
    border-radius: var(--mg-book-radius, 9px);
    transition: border-color .2s ease, box-shadow .2s ease;
}

:is(.mgpub-book, article[data-mgcomp-card][data-kind="book"]):focus-within {
    border-color: var(--mg-book-hover-line, #a7c5d5);
    box-shadow: var(--mg-book-hover-shadow, 0 8px 22px rgb(16 54 78 / 9%));
}

@media (hover: hover) and (pointer: fine) {
    :is(.mgpub-book, article[data-mgcomp-card][data-kind="book"]):hover {
        border-color: var(--mg-book-hover-line, #a7c5d5);
        box-shadow: var(--mg-book-hover-shadow, 0 8px 22px rgb(16 54 78 / 9%));
    }
}

@media (prefers-reduced-motion: reduce) {
    .mgpub-book, article[data-mgcomp-card][data-kind="book"] { transition: none; }
}
