/* ==========================================================================
   1. Resets & Basis-Styles
   ========================================================================== */
:root {
    --primary-color: #1a252f;
    --text-color: #555555;
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --line-color: RGB(25, 88, 167); /* Farbe für den vertikalen Strich */
}

.sbhh-timeline-container {
    /*max-width: 1100px;*/
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative; /* Bezugspunkt für den vertikalen Strich */
}

/*
 * DER VERTIKALE STRICH (Standard für Mobile)
 * Fotos auf Mobile sind 80px breit. Padding der Karte ist 20px.
 * 20px Padding + 40px (Hälfte von 80px) = 60px von links.
 */
.sbhh-timeline-container::before {
    content: "";
    position: absolute;
    top: 60px; /* Startet mittig im 1. Foto auf Mobile */
    bottom: 60px; /* Endet mittig im letzten Foto auf Mobile */
    left: 36px; /* Exakt durch die Mitte der mobilen Fotos */
    width: 0;
    background-color: var(--line-color);
    transform: translateX(-50%);
    z-index: 1; /* Strich liegt HINTER den Fotos */
}

/* ==========================================================================
   2. Mobile Layout (Smartphone: 2 Spalten -> Foto links, Text-Cluster rechts)
   ========================================================================== */
.sbhh-timeline {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Foto auf Mobile */
.sbhh-timeline_photo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: contain;
    border: 3px solid var(--line-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    /* background-color: var(--bg-color); */
    position: relative;
    z-index: 3;
    background-color: white;
    background-repeat: no-repeat;
}

/* Text-Wrapper */
.sbhh-timeline_text-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.sbhh-timeline_header {
    display: flex;
    flex-direction: column;
}

.sbhh-timeline_name {
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.2;
}

.sbhh-timeline_description {
    font-size: 1em;
    color: var(--text-color);
    margin-top: 6px;
}

.sbhh-timeline_description p {
    margin-bottom: 0.5em !important; /* überschreibt den unteren Abstand des <p> */
    text-indent: 2.5em hanging;
}

/* ==========================================================================
   3. Desktop Layout (ab 768px: 3 getrennte Spalten & Mittellinie)
   ========================================================================== */
@media (min-width: 768px) {
    .sbhh-timeline-container {
        gap: 0;
    }

    /* Position der Linie für Desktop auf die Mitte anpassen */
    .sbhh-timeline-container::before {
        top: 0;
        bottom: 0;
        left: 50%; /* Exakt in der Bildschirmmitte */
        width: 3px;
    }

    .sbhh-timeline {
        background-color: transparent;
        box-shadow: none;
        padding: 10px 0;
        border-radius: 0;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        column-gap: 20px;
        border: none;
    }

    .sbhh-timeline_text-group {
        display: contents;
    }

    /* Das Foto steht IMMER in Spalte 2 und verdeckt den Strich sauber */
    .sbhh-timeline_photo {
        grid-column: 2;
        grid-row: 1;
        width: 28px;
        height: 28px;
    }

    .sbhh-timeline_name {
        font-size: 1.25em;
    }

    .sbhh-timeline_description {
        font-size: 1em;
        background-color: var(--card-bg);
        border-radius: 5px;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(0, 0, 0, 0.2);
    }

    /* Ungerade Zeilen (1, 3, 5...) */
    .sbhh-timeline:nth-child(even) .sbhh-timeline_header {
        grid-column: 1;
        grid-row: 1;
        text-align: right;
    }

    .sbhh-timeline:nth-child(even) .sbhh-timeline_description {
        grid-column: 3;
        grid-row: 1;
        text-align: left;
    }

    /* Gerade Zeilen (2, 4, 6...) */
    .sbhh-timeline:nth-child(odd) .sbhh-timeline_header {
        grid-column: 3;
        grid-row: 1;
        text-align: left;
    }

    .sbhh-timeline:nth-child(odd) .sbhh-timeline_description {
        grid-column: 1;
        grid-row: 1;
        text-align: left;
    }
}
