/* =========================================
   CUSTOM TIMELINE (Compact Holidays)
   ========================================= */

/* --- BASIS SETUP --- */

.section-custom-timeline {
    background: #FFF;
    color: #768390;
    font-family: "Effra", Helvetica, sans-serif;
    padding: 0 0 50px 0;
}

.custom-timeline-intro {
    margin-bottom: 60px;
    padding: 3em 0;
    border-bottom: 1px solid #E4EAEC;
}

.custom-timeline-intro h1, .custom-timeline-intro h2, .custom-timeline-intro h3, .custom-timeline-intro h4, .custom-timeline-intro h5 {
    color: #3D4351;
    /* text-transform: uppercase; */
    letter-spacing: 1px;    
    text-align: center;
}

.custom-timeline-intro p {
    margin: 0 auto;
    font-size: 16px;
    max-width: 600px;
    line-height: 1.6;    
}

/* --- TIMELINE CONTAINER --- */
.custom-timeline {
    line-height: 1.4em;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.custom-timeline h1, .custom-timeline h2, .custom-timeline h3, .custom-timeline h4, .custom-timeline h5, .custom-timeline h6 {
    line-height: inherit;
    margin-top: 0;
    color: #3D4351;
}

/* Link Farbe */
.custom-timeline a {
    color: #FF6B6B;
    text-decoration: none;
    transition: color 0.3s;
}
.custom-timeline a:hover {
    color: #ff9e9e;
}

/* --- ITEM (Wrapper) --- */
.ct-item {
    padding-left: 40px;
    position: relative;
    clear: both;
}
.ct-item::after {
    content: "";
    display: table;
    clear: both;
}
.ct-item:last-child {
    padding-bottom: 0;
}

/* --- INFO (Datum) --- */
.ct-info {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    margin: 0 0 .5em 0;
    text-transform: uppercase;
    white-space: nowrap;
    color: #3D4351;
}

/* --- MARKER (Punkt & Linie) --- */
.ct-marker {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 15px;
}

/* Der Rote Punkt */
.ct-marker:before {
    background: #FF6B6B;
    border: 3px solid transparent;
    border-radius: 100%;
    content: "";
    display: block;
    height: 15px;
    width: 15px;
    position: absolute;
    top: 4px; left: 0;
    transition: background 0.3s ease-in-out, border 0.3s ease-in-out;
    z-index: 10;
}

/* Die Graue Linie */
.ct-marker:after {
    content: "";
    width: 3px;
    background: #CCD5DB;
    display: block;
    position: absolute;
    top: 24px; bottom: 0; left: 6px;
    z-index: 0;
}

/* Keine Linie beim allerletzten Element */
.ct-item:last-child .ct-marker:after {
    content: none;
}

/* Hover Effekt */
.ct-item:not(.ct-period):hover .ct-marker:before {
    background: transparent;
    border: 3px solid #FF6B6B;
}

/* --- CONTENT (Text Karte) --- */
.ct-content {
    padding-bottom: 40px;
}

/* NEU: Titel-Formatierung für saubere Umbrüche */
.ct-content h3 {
    white-space: normal;       /* Erlaubt den Umbruch generell */
    line-height: 1.3;          /* Sieht bei 2 Zeilen schöner aus */
    overflow-wrap: break-word; /* Bricht sehr lange Wörter um */
    margin-bottom: 0.5em;      /* Etwas Abstand zum Text darunter */

    /* Der "Hängende Einzug" Trick: */
    /* Verschiebt alles nach rechts, zieht aber die erste Zeile wieder nach links */
    padding-left: 18px; 
    text-indent: -18px;
}

.ct-content p:last-child {
    margin-bottom: 0;
}

/* =========================================
   SPECIAL: PERIOD (FERIEN - FINAL Z-INDEX FIX)
   ========================================= */

.ct-item.ct-period {
    padding: 20px 0 30px 0; 
}

/* Info und Marker-Punkt ausblenden */
.ct-item.ct-period .ct-info,
.ct-item.ct-period .ct-marker:before {
    display: none !important;
}

/* Die Linie läuft durchgehend (Layer 0) */
.ct-item.ct-period .ct-marker:after {
    content: "";
    height: 100%;
    top: 0;
    z-index: 0; 
}

/* --- CONTAINER --- */
.ct-item.ct-period .ct-content {
    display: flex;
    flex-direction: column; /* Untereinander */
    align-items: center;    /* Mittig */
    
    padding: 0;
    /* Dieser Container liegt insgesamt über der grauen Linie */
    position: relative; 
    z-index: 20; 
}

/* --- 1. Der Ferien-Titel (Das Badge) --- */
.ct-item.ct-period .ct-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    background: #FFF;          
    border: 2px solid #FFC107; 
    color: #d68e00;
    
    padding: 5px 20px;
    border-radius: 50px;
    margin-bottom: 0; /* Kein Margin, Abstand macht das P-Element */
    
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);

    /* NEU: WICHTIGSTER FIX! */
    /* Wir heben den Badge explizit auf die höchste Ebene in diesem Block */
    position: relative;
    z-index: 10; 
}

