/* ==========================================================================
   Timeline – theme & layout
   ========================================================================== */

:root {
    --tl-rail: #dee2e6;          /* the vertical line colour            */
    --tl-brand-1: #4f46e5;       /* navbar / brand gradient start       */
    --tl-brand-2: #7c3aed;       /* navbar / brand gradient end         */
    --tl-color: #6c757d;         /* per-item accent, overridden inline  */
}

body {
    background: #f7f7fb;
}

/* Brand navbar ------------------------------------------------------------ */
.tl-navbar {
    background: linear-gradient(90deg, var(--tl-brand-1), var(--tl-brand-2));
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

/* Timeline list cards (index) --------------------------------------------- */
.tl-card {
    transition: transform .15s ease, box-shadow .15s ease;
}
.tl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .12) !important;
}

/* Category legend badges -------------------------------------------------- */
.tl-legend {
    color: #fff;
    font-weight: 600;
}

/* ==========================================================================
   The vertical timeline
   ========================================================================== */
.tl-timeline {
    position: relative;
    margin: 0;
    padding: .5rem 0 .5rem 0;
}

/* the rail (vertical line) */
.tl-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 3px;
    background: var(--tl-rail);
    border-radius: 3px;
}

.tl-item {
    position: relative;
    padding-left: 56px;
    margin-bottom: 2.25rem;
}
.tl-item:last-child {
    margin-bottom: .5rem;
}

/* the coloured node on the rail */
.tl-marker {
    position: absolute;
    left: 12px;
    top: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tl-color);
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px var(--tl-color);
}

.tl-content {
    border: 0;
    border-top: 3px solid var(--tl-color);
}
.tl-date {
    color: var(--tl-color);
    letter-spacing: .04em;
}
.tl-cat {
    background: var(--tl-color) !important;
    color: #fff;
}

/* Media inside an event --------------------------------------------------- */
.tl-media {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .75rem;
}
.tl-media-item img {
    width: 100%;
    height: auto;
    border-radius: .5rem;
    display: block;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}
.tl-media-pdf {
    grid-column: 1 / -1;         /* PDFs take the full width */
}
.tl-media-pdf object {
    width: 100%;
    height: 560px;
    border: 1px solid var(--tl-rail);
    border-radius: .5rem;
    background: #fff;
}
.tl-pdf-fallback {
    color: #dc3545;
}

/* ==========================================================================
   Scroll-reveal animation
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity .6s cubic-bezier(.2, .7, .2, 1),
                transform .6s cubic-bezier(.2, .7, .2, 1);
    will-change: opacity, transform;
}
.reveal-in {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==========================================================================
   Admin thumbnails
   ========================================================================== */
.tl-thumb {
    width: 96px;
}
.tl-thumb img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: .25rem;
}
.tl-thumb-pdf {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
}

/* Narrow screens: tighten the rail spacing -------------------------------- */
@media (max-width: 576px) {
    .tl-media-pdf object { height: 420px; }
}
