/**
 * RS Content Sections - Frontend Styles
 * Version: 3.1.2
 */

/* --- General Adjustments --- */
.rs-content-section {
    position: relative;
    width: 100%;
}

.rs-content-section img {
    max-width: 100%;
    height: auto;
}

/* --- Carousel Styling --- */

/* Basic styling for carousel caption */
.carousel-caption {
    padding: 1.25rem;
    width: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    pointer-events: none; /* Click through to slide */
    box-sizing: border-box;
    overflow-y: auto;
}

.carousel-caption > * {
    pointer-events: auto; /* Elements inside are clickable */
}

/* CRUCIAL: Navigation Buttons z-index */
.carousel-control-prev,
.carousel-control-next {
    z-index: 20; 
}

/* Ensure images fill space */
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Desktop Layout (Overlay Captions) --- */
@media (min-width: 768px) {
    .carousel-caption {
        position: absolute;
        left: 0;
        right: 0;
    }

    /* Top Positions */
    .carousel-item .carousel-caption.rs-carousel-caption-position-top-left {
        top: 0; bottom: auto; left: 0; right: 0;
        align-items: flex-start; justify-content: flex-start; text-align: left;
    }
    .carousel-item .carousel-caption.rs-carousel-caption-position-top-center {
        top: 0; bottom: auto; left: 0; right: 0;
        align-items: center; justify-content: flex-start; text-align: center;
    }
    .carousel-item .carousel-caption.rs-carousel-caption-position-top-right {
        top: 0; bottom: auto; left: 0; right: 0;
        align-items: flex-end; justify-content: flex-start; text-align: right;
    }

    /* Middle Positions */
    .carousel-item .carousel-caption.rs-carousel-caption-position-middle-left {
        top: 50%; bottom: auto; left: 0; right: 0; transform: translateY(-50%);
        align-items: flex-start; justify-content: center; text-align: left;
    }
    .carousel-item .carousel-caption.rs-carousel-caption-position-middle-center {
        top: 50%; bottom: auto; left: 0; right: 0; transform: translateY(-50%);
        align-items: center; justify-content: center; text-align: center;
    }
    .carousel-item .carousel-caption.rs-carousel-caption-position-middle-right {
        top: 50%; bottom: auto; left: 0; right: 0; transform: translateY(-50%);
        align-items: flex-end; justify-content: center; text-align: right;
    }

    /* Bottom Positions */
    .carousel-item .carousel-caption.rs-carousel-caption-position-bottom-left {
        top: auto; bottom: 0; left: 0; right: 0;
        align-items: flex-start; justify-content: flex-end; text-align: left;
    }
    .carousel-item .carousel-caption.rs-carousel-caption-position-bottom-center {
        top: auto; bottom: 0; left: 0; right: 0;
        align-items: center; justify-content: flex-end; text-align: center;
    }
    .carousel-item .carousel-caption.rs-carousel-caption-position-bottom-right {
        top: auto; bottom: 0; left: 0; right: 0;
        align-items: flex-end; justify-content: flex-end; text-align: right;
    }
}

/* --- Mobile Layout (Stack Layout) --- */
@media (max-width: 767.98px) {
    .rs-carousel .carousel-item {
        display: flex;
        flex-direction: column;
    }

    .rs-carousel .carousel-caption {
        position: relative; /* Not absolute */
        top: auto; bottom: auto; left: auto; right: auto;
        transform: none !important;
        
        width: 100%;
        background: #f8f9fa; /* Light bg */
        color: #212529;      /* Dark text */
        text-align: left;
        align-items: flex-start;
        padding: 1.5rem;
    }

    /* Force text color override for mobile readability */
    .rs-carousel .carousel-caption h3,
    .rs-carousel .carousel-caption .text-white,
    .rs-carousel .carousel-caption .text-white * {
        color: #212529 !important;
    }

    /* Button outline fix for light background */
    .rs-carousel .carousel-caption .btn-outline-light {
        color: var(--bs-primary, #0d6efd);
        border-color: var(--bs-primary, #0d6efd);
    }
    .rs-carousel .carousel-caption .btn-outline-light:hover {
        background-color: var(--bs-primary, #0d6efd);
        color: #fff;
    }

    /* Enforce image height */
    .rs-carousel .carousel-item img {
        height: 250px !important;
    }

    /* Hide indicators on mobile to save space */
    .rs-carousel .carousel-indicators {
        display: none;
    }
    
    /* Adjust control arrows to align with image area only */
    .rs-carousel .carousel-control-prev, 
    .rs-carousel .carousel-control-next {
        align-items: flex-start;
        height: 250px; 
    }
}

/* --- List Group Styling --- */
.rs-list .list-group-item i {
    font-size: 1.2rem;
    color: var(--bs-primary);
}

/* --- Accordion Styling --- */
.rs-accordion .accordion-button i {
    margin-right: 0.75rem;
    color: var(--bs-primary);
}

/* Fix: Ensure active accordion items have a neutral background instead of default blue */
.accordion-button:not(.collapsed) {
    background-color: #f8f9fa;
    color: inherit;
    box-shadow: none;
}

/* --- Grid/Card Styling --- */
.card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.25rem;
}
.card-header, .card-footer {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    background-color: rgba(0, 0, 0, 0.03);
}
.card-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
    border-bottom: none;
}
.card-body {
    padding: 1.25rem;
}
.card-title {
    margin-bottom: 0.75rem;
}

/* --- Overflow Slider (New) --- */
.rs-hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.rs-hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.rs-hover-scale:hover {
    transform: scale(1.05)!important;
    z-index: 5;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2)!important;
}

/* --- Custom Aspect Ratios for Slider --- */
.ratio-3x4 {
    --bs-aspect-ratio: 133.33%;
}
.ratio-9x16 {
    --bs-aspect-ratio: 177.78%;
}

/* --- BlurBoxes Hover Effects (New) --- */
.rs-blurbox-item:hover .rs-blurbox-bg {
    filter: blur(4px) brightness(0.8);
    transform: scale(1.05);
}
.rs-blurbox-item:hover .rs-blurbox-content {
    opacity: 1!important;
    transform: scale(1)!important;
}

/* General Plugin Site Defaults */
body.rs-content-sections-active {
    background-color: var(--rscs-general-bg-color, #f8f9fa);
    color: var(--rscs-general-fg-color, #212529);
}