.slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 10px;
}
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.slide-caption-link {
    position: absolute;
    bottom: 20px;
    left: 20px;
    text-decoration: none;
    z-index: 5;
}
.slide-caption {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    max-width: 300px;
    transition: all 0.3s ease;
    cursor: pointer;
}
.slide-caption:hover {
    background-color: rgba(255, 140, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
input[name="slides"] {
    display: none;
}

/* --- generated on the fly (put this block in index.html) --- */
{% for i in range(1, slides|length + 1) %}
input[name="slides"]:nth-of-type({{ i }}):checked ~ .slides .slide:nth-of-type({{ i }}) {
    opacity: 1;
}
input[name="slides"]:nth-of-type({{ i }}):checked ~ .slider-controls .slider-button:nth-of-type({{ i }}) {
    background-color: white;
    border-color: rgba(255, 255, 255, 0.8);
}
{% endfor %}
/* --- end generated --- */

.slider-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}
.slider-button {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}
.slider-button:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* Responsive caption for smaller screens */
@media (max-width: 768px) {
    .slide-caption {
        font-size: 14px;
        padding: 8px 12px;
        max-width: 250px;
    }
    .slide-caption-link {
        bottom: 15px;
        left: 15px;
    }
    .slider-controls {
        bottom: 15px;
        right: 15px;
    }
}
