/* ── Reading Progress Widget ──────────────────────────────────────────────
   A fixed floating card (desktop: bottom-left corner, mobile: bottom bar)
   that shows article reading progress and rotates through CTA offers.
   ──────────────────────────────────────────────────────────────────────── */

.rpw {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    width: 268px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,16,73,.14), 0 2px 8px rgba(0,16,73,.06);
    border: 1px solid rgba(0,16,73,.09);
    font-family: inherit;
    transition: transform .4s cubic-bezier(.34,1.56,.64,1) , opacity .35s ease;
}

.rpw--hidden {
    transform: translateY(-50%) translateX(calc(-100% - 48px));
    opacity: 0;
    pointer-events: none;
}

/* ── Close button ── */
.rpw__close {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: rgba(255,255,255,.8);
    padding: 0;
    line-height: 1;
    transition: color .2s, background .2s;
    z-index: 2;
    flex-shrink: 0;
}

.rpw__close:hover {
    color: #ffffff;
    background: rgba(255,255,255,.15);
}

/* ── Top block: brand + progress ── */
.rpw__top {
    padding: 18px 40px 15px 20px;
    background: #012296;
    border-radius: 15px 15px 0 0;
}

.rpw__brand {
    display: flex;
    flex-direction: column;
    margin-bottom: 13px;
}

.rpw__brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.rpw__tagline {
    font-size: 11px;
    color: rgba(255,255,255,.75);
    margin-top: 2px;
    line-height: 1.3;
}

.rpw__progress-label {
    font-size: 11px;
    color: rgba(255,255,255,.9);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: .01em;
}

.rpw__pct {
    font-weight: 700;
    color: #ffffff;
}

.rpw__progress-bar {
    height: 5px;
    background: rgba(255,255,255,.25);
    border-radius: 10px;
    overflow: hidden;
}

.rpw__progress-fill {
    height: 100%;
    width: 0;
    background: #ffffff;
    border-radius: 10px;
    transition: width .35s ease;
}

/* ── Divider ── */
.rpw__divider {
    height: 1px;
    background: rgba(0,16,73,.08);
}

/* ── Bottom block: CTA carousel ── */
.rpw__bottom {
    padding: 15px 20px 18px;
}

/* Stacked grid — all cards share the same area; tallest card sets the height */
.rpw__carousel {
    display: grid;
    grid-template-areas: 'card';
    margin-bottom: 2px;
}

.rpw__card {
    grid-area: card;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
}

.rpw__card--active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.rpw__card-headline {
    font-size: 14px;
    font-weight: 700;
    color: #001049;
    line-height: 1.3;
    margin: 0 0 6px;
}

.rpw__card-subtext {
    font-size: 12px;
    color: #444466;
    line-height: 1.55;
    margin: 0 0 12px;
}

.rpw__card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    background: #012296;
    color: #ffffff;
    transition: background .2s, transform .15s, gap .2s;
    white-space: nowrap;
    align-self: flex-start;
    border: none;
    cursor: pointer;
}

.rpw__card-btn::after {
    content: '→';
    font-style: normal;
    transition: transform .2s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    vertical-align: middle;
    margin-top: -1px;
}

.rpw__card-btn:hover,
.rpw__card-btn:focus {
    background: #0138d4;
    color: #ffffff;
    transform: translateY(-1px);
    text-decoration: none;
}

.rpw__card-btn:hover::after {
    transform: translateX(3px);
}

/* ── Dot navigation ── */
.rpw__dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 14px;
}

.rpw__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,16,73,.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.rpw__dot--active {
    background: #001049;
    transform: scale(1.5);
}

.rpw__dot:hover:not(.rpw__dot--active) {
    background: rgba(0,16,73,.45);
}

/* ── Mobile — sticky bottom bar (≤ 991 px) ── */
@media (max-width: 991px) {

    /* Reset desktop vertical-centre; pin to bottom */
    .rpw {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -4px 20px rgba(0,16,73,.15);
        transform: translateY(0);
        display: block;
        transition: transform .4s ease, opacity .35s ease;
    }

    /* Hidden: slide down off-screen */
    .rpw--hidden {
        transform: translateY(100%);
        opacity: 1;
    }

    /* Close button */
    .rpw__close {
        top: 8px;
        right: 8px;
        color: rgba(255,255,255,.8);
    }

    .rpw__close:hover {
        color: #ffffff;
        background: rgba(255,255,255,.15);
    }

    /* Top block full width */
    .rpw__top {
        border-radius: 14px 14px 0 0;
        padding: 14px 44px 14px 18px;
    }

    .rpw__brand {
        margin-bottom: 8px;
    }

    .rpw__brand-name {
        font-size: 14px;
    }

    .rpw__tagline {
        font-size: 11px;
    }

    .rpw__progress-label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    /* Horizontal divider */
    .rpw__divider {
        width: 100%;
        height: 1px;
    }

    /* CTA block full width */
    .rpw__bottom {
        padding: 14px 18px 16px;
    }

    .rpw__carousel {
        margin-bottom: 0;
    }

    .rpw__card-headline {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .rpw__card-subtext {
        font-size: 11px;
        margin-bottom: 10px;
        display: block;
    }

    .rpw__card-btn {
        padding: 8px 14px;
        font-size: 11px;
    }

    .rpw__dots {
        margin-top: 8px;
        justify-content: flex-start;
        gap: 5px;
    }

    .rpw__dot {
        width: 5px;
        height: 5px;
    }
}