/* --- 2. Das Datum darunter --- */
.ct-item.ct-period .ct-content p {
    background: #FFF;
    padding: 0 10px;           
    
    font-size: 0.75rem;
    color: #999;
    font-weight: 600;
    
    /* Abstand nach oben */
    margin-top: 5px; 
    
    /* Der weiße "Abdeck-Schatten" nach oben */
    box-shadow: 0 -6px 0 #FFF; 

    /* NEU: WICHTIGSTER FIX! */
    /* Das Datum liegt tiefer als der Badge, aber über der Linie */
    position: relative;
    z-index: 5;
}


/* Desktop Anpassung (Reset floats) */
@media (min-width: 992px) {
    .custom-timeline > .ct-item.ct-period .ct-content {
        float: none;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .custom-timeline .ct-item.ct-period {
        padding: 20px 0 40px 0;
    }
    
    .custom-timeline .ct-period .ct-marker:after {
        height: 100%;
        top: 0;
    }
}

/* =========================================
   DESKTOP ANSICHT (Zentriert, ab 992px)
   ========================================= */
@media (min-width: 992px) {
    /* Reset */
    .custom-timeline,
    .custom-timeline .ct-item,
    .custom-timeline .ct-info,
    .custom-timeline .ct-marker,
    .custom-timeline .ct-content {
        display: block;
        margin: 0;
        padding: 0;
    }

    /* Abstand unten für normale Items */
    .custom-timeline .ct-item {
        padding-bottom: 40px;
        overflow: hidden;
    }

    /* Marker Mitte */
    .custom-timeline .ct-marker {
        position: absolute;
        left: 50%;
        margin-left: -7.5px;
    }

    /* 50/50 Aufteilung */
    .custom-timeline .ct-info,
    .custom-timeline .ct-content {
        width: 50%;
    }

    /* UNGERADE: Info links, Content rechts */
    .custom-timeline > .ct-item:nth-child(odd) .ct-info {
        float: left;
        text-align: right;
        padding-right: 30px;
    }
    .custom-timeline > .ct-item:nth-child(odd) .ct-content {
        float: right;
        text-align: left;
        padding-left: 30px;
    }

    /* GERADE: Info rechts, Content links */
    .custom-timeline > .ct-item:nth-child(even) .ct-info {
        float: right;
        text-align: left;
        padding-left: 30px;
    }
    .custom-timeline > .ct-item:nth-child(even) .ct-content {
        float: left;
        text-align: right;
        padding-right: 30px;
    }

    /* --- FERIEN DESKTOP FIX --- */
    /* Immer volle Breite und zentriert */
    .custom-timeline > .ct-item.ct-period .ct-content {
        float: none;
        width: 100%;
        text-align: center;
        padding: 0;
    }
    /* Kleinerer Abstand auch auf Desktop */
    .custom-timeline .ct-item.ct-period {
        padding: 20px 0 40px 0;
    }
    /* Linie läuft durch */
    .custom-timeline .ct-period .ct-marker:after {
        height: 100%;
        top: 0;
    }
}

/* Basis-Styling für die Meta-Infos (ersetzt deine Inline-Styles) */
.ct-meta {
    font-style: italic;
    margin-top: 0.5em;
    margin-bottom: 0;
    line-height: 1.4;
}
.ct-church + .ct-location {
    margin-top: 0; 
}

/* =========================================
   HORIZONT / IN PLANUNG (Konzept 1)
   ========================================= */

.timeline-horizon {
    background: #fdfdfd;
    border: 2px dashed #dbe4ea; /* Gestrichelte Linie = Entwurf/Planung */
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 60px; /* Abstand zur echten Timeline */
    text-align: center;
}

.horizon-headline {
    color: #8fa1b3;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.horizon-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.horizon-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    width: 260px;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.horizon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Bildbereich */
.horizon-image {
    height: 140px;
    background: #f0f0f0;
    overflow: hidden;
    position: relative;
}

/* Der Schwarz-Weiß Effekt (Konzept 2 Aspekt) */
.horizon-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

/* Farbe bei Hover */
.horizon-card:hover .horizon-image img {
    filter: grayscale(0%);
}

.horizon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #ddd;
    font-weight: bold;
}

/* Inhalt */
.horizon-content {
    padding: 15px;
    text-align: left;
}

.horizon-content h5 {
    font-size: 1rem;
    margin: 10px 0 5px 0;
    color: #3D4351;
    line-height: 1.3;
}

.horizon-content small {
    display: block;
    color: #999;
    font-style: italic;
    margin-top: 5px;
}

/* Das "Termin folgt" Badge */
.horizon-badge {
    display: inline-block;
    background: #eee;
    color: #666;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Responsive Anpassung */
@media (max-width: 600px) {
    .horizon-card {
        width: 100%; /* Volle Breite auf Handy */
        flex-direction: row; /* Bild links, Text rechts */
        height: auto;
    }
    .horizon-image {
        width: 100px;
        height: auto;
        flex-shrink: 0;
    }
    .horizon-content {
        padding: 10px 15px;
    }
}
