/* ==========================================================================
   3. CONTENT BEREICH & FLEXIBLE BREITEN (components.css)
   ========================================================================== */

/* Die Hauptspalte nutzt jetzt die volle Breite abzüglich eures Randabstands */
.content-wrapper {
    flex: 1 0 auto;
    padding: 6rem var(--spacing) 4rem var(--spacing); /* Genug Platz für die Schrägen oben */
    width: 100%;
    max-width: 100%; /* Bricht den engen Schlauch radikal auf */
    z-index: 5;
    box-sizing: border-box;
}
/* ==========================================================================
   DER KORREKTE FULL-WIDTH-WECHSEL (Mücken-Vernichter)
   ========================================================================== */

/* 1. Wenn ein Full-Width-Artikel existiert, fallen links und rechts die globalen Fesseln */
.content-wrapper:has(.content-full) {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 2. SCHUTZSCHILD: Jeder normale Artikel (der NICHT content-full ist) bekommt mobil seine Ränder zurück! */
.content-wrapper:has(.content-full) .mod_article:not(.content-full) {
    padding-left: var(--spacing);
    padding-right: var(--spacing);
    /* ⚡ HIER ERGÄNZT: Schafft einen harmonischen, luftigen Abstand von 4rem nach unten */
    margin-bottom: 4rem; 
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   UTILITY-KLASSEN FÜR DIE ARTIKEL-BREITEN (Im Backend beim Artikel eintragen)
   -------------------------------------------------------------------------- */

/* 1. STANDARD-TEXT-BREITE (Jetzt optimiert auf eure gewohnten 1100px aus der Vorlage) */
.content-text {
    max-width: var(--maxWidth); /* Nutzt eure globalen 1100px */
    margin-left: auto;
    margin-right: auto;
}

/* 2. OPTIONALER SCHMALER TEXT: Wenn man mal "kleinen konzentrierten Content" anbieten will */
.content-narrow {
    max-width: var(--narrowWidth);
    margin-left: auto;
    margin-right: auto;
}

/* 3. WIDE-LAYOUT: Für euer zukünftiges dreispaltiges Topic-Boxen-Raster */
.content-wide {
    max-width: var(--maxWidth); /* Identisch mit Standard, hält den Code sauber */
    margin-left: auto;
    margin-right: auto;
}

/* 4. FULL-WIDTH: Für das HERO-Element (Nutzt 100% ohne jegliche Ränder) */
.content-full {
    max-width: 100%;
    width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ==========================================================================
   GLOBALE CMS-TYPOGRAFIE & SCHRIFTGRÖSSEN
   ========================================================================== */
/* ==========================================================================
   4. NATIVE CONTAO CORE-ELEMENTE (Brot-und-Butter-Inhalte)
   ========================================================================== */

/* 🧱 GLOBALER MASTER-RAHMEN: Holt nackte Überschriften und Texte in die Mitte */
.ce_headline,
.ce_text,
.content-headline,
.content-text,
h2.content-headline {
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 3.5rem;
    box-sizing: border-box;
}

/* 🧭 RSP BREITEN-LEITPLANKEN: Zwingt den Elementen eure Maße auf */
.content-wide {
    max-width: var(--maxWidth) !important; /* Volle 1600px (z.B. Impressum & Datenschutz) */
}

.content-narrow {
    max-width: var(--narrowWidth) !important; /* Gemütliche 1100px (z.B. Willkommenstext) */
}

/* Sorgt dafür, dass die nackte Überschrift linksbündig im zentrierten Raum bleibt */
h2.content-headline, .content-headline {
    text-align: left;
}

/* Verhindert das Kleben der H-Tags am oberen Rand */
.ce_headline h1, .ce_headline h2, .ce_text h1, .ce_text h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* 🖼️ MODERNER BILD-UMFLUSS (Eure Web-Inspector Entdeckung!) */
.media {
    display: flow-root;
    width: 100%;
}

.media > figure {
    max-width: 45%;
    height: auto;
    margin: 0;
}

/* Wenn im Backend bei der Bildausrichtung "Links" gewählt wurde */
.media--left > figure, .float_left {
    float: left !important;
    margin-right: 2.5rem !important; /* Euer perfekter Sicherheitsabstand */
    margin-bottom: 1.5rem !important;
}

/* Wenn im Backend bei der Bildausrichtung "Rechts" gewählt wurde */
.media--right > figure, .float_right {
    float: right !important;
    margin-left: 2.5rem !important; /* Euer perfekter Sicherheitsabstand */
    margin-bottom: 1.5rem !important;
}

/* Krisensicherer Abschluss für den Textfluss */
.ce_text::after, .media::after {
    content: "";
    display: table;
    clear: both;
}
/* 4. NATIVE CONTAO CORE-ELEMENTE - Ende */

/* Hauptüberschrift (z.B. "Datenschutzerklärung") */
.content-wrapper h2 {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--colorGrey); /* Euer edles Dunkelgrau */
    margin-top: 0;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

/* Die Zwischenüberschriften der Abschnitte (z.B. "Cookies", "SSL-Verschlüsselung") */
.content-wrapper h4 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--colorGrey);
    margin-top: 2.5rem;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

/* Der standardmäßige Fließtext aus dem CMS */
.content-wrapper p {
    font-size: 1.15rem; /* Perfekt lesbare, moderne Standardgröße */
    line-height: 1.75;  /* Augenschonender Zeilenabstand */
    color: var(--colorTextPrimary);
    margin-bottom: 1.5rem;
}

/* Ungeordnete Listen (z.B. bei den Server-Log-Files) */
.content-wrapper ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.content-wrapper ul li {
    font-size: 1.15rem;
    color: var(--colorTextPrimary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Standard-Links in euren Texten (z.B. der Link zu pcvisit) */
.content-wrapper a {
    color: var(--colorRed);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.content-wrapper a:hover {
    color: var(--colorGrey);
    text-decoration: underline;
}

/* 🛡️ SCHUTZSCHILD: Verhindert, dass globale Text-Link-Styles die Karten ruinieren */
.content-wrapper a.topic-card,
.content-wrapper a.topic-card:hover {
    text-decoration: none !important;
    color: var(--colorTextPrimary) !important;
    /* Schützt die originale, elastische 0.4s cubic-bezier Kurve aus der layout.css */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important; 
}

/* Verhindert, dass vererbtes Unterstreichen die inneren Texte erwischt */
.topic-card *, 
.topic-card *:hover {
    text-decoration: none !important;
}

/* ==========================================
   5. TOPIC GRID & PREMIUM CARDS
   ========================================== */
/* 🎬 Das Standard-Grid (Euer automatisches Flex-Raster) */
.topic-grid,
.topic-grid.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing);
    width: 100%;
    box-sizing: border-box;
}

/* 🧱 Festes 3-Spalten-Layout auf dem Desktop */
.topic-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* 🧱 Festes 4-Spalten-Layout auf dem Desktop */
.topic-grid.grid-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* 📱 Responsive-Schutzschild: Auf Tablets und Smartphones brechen feste Spalten sauber um */
@media (max-width: 1024px) {
    .topic-grid.grid-3,
    .topic-grid.grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    }
}

.topic-card {
    background: var(--colorWhite);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px; /* Schön abgerundet, wirkt moderner */
    overflow: hidden;
    text-decoration: none;
    color: var(--colorTextPrimary);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    /* Die Krönung: Eine extrem geschmeidige, elastische Animations-Kurve */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* 1. DER HOVER-EFFEKT: Gilt ab jetzt NUR noch für echte Link-Karten (a) */
a.topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(178, 31, 61, 0.2);
}


/* BILD-CONTAINER (Oben in der Karte) */
.card-image-wrapper {
    width: 100%;
    height: 180px;
    background-color: var(--colorGreyLight); /* Dezenter grauer Hintergrund fürs Bild */
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    transition: background-color 0.3s ease;
}

/* Wenn man über die Karte hovert, färbt sich der Bildbereich dezent ein */
.topic-card:hover .card-image-wrapper {
    background-color: #f0eeee;
}

.card-fallback-icon {
    font-size: 3.5rem;
    line-height: 1;
}

/* TEXT-BEREICH INNERHALB DER KARTE */
.card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Füllt die Karte perfekt aus */
}

.topic-card h2 {
    font-size: 1.35rem;
    color: #2c2c2c;
    margin-bottom: 0.8rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

/* Beim Hovern färbt sich die Überschrift in euer Firmen-Rot */
a.topic-card:hover h2 {
    color: var(--colorRed); /* Nur die Link-Überschrift wird rot */
}

/* 2. STATISCHER SCHUTZ: Info-Boxen (div) bleiben beim Hover absolut starr */
div.topic-card:hover {
    transform: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03) !important; /* Behält den sanften Standard-Schatten */
    cursor: default !important;
}

div.topic-card:hover h2 {
    color: var(--colorTextPrimary) !important; /* Text bleibt dunkelgrau */
}

.topic-card p {
    font-size: 0.95rem;
    color: var(--colorTextSecondary);
    line-height: 1.5;
    margin-bottom: 2rem;
    flex-grow: 1; /* Der gelernte Flexbox-Trick: Schiebt den Link unten IMMER auf dieselbe Höhe */
}

/* VISUELLER HINWEIS ZUM KLICKEN */
.card-action-hint {
    font-weight: bold;
    color: var(--colorRed);
    font-size: 0.9rem;
    transition: transform 0.3s ease, color 0.3s ease;
    align-self: flex-start;
}

/* Kleines Detail: Der Pfeil schiebt sich beim Hovern minimal nach rechts */
.topic-card:hover .card-action-hint {
    color: var(--colorGrey);
    transform: translateX(4px);
}

/* ==========================================================================
   6. HERO BANNER (Modular & Erweitert mit Boxen- und Spaltensteuerung)
   ========================================================================== */
.hero-banner {
    position: relative;
    width: 100%;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    min-height: 550px;
    display: flex;
    align-items: center;
    padding: 4rem 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat !important;
    background-color: #1a1a1a;
    box-sizing: border-box;
}

.hero-banner::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* 🧬 DAS MODULARE FLEXBOX-RASTER */
.hero-flex-row {
    display: flex;
    align-items: center;
    gap: 4rem;
    width: 100%;
}

.hero-text-column {
    flex: 1;
    z-index: 3;
    transition: all 0.3s ease;
}

/* 🧱 ZUSTAND 1: Der klassische 2-Spalten-Split (Text bleibt auf 50% gezügelt) */
.hero-banner.layout-split .hero-text-column {
    max-width: 650px; 
}

/* 🧱 ZUSTAND 2: Der 1-Spalten-Fokus (Text sprengt die Fesseln und nutzt 100%) */
.hero-banner.layout-full .hero-text-column {
    max-width: 100% !important; 
    flex: 0 0 100% !important;
}

/* Versteckt die Bildspalte im CSS zusätzlich, wenn das Full-Layout aktiv ist */
.hero-banner.layout-full .hero-image-column {
    display: none !important;
}

/* 📦 BOX-VARIANTE 1: Die Boxen umschließen NUR den Text (Standard, wenn kein Zusatzbild da ist) */
.hero-text-column.box-white {
    background-color: #ffffff !important;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.hero-text-column.box-trans {
    backdrop-filter: blur(12px) !important;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
    z-index: 4;
}
/* Weichen für die freistehende transparente Box je nach Hintergrund-Theme */
.hero-banner.hero-light .hero-text-column.box-trans { background-color: rgba(255, 255, 255, 0.75) !important; }
.hero-banner.hero-dark .hero-text-column.box-trans { background-color: rgba(0, 0, 0, 0.45) !important; }


/* 📦 BOX-VARIANTE 2: Die Box umschließt das gesamte Raster (Bild + Text zusammen, wenn Bild aktiv ist) */
.hero-flex-row:has(*.hero-text-column.box-white):has(*.hero-side-img) {
    background-color: #ffffff !important;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* ⚡ NEU: Die transparente Box umschließt das gesamte Raster seidenmatt */
.hero-flex-row:has(*.hero-text-column.box-trans):has(*.hero-side-img) {
    backdrop-filter: blur(12px) !important;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}
/* Weichen für das gesamte Raster je nach Hintergrund-Theme */
.hero-banner.hero-light .hero-flex-row:has(*.hero-side-img):has(*.hero-text-column.box-trans) { background-color: rgba(255, 255, 255, 0.75) !important; }
.hero-banner.hero-dark .hero-flex-row:has(*.hero-side-img):has(*.hero-text-column.box-trans) { background-color: rgba(0, 0, 0, 0.45) !important; }


/* 🧼 AUFRÄUM-LOGIK: Verhindert doppelte Hintergründe im Inneren des umschließenden Rasters */
.hero-flex-row:has(*.hero-side-img) .hero-text-column.box-white,
.hero-flex-row:has(*.hero-side-img) .hero-text-column.box-trans {
    background-color: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}


/* ==========================================================================
   ANPASSUNG FÜR DEN TEXTFARBEN-SCHUTZ (Inklusive eurer Contao-Editor-Sternchen)
   ========================================================================== */
.hero-flex-row:has(*.box-white) h1,
.hero-text-column.box-white h1 { 
    color: var(--colorGrey) !important; 
    text-shadow: none !important; 
    font-size: 2.5rem !important; 
    margin-bottom: 1.2rem !important; 
    font-weight: 800; 
}

.hero-flex-row:has(*.box-white) .hero-text p,
.hero-text-column.box-white .hero-text p { 
    color: var(--colorTextPrimary) !important; 
    text-shadow: none !important; 
    margin-bottom: 1rem !important; 
    line-height: 1.6; 
}

/* Spezieller Farbschutz für die transparente Box im Dark-Theme (damit weißer Text weiß bleibt) */
.hero-banner.hero-dark .hero-text-column.box-trans h1 { color: var(--colorWhite) !important; text-shadow: none !important; }
.hero-banner.hero-dark .hero-text-column.box-trans .hero-text p { color: rgba(255, 255, 255, 0.95) !important; text-shadow: none !important; }

.hero-flex-row:has(*.box-white) .rsp-button,
.hero-text-column.box-white .rsp-button,
.hero-text-column.box-trans .rsp-button { 
    margin-top: 1.5rem; 
}

/* 🖼️ DAS OPTIONALE ZUSATZBILD (Mit Schatten und Rundung) */
.hero-side-img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    transition: transform 0.4s ease;
}
.hero-banner:hover .hero-side-img { transform: scale(1.02); }

.hero-image-column {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

/* 🧭 AUSRICHTUNGS-WEICHE */
.hero-banner.align-right .hero-flex-row { flex-direction: row-reverse; }

/* 📱 RESPONSIVE STACKING */
@media (max-width: 991px) {
    .hero-flex-row, .hero-banner.align-right .hero-flex-row { flex-direction: column !important; gap: 2rem; padding: 2rem !important; }
    .hero-text-column { max-width: 100%; width: 100%; }
    .hero-side-img { max-height: 250px; }
}

/* --------------------------------------------------------------------------
   THEME-STILE (Eure Basis-Overlays aus der Vorwoche)
   -------------------------------------------------------------------------- */
.hero-banner.hero-light::before { background-color: rgba(255, 255, 255, 0.65); backdrop-filter: blur(4px); }
.hero-banner.hero-light:not(:has(.box-white)) h1 { color: var(--colorGrey) !important; }
.hero-banner.hero-light:not(:has(.box-white)) .hero-text p { color: var(--colorTextPrimary) !important; }

.hero-banner.hero-dark::before { background-color: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); }
.hero-banner.hero-dark:not(:has(.box-white)) h1 { color: var(--colorWhite) !important; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); }
.hero-banner.hero-dark:not(:has(.box-white)) .hero-text p { color: rgba(255, 255, 255, 0.95) !important; text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3); }

