/* Datei: Zentrale Styles der Joomla-Historie-Timeline.
 * Alle Anpassungen an Abständen, Größen und responsive Verhalten können hier getestet werden.
 */

.history-timeline {
    position: relative;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px 0;
}

/* zentrale Timeline-Linie */
.history-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    transform: translateX(-50%);
    background: var(--cassiopeia-color-primary, #1d3557);
    border-radius: 4px;
}

/* Jeder Beitrag belegt exakt eine Hälfte */
.history-item {
    position: relative;
    width: 50%;
    box-sizing: border-box;
    padding: 20px 55px;
    clear: both;
}

.history-left {
    float: left;
    text-align: right;
}

.history-right {
    float: right;
    text-align: left;
}

/* sorgt dafür, dass die Timeline auch bei Floats vollständig sichtbar bleibt */
.history-timeline::after {
    content: "";
    display: table;
    clear: both;
}

/* 
 * PIKTOGRAMM-GRÖSSE
 * ------------------------------------------------------------
 * Nur diesen einen Wert ändern:
 *   54px = Größe des Piktogramms
 *
 * Der Kreis/Rahmen wird automatisch 16px größer berechnet.
 * Dadurch bleiben rundherum ca. 8px Abstand zwischen
 * Piktogramm und Rahmen.
 */
.history-marker {
    --history-icon-size: 70px;

    position: absolute;
    top: 24px;

    /* Rahmen = Piktogramm + 16px für den umlaufenden Abstand */
    width: calc(var(--history-icon-size) + 16px);
    height: calc(var(--history-icon-size) + 16px);

    box-sizing: border-box;
    border-radius: 50%;
    background: #fff;
    border: 0px solid var(--cassiopeia-color-primary, #1d3557);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    overflow: hidden;
}

/* Der Mittelpunkt des Rahmens bleibt exakt auf der Timeline-Linie. */
.history-left .history-marker {
    right: calc(-1 * (var(--history-icon-size) + 16px) / 2);
}

.history-right .history-marker {
    left: calc(-1 * (var(--history-icon-size) + 16px) / 2);
}

/* Das Piktogramm übernimmt automatisch die oben eingestellte Größe. */
.history-marker img {
    display: block;
    width: var(--history-icon-size) !important;
    height: var(--history-icon-size) !important;
    max-width: var(--history-icon-size) !important;
    max-height: var(--history-icon-size) !important;
    object-fit: contain;
}

/* Beitragskarte */
.history-content {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
}

.history-date {
    font-size: .9rem;
    font-weight: 700;
    opacity: .7;
    margin-bottom: 5px;
}

.history-title {
    margin: 0 0 10px;
    font-size: 1.3rem;
}

.history-title a {
    text-decoration: none;
}

.history-text {
    line-height: 1.6;
}

/* H1 der Historie-Seite auf 1rem setzen. Dieser Wert kann hier direkt getestet werden. */
h1 {
    font-size: 1rem !important;
}

/* Mobile: eine Spalte, Linie links */
@media (max-width: 700px) {
    .history-timeline {
        margin: 25px 0;
        padding: 10px 0;
    }

    .history-timeline::before {
        left: 28px;
        transform: none;
    }

    .history-item,
    .history-left,
    .history-right {
        float: none;
        width: 100%;
        padding: 15px 15px 15px 75px;
        text-align: left;
    }

    .history-left .history-marker,
    .history-right .history-marker {
        left: 2px;
        right: auto;
    }
}


/* Historientext auf maximal vier sichtbare Zeilen begrenzen.
   Der Text bleibt dabei vollständig als Link zum Beitrag klickbar. */
.history-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
}

/* Der gesamte sichtbare Historientext ist als Link zum jeweiligen Beitrag klickbar. */
.history-text a {
    color: inherit;
    text-decoration: none;
}

/* Beim Überfahren wird der klickbare Text als Link kenntlich gemacht. */
.history-text a:hover {
    text-decoration: underline;
}


/* Kleinere Überschriften innerhalb der Historie */
.history-title {
    font-size: 1rem;
    line-height: 1.3;
}


/* Erste Überschrift/Textzeile: nur diese Überschrift ist als Link klickbar. */
.history-inline-title {
    font-size: 1rem;
    line-height: 1.3;
    margin: 0 0 10px;
}

.history-inline-title a {
    color: inherit;
    text-decoration: underline;
}

.history-inline-title a:hover {
    text-decoration: underline;
}
