/* Zeitleiste (widgets/zeitleiste-widget.php). Farben über Variablen, die die
   Stil-Einstellungen des Widgets setzen; Schriften vom Theme. */

.lvooe-zeitleiste {
    --lvooe-zeitleiste-linie-farbe: var(--lvooe-zeitleiste-linie, currentColor);
    --lvooe-zeitleiste-grund-farbe: var(--lvooe-zeitleiste-grund, white);
    --lvooe-zeitleiste-akzent-farbe: var(--lvooe-zeitleiste-akzent, #C3E7A3);
    --lvooe-zeitleiste-akzent-text-farbe: var(--lvooe-zeitleiste-akzent-text, black);

    margin: 0;
    padding: 0;
    list-style: none;
}

.lvooe-zeitleiste-etappe {
    margin: 0;
    min-width: 0;
}

.lvooe-zeitleiste-frist {
    align-self: end;
    justify-self: start;
    margin-bottom: 8px;
    padding: 2px 8px;
    background: var(--lvooe-zeitleiste-akzent-farbe);
    color: var(--lvooe-zeitleiste-akzent-text-farbe);
    font-size: 12px;
    font-weight: bold;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lvooe-zeitleiste-titel {
    display: block;
    font-size: 1.05em;
}

.lvooe-zeitleiste-text {
    display: block;
    font-size: 0.9em;
    line-height: 1.4;
}

.lvooe-zeitleiste-verweis {
    display: block;
    margin-top: 2px;
    font-size: 0.8em;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

/* Punkt (hohl, hervorgehoben gefüllt) */
.lvooe-zeitleiste-punkt::after,
.lvooe-zeitleiste-senkrecht .lvooe-zeitleiste-titel::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border: 3px solid var(--lvooe-zeitleiste-linie-farbe);
    border-radius: 50%;
    background: var(--lvooe-zeitleiste-grund-farbe);
}

.lvooe-zeitleiste-hervorgehoben .lvooe-zeitleiste-punkt::after,
.lvooe-zeitleiste-senkrecht .lvooe-zeitleiste-hervorgehoben .lvooe-zeitleiste-titel::before {
    background: var(--lvooe-zeitleiste-linie-farbe);
}

/* ===== Waagrecht: eine Spalte pro Etappe; die Zeilen (Frist, Punkt, Titel,
   Text, Verweis) gehen über alle Etappen (Subgrid), damit alles auf einer
   Höhe steht, auch wenn eine Etappe keine Frist hat. ===== */

.lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) {
    display: grid;
    grid-template-columns: repeat(var(--lvooe-zeitleiste-anzahl, 4), minmax(0, 1fr));
    grid-template-rows: auto 16px auto auto auto;
}

.lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-etappe {
    display: grid;
    grid-row: 1 / -1;
    grid-template-rows: subgrid;
    padding-right: 16px;
}

.lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-frist { grid-row: 1; }
.lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-punkt { grid-row: 2; }
.lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-titel { grid-row: 3; margin-top: 12px; }
.lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-text { grid-row: 4; }
.lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-verweis { grid-row: 5; }

/* Linie durch die Punkte, über die volle Breite der Etappe (samt Abstand). */
.lvooe-zeitleiste-punkt {
    position: relative;
    margin-right: -16px;
}

.lvooe-zeitleiste-punkt::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--lvooe-zeitleiste-linie-farbe);
}

.lvooe-zeitleiste-punkt::after {
    top: 0;
    left: 0;
}

/* ===== Senkrecht: Linie links, der Punkt neben dem Titel. ===== */

.lvooe-zeitleiste-senkrecht {
    display: flex;
    flex-direction: column;
}

.lvooe-zeitleiste-senkrecht .lvooe-zeitleiste-etappe {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 0 24px 36px;
}

.lvooe-zeitleiste-senkrecht .lvooe-zeitleiste-etappe:last-child {
    padding-bottom: 0;
}

.lvooe-zeitleiste-senkrecht .lvooe-zeitleiste-etappe::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 6px;
    width: 4px;
    background: var(--lvooe-zeitleiste-linie-farbe);
}

.lvooe-zeitleiste-senkrecht .lvooe-zeitleiste-punkt {
    display: none;
}

.lvooe-zeitleiste-senkrecht .lvooe-zeitleiste-frist {
    align-self: flex-start;
}

.lvooe-zeitleiste-senkrecht .lvooe-zeitleiste-titel {
    position: relative;
}

.lvooe-zeitleiste-senkrecht .lvooe-zeitleiste-titel::before {
    top: 0.2em;
    left: -36px;
}

/* Auf dem Handy immer senkrecht (gleiche Regeln wie oben). */
@media (max-width: 767px) {
    .lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) {
        display: flex;
        flex-direction: column;
    }

    .lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-etappe {
        position: relative;
        display: flex;
        flex-direction: column;
        padding: 0 0 24px 36px;
    }

    .lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-etappe:last-child {
        padding-bottom: 0;
    }

    .lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-etappe::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 6px;
        width: 4px;
        background: var(--lvooe-zeitleiste-linie-farbe);
    }

    .lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-punkt {
        display: none;
    }

    .lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-frist {
        align-self: flex-start;
    }

    .lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-titel {
        position: relative;
        margin-top: 0;
    }

    .lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-titel::before {
        content: "";
        position: absolute;
        top: 0.2em;
        left: -36px;
        width: 16px;
        height: 16px;
        box-sizing: border-box;
        border: 3px solid var(--lvooe-zeitleiste-linie-farbe);
        border-radius: 50%;
        background: var(--lvooe-zeitleiste-grund-farbe);
    }

    .lvooe-zeitleiste:not(.lvooe-zeitleiste-senkrecht) .lvooe-zeitleiste-hervorgehoben .lvooe-zeitleiste-titel::before {
        background: var(--lvooe-zeitleiste-linie-farbe);
    }
}
