/**
 * WordPress Post Slider
 * Fully Responsive + RTL + Mobile First
 * Version 1.5.7
 */

/* ================= Root ================= */
.wp-post-slider {
    position: relative;
    width: var(--slider-width, 100%);
    height: var(--slider-height, 450px) !important;
    /* Ensure border-radius clips all children (images, captions, etc.) */
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,.12);
    direction: rtl;
    text-align: right;
    max-width: 100%;
    margin: 0 auto;
    padding: 0; /* Remove padding to let image fill the rounded container fully */
    /* If user wants padding around the slider content inside the box, they should use a wrapper or we adjust inner container. 
       But usually "rounded corners" implies the image touches the rounded edge. 
       The user said "like border or background of image", implying unified look. */
}

/* ================= Container ================= */
.wp-post-slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: inherit; /* Inherit rounded corners from parent */
    overflow: hidden;       /* Clip images to rounded corners */
}

/* ================= Slides ================= */
.wp-post-slider-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
    border-radius: inherit; /* Ensure slide container respects rounding */
    overflow: hidden;
}

.wp-post-slider-slide.active {
    opacity: 1;
    z-index: 2;
}

/* Slide Animation Support */
.wp-post-slider.slide-mode .wp-post-slider-slide {
    opacity: 1;
    transform: translateX(100%);
    transition: transform 0.6s ease-in-out;
    z-index: 1;
    display: none;
}

.wp-post-slider.slide-mode .wp-post-slider-slide.active {
    transform: translateX(0);
    z-index: 2;
    display: block;
}

.wp-post-slider.slide-mode .wp-post-slider-slide.prev-slide {
    transform: translateX(-100%);
    display: block;
    z-index: 1;
}

.wp-post-slider.slide-mode .wp-post-slider-slide.next-slide {
    transform: translateX(100%);
    display: block;
    z-index: 1;
}

/* ================= Image ================= */
.wp-post-slider-link,
.wp-post-slider-image {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit; /* Force image to follow container rounding */
}

.wp-post-slider-image {
    object-fit: cover;
}

/* ================= Caption ================= */
.wp-post-slider-caption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: clamp(20px, 4vw, 40px);
    /* Force gradient for readability */
	
    background: linear-gradient(to top, rgb(4 29 50) 0%, rgb(20 58 90 / 82%) 40%, transparent 100%);
    color: var(--caption-text, #fff);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
    min-height: 120px;
}

.wp-post-slider-caption-inner {
    pointer-events: auto;
}

/* ================= Typography ================= */
.wp-post-slider-title {
    margin: 0 0 10px;
    font-weight: 700;
    line-height: 1.4;
    font-size: var(--title-font-size, clamp(1.2rem, 2.5vw, 1.8rem));
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.wp-post-slider-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.wp-post-slider-title a:hover {
    color: rgba(255,255,255,0.8);
}

.wp-post-slider-excerpt {
    font-size: var(--text-font-size, clamp(0.9rem, 2vw, 1.1rem));
    line-height: 1.6;
    opacity: 0.95;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ================= Controls ================= */
.wp-post-slider-controls {
    position: absolute;
    inset-inline: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding-inline: 20px;
    z-index: 20;
    pointer-events: none;
}

.wp-post-slider-control {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding-bottom: 4px; /* Fix vertical alignment of arrow char */
}

.wp-post-slider-control:hover {
    background: rgba(0,0,0,0.6);
    transform: scale(1.1);
}

.wp-post-slider-prev { order: 2; }
.wp-post-slider-next { order: 1; }

/* ================= Dots ================= */
.wp-post-slider-dots {
    position: absolute;
    bottom: 15px;
    inset-inline: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 20;
}

.wp-post-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    border: 2px solid rgba(255,255,255,0.8);
    transition: .3s;
    cursor: pointer;
}

.wp-post-slider-dot.active {
    background: #fff;
    transform: scale(1.3);
    border-color: #fff;
}

/* ================= Mobile Responsive ================= */
@media (max-width: 768px) {
    .wp-post-slider {
        width: var(--mobile-width, 100%) !important;
        height: var(--mobile-height, 300px) !important;
    }
}

@media (max-width: 480px) {
    .wp-post-slider {
        height: var(--mobile-height, 250px) !important;
    }
}
