/* Timeline Page Styles
   Restyled 30 Sep 2026 to sit with the rest of the site (the Ship Codex /
   Supply Chain cards): same alternating layout down a centre line, but each
   event is a site card - dark panel, thin border, the date as a small
   highlight-coloured label, glow on hover. Events come from the
   timeline_events table (scripts/site_pages_lib.php); SuperAdmins get
   Edit / Remove on each one and "Add a timeline event" underneath. */

.timeline-wrapper {
    max-width: 1150px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
}

.tl-heading {
    margin-left: auto;
    margin-right: auto;
}

/* The actual timeline (the vertical ruler) */
.timeline {
    position: relative;
    margin: 1.5rem auto;
    padding: 0.5rem 0;
}

/* The centre line */
.timeline::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 3px;
    background: linear-gradient(to bottom, transparent, var(--highlight-colour) 3%, var(--highlight-colour) 97%, transparent);
    box-shadow: 0 0 8px var(--glow-colour);
}

/* One event */
.timeline-container {
    position: relative;
    width: 50%;
    padding: 0.6rem 2.4rem;
    box-sizing: border-box;
    background-color: inherit;
}

/* The dot on the line */
.timeline-container::after {
    content: '';
    position: absolute;
    top: 1.55rem;
    right: -10px;
    width: 20px;
    height: 20px;
    box-sizing: border-box;
    background: var(--background-dark);
    border: 3px solid var(--highlight-colour);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--glow-colour);
    z-index: 1;
}

.timeline-left {
    left: 0;
}

.timeline-right {
    left: 50%;
}

.timeline-right::after {
    left: -10px;
}

/* The small pointer from the card to the line */
.timeline-left::before,
.timeline-right::before {
    content: " ";
    position: absolute;
    top: 1.65rem;
    width: 0;
    height: 0;
    z-index: 1;
    border: medium solid;
}

.timeline-left::before {
    right: 1.85rem;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent var(--highlight-colour);
}

.timeline-right::before {
    left: 1.85rem;
    border-width: 8px 8px 8px 0;
    border-color: transparent var(--highlight-colour) transparent transparent;
}

/* The card */
.timeline-content {
    position: relative;
    padding: 1rem 1.2rem;
    text-align: left;
    background: var(--background-mid);
    border: 1px solid var(--border-colour);
    border-radius: var(--radius1);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.timeline-left .timeline-content {
    border-right: 3px solid var(--highlight-colour);
}

.timeline-right .timeline-content {
    border-left: 3px solid var(--highlight-colour);
}

.timeline-content:hover {
    border-color: var(--highlight-colour);
    box-shadow: 0 0 12px var(--glow-colour);
}

.timeline-content h2.tl-date {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.45rem;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-align: left;
    color: var(--highlight-colour);
}

.timeline-content p.tl-body {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.55;
    text-align: left;
    color: #fff;
    overflow-wrap: anywhere;
}

/* Still to come: dashed card, a filled dot and an "Upcoming" tag */
.timeline-container.is-upcoming .timeline-content {
    border-style: dashed;
}

.timeline-container.is-upcoming::after {
    background: var(--highlight-colour);
}

.tl-upcoming {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--highlight-colour);
    border-radius: 99px;
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.tl-empty {
    text-align: center;
}

/* SuperAdmin tools */
.tl-admin {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border-colour);
}

.tl-add {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 1rem;
}

.tl-add p {
    max-width: 40rem;
    text-align: center;
}

.timeline-container.is-new .timeline-content {
    border-color: var(--highlight-colour);
    box-shadow: 0 0 16px var(--glow-colour);
}

/* Phones and small tablets: the line on the left, every card to its right */
@media screen and (max-width: 768px) {
    .timeline::after {
        left: 20px;
    }

    .timeline-container {
        width: 100%;
        padding-left: 50px;
        padding-right: 0.25rem;
    }

    .timeline-right {
        left: 0;
    }

    .timeline-left::after,
    .timeline-right::after {
        left: 10px;
        right: auto;
    }

    .timeline-left::before,
    .timeline-right::before {
        left: 42px;
        right: auto;
        border-width: 8px 8px 8px 0;
        border-color: transparent var(--highlight-colour) transparent transparent;
    }

    .timeline-left .timeline-content {
        border-right-width: 1px;
        border-right-color: var(--border-colour);
        border-left: 3px solid var(--highlight-colour);
    }
}
