/* assets/css/frontend.css */

/* --- General Slider Wrapper --- */
.custom-slider-wrapper {
    position: relative;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
    list-style: none;
    padding: 0;
    z-index: 1;
    aspect-ratio: 16 / 9;
    height: 100%;
    width: 100%;
    margin: 10px;
}

/* Layout Variations */
.custom-slider-wrapper.layout-fullscreen {
    width: 100%;
    height: 100vh;
    aspect-ratio: auto;
}

.custom-slider-wrapper.layout-boxed {
	width: 100%;
     
	margin: 0px auto !important; /* Center boxed layout */
}

.custom-slider-wrapper.layout-50-text {
    width: 50%;
}
.custom-slider-text-container {
    width: 50%;
    padding: 20px;
}


/* --- Swiper Specific --- */
.custom-slider-wrapper .swiper-wrapper {
     height: 100%;
}

.custom-slider-wrapper .swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    height: 100%;
    width: 100%;
}

/* Slide Background (Image/Video) */
.swiper-slide .csp-slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.swiper-slide .csp-slide-background img,
.swiper-slide .csp-slide-background video,
.swiper-slide .csp-slide-background picture {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.swiper-slide .csp-slide-background picture img {
     width: 100%;
     height: 100%;
     object-fit: cover;
}


/* Slide Content Overlay */
.swiper-slide .csp-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-color: rgba(0, 0, 0, 0.3); */ /* Default removed, applied inline */
    z-index: 2;
    pointer-events: none;
}

