/* Modern Posts Slider Pro - Responsive Patch
   Single-file drop-in patch to ensure a single-slide view on all viewports,
   keep overlay content constrained inside each slide image, and prevent
   other slides from peeking in on mobile.
   Developed by Afritech Media - adjusted for responsiveness
*/

.mps-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden !important; /* ensure nothing escapes the slider */
    box-sizing: border-box;
    background: #000;
}

/* Slider row: never wrap, each slide takes full width */
.mps-slider {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100%;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    will-change: transform;
    box-sizing: border-box;
}

/* Each slide occupies exactly 100% of the wrapper (no sharing) */
.mps-slide {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    /* Slide height is controlled via CSS custom properties set on the wrapper
       (plugin outputs --mps-height / --mps-tablet-height / --mps-mobile-height).
       Fallback to 500px if not provided. */
    height: var(--mps-height, 500px) !important;
    min-height: 0 !important;
    overflow: hidden !important; /* critical: keep image + overlay inside the slide */
    background: #000;
}

/* Make the image a positioned layer that fills the slide */
.mps-slide-image {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
}

/* Ensure images always cover the layer and don't stretch layout */
.mps-slide-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

/* Placeholder backgrounds must match same sizing */
.mps-placeholder-bg {
    width: 100% !important;
    height: 100% !important;
}

/* Slide overlay (visual dimming) fills the image layer */
.mps-slide-overlay {
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* CONTENT: keep it overlayed on top of image and constrained within slide */
.mps-slide-content {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(0) !important;
    /* Use inline/plugin provided bottom or fallback to 40px */
    bottom: var(--mps-content-bottom, 40px) !important;
    width: calc(100% - 60px) !important;
    max-width: 1200px !important;
    padding: 0 30px !important;
    color: #fff !important;
    z-index: 5 !important;
    opacity: 1 !important; /* ensure visible even if transitions changed */
    box-sizing: border-box !important;
    pointer-events: auto !important;
    -webkit-font-smoothing: antialiased;
}

/* Category, title, excerpt, button follow original styling with safe fallbacks */
.mps-category {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    color: inherit;
    box-sizing: border-box;
}

.mps-slide-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 10px 0;
    color: inherit;
    text-shadow: 0 4px 20px rgba(0,0,0,0.65);
    max-width: 800px;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.mps-slide-excerpt {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 18px 0;
    color: rgba(255,255,255,0.95);
    max-width: 650px;
}

/* CTA */
.mps-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: #fff;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    transition: transform .25s ease, box-shadow .25s ease;
    white-space: nowrap;
}

/* Navigation & dots keep original look but ensure z-index higher than image */
.mps-nav { z-index: 10; }
.mps-dots { z-index: 10; }

/* Tablet fallback: change slide height via variable (wrapper sets these values) */
@media (max-width: 1024px) {
    .mps-slide {
        height: var(--mps-tablet-height, 450px) !important;
    }
}

/* Mobile: ensure a single-slide view, reduce typography and clamp content so it never forces the slide taller */
@media (max-width: 768px) {
    .mps-slide {
        height: var(--mps-mobile-height, 360px) !important;
    }

    .mps-slide-content {
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
        width: auto !important;
        max-width: calc(100% - 24px) !important;
        padding: 10px 12px !important;
        bottom: 12px !important;
        background: linear-gradient(180deg, rgba(0,0,0,0.72), rgba(0,0,0,0.36)) !important;
        border-radius: 8px !important;
    }

    /* Clamp the title and excerpt to prevent growth beyond the overlay */
    .mps-slide-title {
        font-size: clamp(18px, 4.5vw, 22px) !important;
        line-height: 1.15 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .mps-slide-excerpt {
        font-size: clamp(13px, 3.6vw, 14px) !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .mps-read-btn {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }

    /* Keep nav and dots unobtrusive */
    .mps-nav { width: 45px; height: 45px; }
    .mps-dots { bottom: 8px; padding: 6px 10px; }
}

/* Very small screens: slight height reduction so content fits better */
@media (max-width: 480px) {
    .mps-slide {
        height: calc(var(--mps-mobile-height, 360px) - 20px) !important;
    }
    .mps-slide-content { padding: 8px 10px !important; bottom: 10px !important; }
    .mps-slide-title { font-size: 18px !important; }
    .mps-slide-excerpt { font-size: 13px !important; }
    .mps-read-btn { padding: 7px 12px !important; font-size: 12px !important; }
}

/* Accessibility: respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .mps-slider,
    .mps-slide-content,
    .mps-category,
    .mps-slide-title,
    .mps-slide-excerpt,
    .mps-read-btn,
    .mps-slide-image img {
        transition: none !important;
    }
}