/**
 * LichtWesen: PageBuilder Spacing Fix für Infoblog-Seiten
 * 
 * Problem: Der PageBuilder erzeugt für jeden Textblock eine eigene
 * Row > Column-Group > Column-Line > Column Struktur, was zu
 * übermäßigen Abständen zwischen den Sections führt.
 *
 * Dieser Fix reduziert die Abstände ohne den HTML zu ändern.
 */

/* ============================================
   ROW SPACING - Abstände zwischen Rows auf 0
   ============================================ */

/* Row-Container: kein Margin */
.ct-view [data-content-type="row"][data-appearance="contained"] {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

/* Row-Inner (data-element="inner"): kein Padding */
.ct-view [data-content-type="row"] > [data-element="inner"] {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}


/* ============================================
   COLUMN SPACING
   ============================================ */

/* Column-Group */
.ct-view [data-content-type="column-group"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Column-Line */
.ct-view [data-content-type="column-line"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Column */
.ct-view [data-content-type="column"] {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}


/* ============================================
   CONTENT BLOCK SPACING
   ============================================ */

/* HTML Blocks (Anchor-Links) - kein Spacing */
.ct-view [data-content-type="html"] {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    line-height: 0;
}

/* Text Blocks */
.ct-view [data-content-type="text"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}


/* ============================================
   TYPOGRAFIE & LISTEN
   ============================================ */

/* Abstände bei Überschriften innerhalb von Sections */
.ct-view [data-content-type="text"] h3 {
    margin-top: 1.2em;
    margin-bottom: 0.4em;
}

/* Erste Überschrift braucht keinen Top-Margin */
.ct-view [data-content-type="text"]:first-child h3:first-child {
    margin-top: 0;
}

/* Paragraphen-Abstände */
.ct-view [data-content-type="text"] p {
    margin-top: 0.3em;
    margin-bottom: 0.3em;
}

/* Bullet-Listen (echte <ul>) */
.ct-view [data-content-type="text"] ul {
    margin-top: 0.3em;
    margin-bottom: 0.5em;
    padding-left: 1.5em;
}

.ct-view [data-content-type="text"] ul li {
    margin-bottom: 0.15em;
}

/* Fake-Bullet Paragraphen (· middot bullets als <p> Tags) */
.ct-view [data-content-type="text"] p:has(~ p) {
    margin-bottom: 0.2em;
}


/* ============================================
   LEERE SPACER VERSTECKEN
   ============================================ */

/* Leere &nbsp; Paragraphen ausblenden */
.ct-view [data-content-type="text"] p:empty,
.ct-view [data-content-type="text"] p:has(> br:only-child) {
    display: none;
}

/* Spezifisch: Paragraphen die nur &nbsp; enthalten.
   CSS kann &nbsp; nicht direkt selektieren, daher 
   über min-height/margin kollabieren */


/* ============================================
   INHALTSVERZEICHNIS BOX
   ============================================ */

/* TOC behält sein Padding */
.ct-view [data-pb-style="CGL3X9B"] {
    padding: 15px !important;
    margin-bottom: 10px !important;
}


/* ============================================
   FARBSTRAHLEN LINKS SECTION
   ============================================ */

/* Links mit line-height: 10px kompakter machen */
.ct-view [data-content-type="text"] p[style*="line-height: 10px"] {
    margin-top: 0 !important;
    margin-bottom: 2px !important;
}


/* ============================================
   PRODUKT-CAROUSEL SECTION
   ============================================ */

/* Etwas Abstand vor dem Produkt-Carousel */
.ct-view [data-content-type="products"] {
    margin-top: 15px;
}

/* Headline vor Produkten */
.ct-view .headline-uppercase h3 {
    margin-top: 1.5em;
}