/* Slide Content Area */
/* Styles for the container when text is PER SLIDE */
.swiper-slide .csp-slide-content {
    position: relative;
    z-index: 3;
    color: #fff; /* Default color, can be overridden by inline styles */
    padding: 40px;
    max-width: 800px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.swiper-slide-active .csp-slide-content {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

/* NEW: Styles for the container when text is STATIC */
.custom-slider-wrapper .csp-slide-content-static {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3; /* Must be above slides and overlay */
    color: #fff; /* Default color */
    padding: 40px;
    max-width: 80%; /* Adjust as needed */
    width: auto; /* Let content determine width up to max-width */
    text-align: center;
    pointer-events: none; /* Allow clicks through to navigation if needed */
}
.custom-slider-wrapper .csp-slide-content-static > * {
    pointer-events: auto; /* Re-enable pointer events for links/buttons inside */
}


/* Text element base styles (inline styles will override color/size) */
.csp-slide-content .csp-headline,
.csp-slide-content-static .csp-headline {
    margin-top: 0;
    margin-bottom: 10px; /* Adjusted spacing */
    font-family: var(--headline-special-font, sans-serif); /* Use variable or default */
    font-size: 1.8rem; /* Default size */
    text-transform: uppercase;
    color: inherit; /* Inherit color from parent or inline style */
    font-family: var(--headline-special-font) !important;
}

.csp-slide-content .csp-subline,
.csp-slide-content-static .csp-subline {
    font-size: 1.2em; /* Default size */
    margin-top: 0; /* Ensure no extra top margin */
    margin-bottom: 15px; /* Adjusted spacing */
    font-weight: normal;
    text-transform: uppercase;
    color: inherit;
    font-family: var(--headline-font) !important;
}

.csp-slide-content .csp-description,
.csp-slide-content-static .csp-description {
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 1rem; /* Default size */
    color: inherit;
}
.csp-slide-content .csp-description p:last-child,
.csp-slide-content-static .csp-description p:last-child {
    margin-bottom: 0;
}


/* Button Styles */
.csp-slide-content .csp-button,
.csp-slide-content-static .csp-button {
	display: inline-block;
	padding: 12px 25px;
	background-color: var(--card-profil-farbe, #0073aa); /* Use variable or default blue */
	color: #fff;
	text-decoration: none;
	border: none;
	border-radius: 30px;
	font-weight: 100;
	transition: background-color 0.3s ease;
	font-size: 0.9rem;
    cursor: pointer;
}
.csp-slide-content .csp-button:hover,
.csp-slide-content-static .csp-button:hover {
    background-color: #005a87; /* Darker shade */
}


/* --- Swiper Navigation (Arrows) --- */
.custom-slider-wrapper .swiper-button-prev,
.custom-slider-wrapper .swiper-button-next {
    position: absolute;
    top: 50%;
    width: var(--swiper-navigation-size, 40px);
    height: var(--swiper-navigation-size, 40px);
    margin-top: calc(0px - (var(--swiper-navigation-size, 40px) / 2));
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transition: background-color 0.3s ease;
}
.custom-slider-wrapper .swiper-button-prev:hover,
.custom-slider-wrapper .swiper-button-next:hover {
     background-color: rgba(0, 0, 0, 0.6);
}
.custom-slider-wrapper .swiper-button-prev { left: 15px; }
.custom-slider-wrapper .swiper-button-next { right: 15px; }
.custom-slider-wrapper .swiper-button-prev::after,
.custom-slider-wrapper .swiper-button-next::after {
    font-family: swiper-icons;
    font-size: calc(var(--swiper-navigation-size, 40px) * 0.5);
    text-transform: none !important;
    letter-spacing: 0;
    font-variant: initial;
    line-height: 1;
}


/* --- Swiper Pagination --- */
.custom-slider-wrapper .swiper-pagination {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 10;
    transition: 300ms opacity;
}
/* Bullets */
.custom-slider-wrapper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    background: #fff;
    opacity: 0.5;
    margin: 0 5px;
    cursor: pointer;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}
.custom-slider-wrapper .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--card-profil-farbe, #0073aa); /* Use variable or default */
}
/* Thumbnails */
.custom-slider-wrapper .csp-swiper-thumbnails-wrapper {
    line-height: 0;
    margin-top: 10px;
    white-space: nowrap; /* Prevent wrapping */
    overflow-x: auto; /* Allow scrolling if too many thumbs */
}
.custom-slider-wrapper .csp-thumb-item {
    width: 80px;
    height: 50px;
    object-fit: cover;
    margin: 0 3px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    display: inline-block;
    vertical-align: middle;
}
.custom-slider-wrapper .csp-thumb-item.swiper-pagination-thumbnail-active {
    opacity: 1;
    border-color: var(--card-profil-farbe, #0073aa); /* Use variable or default */
}


/* --- Lazy Loading Placeholder --- */
.custom-slider-wrapper .swiper-lazy-preloader {
    border-top-color: var(--card-profil-farbe, #0073aa);
}


/* --- Responsiveness --- */
@media (max-width: 768px) { /* Example breakpoint */
    .custom-slider-wrapper .csp-slide-content,
    .custom-slider-wrapper .csp-slide-content-static {
        padding: 20px;
        max-width: 90%;
    }

    .csp-slide-content .csp-headline,
    .csp-slide-content-static .csp-headline { font-size: 1.5em; } /* Adjust mobile sizes */
    .csp-slide-content .csp-subline,
    .csp-slide-content-static .csp-subline { font-size: 1em; }
    .csp-slide-content .csp-description,
    .csp-slide-content-static .csp-description { font-size: 0.9em; }

    .custom-slider-wrapper .swiper-button-prev,
    .custom-slider-wrapper .swiper-button-next {
         --swiper-navigation-size: 30px;
    }
    .custom-slider-wrapper .swiper-pagination-bullet {
        width: 8px; height: 8px;
    }
    .custom-slider-wrapper.layout-50-text { width: 100%; }
    .custom-slider-text-container { width: 100%; }
    .custom-slider-wrapper .csp-thumb-item { width: 60px; height: 40px; }
}

.csp-slide-content .csp-description,
.csp-slide-content-static .csp-description {
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 1rem; /* Default size */
    color: inherit; /* Stelle sicher, dass der Div die Farbe erbt oder die Inline-Farbe nimmt */
}

/* NEU: Erzwinge Farbvererbung für P-Tags innerhalb der Beschreibung */
.csp-slide-content .csp-description p,
.csp-slide-content-static .csp-description p {
    color: inherit !important; /* Erbe die Farbe vom Elternelement (.csp-description div) */
    /* !important kann helfen, Theme-Overrides zu bekämpfen, aber teste erst ohne */
}


.csp-slide-content .csp-description p:last-child,
.csp-slide-content-static .csp-description p:last-child {
    margin-bottom: 0;
}


/* Add more specific responsive overrides if needed */