.bdpm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    color: #fff;
    font-family: inherit;
}

.bdpm-modal.is-open {
    display: grid;
    place-items: center;
}

.bdpm-modal-open {
    overflow: hidden;
}

.bdpm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(12px);
}

.bdpm-modal__dialog {
    position: relative;
    width: min(430px, calc(100vw - 28px));
    height: min(760px, calc(100vh - 28px));
    overflow: visible;
    border-radius: 8px;
    background: #111;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.54);
    outline: none;
}

.bdpm-modal__content,
.bdpm-modal__image,
.bdpm-modal__shade {
    position: absolute;
    inset: 0;
}

.bdpm-modal__content {
    overflow: hidden;
    border-radius: inherit;
}

.bdpm-modal__image {
    background-color: #171717;
    background-position: center;
    background-size: cover;
    transform: scale(1.01);
}

.bdpm-modal__image--empty {
    background:
        linear-gradient(145deg, rgba(20, 20, 20, 0.95), rgba(65, 65, 65, 0.72)),
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.18), transparent 28%);
}

.bdpm-modal__shade {
     background: linear-gradient(180deg,rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
}

.bdpm-modal.bdpm-modal--dark-text .bdpm-modal__shade {
    background:
        linear-gradient(to top, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.68) 24%, rgba(255, 255, 255, 0.26) 54%, transparent 82%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.28), transparent 24%);
}

.bdpm-modal__story-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 0 26px 30px;
}

.bdpm-modal__title {
	color: #FFF!important;
    max-width: 100%;
    margin: 0 0 12px;
    color: #fff;
    font-size: 32px;
    font-weight: 760;
    line-height: 1.05;
    letter-spacing: 0;
    text-wrap: balance;
}

.bdpm-modal.bdpm-modal--dark-text .bdpm-modal__title {
    color: #080808!important;
}

.bdpm-modal__excerpt {
    display: -webkit-box;
    max-width: 100%;
    margin: 0 0 18px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.bdpm-modal.bdpm-modal--dark-text .bdpm-modal__excerpt {
    color: rgba(0, 0, 0, 0.78);
}

.bdpm-modal__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    backdrop-filter: blur(10px);
    transition: background 160ms ease, transform 160ms ease;
}

.bdpm-modal.bdpm-modal--dark-text .bdpm-modal__more {
    border-color: rgba(0, 0, 0, 0.62);
    background: rgba(255, 255, 255, 0.58);
    color: #080808;
}

.bdpm-modal__more:hover,
.bdpm-modal__more:focus {
    background: rgba(255, 255, 255, 0.26);
    color: #fff;
    transform: translateY(-1px);
}

.bdpm-modal.bdpm-modal--dark-text .bdpm-modal__more:hover,
.bdpm-modal.bdpm-modal--dark-text .bdpm-modal__more:focus {
    background: rgba(255, 255, 255, 0.76);
    color: #080808;
}

.bdpm-modal__close,
.bdpm-modal__nav {
    position: absolute;
    z-index: 4;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.38);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.bdpm-modal__close {
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    font-size: 28px;
    line-height: 1;
}

.bdpm-modal__nav {
    top: 50%;
    width: 42px;
    height: 64px;
    transform: translateY(-50%);
    font-size: 44px;
    line-height: 1;
}

.bdpm-modal__nav--prev {
    left: 10px;
}

.bdpm-modal__nav--next {
    right: 10px;
}

.bdpm-modal__progress {
    position: absolute;
    top: 12px;
    left: 16px;
    right: 68px;
    z-index: 3;
    display: flex;
    gap: 5px;
    height: 4px;
}

.bdpm-modal__progress-segment {
    position: relative;
    flex: 1 1 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
}

.bdpm-modal__progress-segment::before {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    width: 0;
    background: #fff;
}

.bdpm-modal__progress-segment.is-complete::before {
    width: 100%;
}

.bdpm-modal__progress-segment.is-active.is-animating::before {
    animation: bdpm-story-progress var(--bdpm-duration, 6000ms) linear forwards;
}

@keyframes bdpm-story-progress {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

.bdpm-modal__state {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 28px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 15px;
    text-align: center;
    background: #111;
}

.bdpm-modal__state--error {
    color: #fecaca;
}

[hidden] {
    display: none !important;
}

@media (min-width: 700px) {
    .bdpm-modal__nav--prev {
        left: -62px;
    }

    .bdpm-modal__nav--next {
        right: -62px;
    }
}

@media (max-width: 520px) {
    .bdpm-modal.is-open {
        place-items: stretch;
    }

    .bdpm-modal__dialog {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        overflow: hidden;
    }

    .bdpm-modal__story-copy {
        padding: 0 20px 24px;
    }

    .bdpm-modal__title {
        font-size: 28px;
    }

    .bdpm-modal__nav {
        width: 38px;
        height: 58px;
        background: rgba(0, 0, 0, 0.22);
    }

    .bdpm-modal__nav--prev {
        left: 0;
    }

    .bdpm-modal__nav--next {
        right: 0;
    }
}
