/* css/slider.css */

/* --- Desktop: Main Container --- */
.modern-slider-container {
    max-width: 900px;
    /* Matches your site's #wrapper */
    width: 100%;
    position: relative;
    margin: 0 auto;

    /* This is the key: force the 16:9 aspect ratio */
    aspect-ratio: 16 / 9;

    overflow: hidden;
    border-radius: 8px;
    /* Matches your site's card style */
    background-color: #222;
    /* Dark background for loading */
}

.modern-slider-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

/* --- Slide "Cut" Transition --- */
.modern-slide {
    display: none;
    /* Hide all slides by default */
    position: relative;
    /* Changed from absolute */
    width: 100%;
    height: 100%;
}

.modern-slide.active {
    display: block;
    /* Show only the active slide */
}

/* --- Desktop: Image Styling --- */
.modern-slide img {
    width: 100%;
    height: 100%;
    /* Fill the 16:9 container */
    object-fit: cover;
    display: block;
}

/* --- Desktop: Caption Overlay Styling --- */
.modern-slide-caption {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;

    /* The "scrim" gradient, now from the top */
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.4) 60%,
            rgba(0, 0, 0, 0) 100%);

    /* Flipped padding for top alignment */
    padding: 25px 25px 40px 25px;
}

.modern-slide-caption h3 {
    font-size: 1.5rem;
    color: #FF9428;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.modern-slide-caption p {
    font-size: 1.0rem;
    color: #fff;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}


/* --- Controls --- */
.modern-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.modern-slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.modern-prev-btn {
    left: 15px;
}

.modern-next-btn {
    right: 15px;
}

.modern-slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    z-index: 10;
}

.modern-dot {
    width: 30px;
    height: 5px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
}

.modern-dot.active,
.modern-dot:hover {
    background-color: white;
}

/* --- MOBILE STYLES (Overlay) --- */
@media (max-width: 768px) {

    /*
     * All positioning, aspect-ratio, and background styles
     * are now inherited from the desktop rules above.
     * We only need to adjust text/padding/controls
     * to make them look good on a small screen.
    */

    .modern-slide-caption {
        /* Make padding a little tighter for mobile */
        padding: 20px 20px 30px 20px;
    }

    .modern-slide-caption h3 {
        font-size: 1.3rem;
        /* Slightly smaller title */
    }

    .modern-slide-caption p {
        font-size: 0.9rem;
        /* Slightly smaller text */
        line-height: 1.5;
    }

    /* Optional: Make controls slightly smaller and closer to edge */
    .modern-slider-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .modern-prev-btn {
        left: 10px;
    }

    .modern-next-btn {
        right: 10px;
    }

    .modern-slider-dots {
        bottom: 8px;
        /* A tiny bit closer to the bottom */
    }

    .modern-dot {
        width: 25px;
        /* Slightly smaller dots */
        margin: 0 3px;
    }
}