/* 🚀 DER ROBUSTE RSP BUTTON */
.rsp-button {
    display: inline-block;
    background-color: var(--colorRed);
    color: var(--colorWhite) !important;
    padding: 1rem 2.2rem;
    border-radius: 50px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(178, 31, 61, 0.35);
    transition: all 0.3s ease;
}
.rsp-button:hover {
    background-color: var(--colorGrey);
    color: var(--colorWhite) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
/* ==========================================================================
   MAßGESCHNEIDERTE RTE-BILD-KLASSEN (Updatesicher & exakt)
   ========================================================================== */
img.rte-image-left {
    float: left !important;
    margin-right: 1.8rem !important; /* Euer perfekter Sicherheitsabstand! */
    margin-bottom: 1rem !important;
    max-width: 45% !important;
    height: auto !important;
}

img.rte-image-right {
    float: right !important;
    margin-left: 1.8rem !important;
    margin-bottom: 1rem !important;
    max-width: 45% !important;
    height: auto !important;
}

/* Universeller Clearfix-Schutz für alle Textcontainer */
.hero-text::after, .ce_text::after, .teaser-text::after {
    content: "";
    display: table;
    clear: both;
}
/* ==========================================================================
   7. RSP MODERNER CONTENT-SLIDER (Swiper-Nested-Fade)
   ========================================================================== */
.content-swiper,
.swiper {
    width: 100%;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

/* Verhindert jegliches Flackern oder Ruckeln während des seidenweichen Fades */
.swiper-effect-fade .swiper-slide {
    pointer-events: none;
    transition: opacity 0.8s ease-in-out !important;
}

.swiper-effect-fade .swiper-slide-active {
    pointer-events: auto;
}
