.mod-featuredbook {
    --fb-top: 55%;
    --fb-x: 0px;
    --fb-y: 0px;
    --fb-width: 520px;
    --fb-cover: 120px;
    --fb-color: #fff;
    --fb-scale: 1;
    box-sizing: border-box;
    background: transparent;
    color: var(--fb-color);
    z-index: 5;
}
.mod-featuredbook *,
.mod-featuredbook *::before,
.mod-featuredbook *::after { box-sizing: border-box; }

/* Overlay mode: sits on the hero, no background. Everything is laid out at the
   "design width" and scaled by --fb-scale (set by the script from the hero's width). */
.mod-featuredbook--overlay {
    position: absolute;
    top: calc(var(--fb-top) + var(--fb-y) * var(--fb-scale));
    width: var(--fb-width);
}
.mod-featuredbook--align-center {
    left: 50%;
    transform: translateX(calc(-50% + var(--fb-x) * var(--fb-scale))) scale(var(--fb-scale));
    transform-origin: top center;
}
.mod-featuredbook--align-left {
    left: calc(5% + var(--fb-x) * var(--fb-scale));
    transform: scale(var(--fb-scale));
    transform-origin: top left;
}
.mod-featuredbook--align-right {
    right: calc(5% - var(--fb-x) * var(--fb-scale));
    transform: scale(var(--fb-scale));
    transform-origin: top right;
}

/* Flow mode (overlay switched off) */
.mod-featuredbook:not(.mod-featuredbook--overlay) {
    max-width: var(--fb-width);
    margin: 1rem auto;
}

.mod-featuredbook__inner {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    background: transparent;
}
.mod-featuredbook__cover { flex: 0 0 var(--fb-cover); width: var(--fb-cover); }
.mod-featuredbook__cover img {
    display: block;
    width: 100%;
    height: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.mod-featuredbook__text { flex: 1 1 auto; min-width: 0; }
.mod-featuredbook__kicker {
    margin-bottom: .25rem;
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    opacity: .85;
}
.mod-featuredbook__title {
    margin: 0 0 .4rem;
    font-size: 1.5rem;
    line-height: 1.2;
    color: inherit;
}
.mod-featuredbook__blurb { font-size: .95rem; line-height: 1.5; color: inherit; }
.mod-featuredbook__blurb p { margin: 0 0 .5rem; color: inherit; }
.mod-featuredbook__button {
    display: inline-block;
    margin-top: .5rem;
    padding: .5rem 1.1rem;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
}
.mod-featuredbook__button:hover,
.mod-featuredbook__button:focus-visible { background: rgba(255, 255, 255, .18); color: inherit; }

/* Keeps text readable over a busy image without adding a background */
.mod-featuredbook--shadow .mod-featuredbook__text {
    text-shadow: 0 1px 3px rgba(0, 0, 0, .85), 0 0 14px rgba(0, 0, 0, .6);
}

/* Stacked: the script moved the block under the hero (too small to overlay legibly).
   The media query is only a fallback for when the script has not run. */
.mod-featuredbook--overlay.is-stacked {
    position: relative;
    top: auto; left: auto; right: auto;
    transform: none;
    width: auto;
    max-width: var(--fb-width);
    margin: 1rem auto;
    padding: 0 1rem;
}
.mod-featuredbook--overlay.is-stacked .mod-featuredbook__cover {
    flex-basis: calc(var(--fb-cover) * .75);
    width: calc(var(--fb-cover) * .75);
}
.mod-featuredbook--overlay.is-stacked .mod-featuredbook__title { font-size: 1.2rem; }

@media (max-width: 767.98px) {
    .mod-featuredbook--overlay:not(.is-ready) {
        position: relative;
        top: auto; left: auto; right: auto;
        transform: none;
        width: auto;
        max-width: var(--fb-width);
        margin: 1rem auto;
        padding: 0 1rem;
    }
}

/* ---- Items: all slides share one grid cell, so the block keeps the height of the tallest ---- */
.mod-featuredbook__slides { display: grid; grid-template-columns: minmax(0, 1fr); }
.mod-featuredbook__slide { grid-area: 1 / 1; align-self: start; }

.mod-featuredbook--rotating .mod-featuredbook__slide {
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease, visibility 0s linear .6s;
}
.mod-featuredbook--rotating .mod-featuredbook__slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity .6s ease, visibility 0s;
}

.mod-featuredbook__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    margin-top: .8rem;
}
.mod-featuredbook__dot {
    width: .8rem;
    height: .8rem;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    opacity: .7;
    cursor: pointer;
}
.mod-featuredbook__dot.is-active { background: currentColor; opacity: 1; }
.mod-featuredbook__pause {
    margin-left: .35rem;
    padding: 0 .3rem;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: .75rem;
    line-height: 1;
    cursor: pointer;
}
.mod-featuredbook__dot:focus-visible,
.mod-featuredbook__pause:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

@media (pointer: coarse) {
    .mod-featuredbook__dot { width: 1rem; height: 1rem; }
    .mod-featuredbook__pause { font-size: .9rem; padding: .2rem .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .mod-featuredbook--rotating .mod-featuredbook__slide,
    .mod-featuredbook--rotating .mod-featuredbook__slide.is-active { transition: none; }
}
