/* ==========================================================================
   RSM Post Carousel — Frontend Styles (Light Theme)
   ========================================================================== */

/* --- Carousel container --- */

.rsmc-carousel {
    position: relative;
    max-width: 100%;
    font-family: inherit;
    color: #1a1a1a;
}

/* --- Viewport & track --- */

.rsmc-carousel__viewport {
    overflow: hidden;
    border-radius: 8px;
}

.rsmc-carousel__track {
    display: flex;
    transition: transform 0.45s ease-in-out;
    will-change: transform;
}

.rsmc-carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

/* --- Image area --- */

.rsmc-carousel__image-wrap {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.rsmc-carousel__image-link {
    display: block;
    line-height: 0;
}

.rsmc-carousel__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    object-fit: cover;
}

/* --- Play button overlay (video posts) --- */

.rsmc-carousel__play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.rsmc-carousel__play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.rsmc-carousel__play-icon {
    display: block;
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

/* Hide play button when inline video is active */
.rsmc-carousel__slide--playing .rsmc-carousel__play-btn,
.rsmc-carousel__slide--playing .rsmc-carousel__image-link {
    display: none;
}

/* Inline video embed (appears when playing) */
.rsmc-carousel__inline-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.rsmc-carousel__inline-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Content area --- */

.rsmc-carousel__content {
    padding: 16px 20px 20px;
}

.rsmc-carousel__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.rsmc-carousel__title a {
    color: #1a1a1a;
    text-decoration: none;
}

.rsmc-carousel__title a:hover {
    text-decoration: underline;
}

.rsmc-carousel__byline {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.rsmc-carousel__excerpt {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rsmc-carousel__read-more {
    display: inline-block;
    padding: 8px 20px;
    background: #1a1a1a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.rsmc-carousel__read-more:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

/* --- Navigation arrows --- */

.rsmc-carousel__arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 44px;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.0);
    color: #fff;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.rsmc-carousel__arrow:hover {
    background: rgba(0, 0, 0, 0.15);
}

.rsmc-carousel__arrow svg {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.rsmc-carousel__arrow--prev {
    left: 0;
    border-radius: 8px 0 0 8px;
}

.rsmc-carousel__arrow--next {
    right: 0;
    border-radius: 0 8px 8px 0;
}

/* --- Dot indicators --- */

.rsmc-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 14px 0 4px;
}

.rsmc-carousel__dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.rsmc-carousel__dot:hover {
    border-color: #9ca3af;
}

.rsmc-carousel__dot--active {
    background: #2563eb;
    border-color: #2563eb;
}

/* --- Single slide — hide nav --- */

.rsmc-carousel--single .rsmc-carousel__arrow,
.rsmc-carousel--single .rsmc-carousel__dots {
    display: none;
}

/* --- Modal overlay --- */

.rsmc-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsmc-modal[hidden] {
    display: none;
}

.rsmc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.rsmc-modal__content {
    position: relative;
    width: 90%;
    max-width: 860px;
    z-index: 1;
}

.rsmc-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.rsmc-modal__close:hover {
    opacity: 1;
}

.rsmc-modal__embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 6px;
    background: #000;
}

.rsmc-modal__embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Prevent body scroll when modal is open */
body.rsmc-modal-open {
    overflow: hidden;
}

/* --- Responsive --- */

@media (max-width: 600px) {
    .rsmc-carousel__title {
        font-size: 17px;
    }

    .rsmc-carousel__content {
        padding: 12px 14px 16px;
    }

    .rsmc-carousel__play-btn {
        width: 52px;
        height: 52px;
    }

    .rsmc-carousel__play-icon {
        width: 52px;
        height: 52px;
    }

    .rsmc-carousel__arrow {
        width: 36px;
    }
}
