.wlc-sermon-slides {
    width: 100%;
    max-width: 1100px;
    margin: 1rem auto 2rem;
    outline: none;
}

.wlc-sermon-slides__stage {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .5rem;
}

.wlc-sermon-slides__slides {
    position: relative;
    min-width: 0;
    width: 100%;
    aspect-ratio: var(--wlc-slide-ratio, 16 / 9);
    background: #111;
    border-radius: 6px;
    overflow: hidden;
}

.wlc-sermon-slides__slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.wlc-sermon-slides__slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wlc-sermon-slides__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0 auto;
}

.wlc-sermon-slides__nav,
.wlc-sermon-slides__fullscreen,
.wlc-sermon-slides__thumb {
    cursor: pointer;
}

.wlc-sermon-slides__nav {
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 4px;
    font-size: 1.6rem;
    line-height: 1;
    padding: .65rem .8rem;
}

.wlc-sermon-slides__nav:hover,
.wlc-sermon-slides__nav:focus-visible,
.wlc-sermon-slides__fullscreen:hover,
.wlc-sermon-slides__fullscreen:focus-visible,
.wlc-sermon-slides__thumb:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.wlc-sermon-slides__toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: .75rem;
}

.wlc-sermon-slides__counter {
    font-weight: 600;
}

.wlc-sermon-slides__fullscreen {
    border: 1px solid #bbb;
    background: #fff;
    border-radius: 4px;
    padding: .4rem .7rem;
}

.wlc-sermon-slides__fullscreen-audio {
    display: none;
}

.wlc-sermon-slides__thumbs {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding: .7rem .1rem .2rem;
    scrollbar-width: thin;
}

.wlc-sermon-slides__thumb {
    flex: 0 0 auto;
    width: 88px;
    padding: 2px;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 4px;
}

.wlc-sermon-slides__thumb.is-active {
    border-color: currentColor;
}

.wlc-sermon-slides__thumb img {
    display: block;
    width: 100%;
    height: 50px;
    object-fit: cover;
}

.wlc-sermon-slides:fullscreen,
.wlc-sermon-slides:-webkit-full-screen {
    background: #111;
    padding: 1rem;
    max-width: none;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.wlc-sermon-slides:fullscreen .wlc-sermon-slides__stage,
.wlc-sermon-slides:-webkit-full-screen .wlc-sermon-slides__stage {
    height: calc(100vh - 180px);
}

.wlc-sermon-slides:fullscreen .wlc-sermon-slides__slides,
.wlc-sermon-slides:-webkit-full-screen .wlc-sermon-slides__slides {
    height: 100%;
    aspect-ratio: auto;
}

.wlc-sermon-slides:fullscreen .wlc-sermon-slides__toolbar,
.wlc-sermon-slides:-webkit-full-screen .wlc-sermon-slides__toolbar {
    color: #fff;
}

.wlc-sermon-slides:fullscreen .wlc-sermon-slides__fullscreen-audio,
.wlc-sermon-slides:-webkit-full-screen .wlc-sermon-slides__fullscreen-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin: .6rem auto 0;
    max-width: 900px;
    color: #fff;
}

.wlc-sermon-slides__audio-label {
    font-weight: 600;
    white-space: nowrap;
}

.wlc-sermon-slides__audio {
    width: min(680px, 75vw);
}

/* Intentionally keep the thumbnail selector out of fullscreen. */
.wlc-sermon-slides:fullscreen .wlc-sermon-slides__thumbs,
.wlc-sermon-slides:-webkit-full-screen .wlc-sermon-slides__thumbs {
    display: none;
}

@media (max-width: 700px) {
    .wlc-sermon-slides__stage {
        grid-template-columns: 1fr;
    }

    .wlc-sermon-slides__nav {
        position: absolute;
        z-index: 3;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255,255,255,.9);
    }

    .wlc-sermon-slides__prev {
        left: .4rem;
    }

    .wlc-sermon-slides__next {
        right: .4rem;
    }

    .wlc-sermon-slides__thumb {
        width: 72px;
    }

    .wlc-sermon-slides__thumb img {
        height: 41px;
    }

    .wlc-sermon-slides:fullscreen .wlc-sermon-slides__fullscreen-audio,
    .wlc-sermon-slides:-webkit-full-screen .wlc-sermon-slides__fullscreen-audio {
        flex-direction: column;
        align-items: stretch;
        gap: .25rem;
    }

    .wlc-sermon-slides__audio {
        width: 100%;
    }
}
