/* Story Stream Timeline Design v2.8 */

.ssb-timeline-container {
    background: var(--ssb-color-bg);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 28px;
    margin: 32px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    font-family: var(--ssb-font-body, sans-serif);
}

.ssb-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.ssb-eyebrow {
    display: block;
    font-family: var(--ssb-font-body, sans-serif);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 4px;
}

.ssb-title {
    font-family: var(--ssb-font-head, serif);
    font-size: 1.25rem;
    color: var(--ssb-color-dark);
    margin: 0 !important;
    line-height: 1.3;
}

.ssb-highlight {
    color: var(--ssb-color-accent);
    font-style: italic;
}

/* Timeline Track */
.ssb-timeline {
    position: relative;
    padding-left: 20px; /* Base padding */
}

/* The vertical line */
.ssb-timeline::before {
    content: '';
    position: absolute;
    /* Starts at the center of the first bead */
    top: 6px; 
    bottom: 0;
    /* CENTER AXIS: 9px
       Line Width: 2px
       Line Left: 8px (8 + 1 = 9)
    */
    left: 8px;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

/* Individual Items */
.ssb-item {
    position: relative;
    padding-left: 12px; /* Gap between bead and text */
    padding-bottom: 20px;
}

.ssb-item:last-child {
    padding-bottom: 0;
}

/* The Bead Marker */
.ssb-marker {
    position: absolute;
    /* HORIZONTAL ALIGNMENT:
       Parent Padding: 20px.
       Desired Absolute Position: 2px (to center bead of 14px on 9px axis).
       Offset = 2px - 20px = -18px.
    */
    left: -18px;
    
    /* VERTICAL ALIGNMENT:
       Date Line Height: ~12-14px.
       Bead Height: 14px.
       Top: -1px centers it perfectly with the text cap-height.
    */
    top: -1px;
    
    width: 14px;
    height: 14px;
    box-sizing: border-box !important;
    
    background: #fff;
    border: 3px solid var(--ssb-color-accent);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 3px #fff; /* White gap around the bead */
}

.ssb-item:hover .ssb-marker {
    background: var(--ssb-color-accent);
    transform: scale(1.15);
    transition: all 0.2s ease;
}

/* Content */
.ssb-date {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
    line-height: 1;
    font-weight: 700;
}

.ssb-link {
    display: block;
    font-family: var(--ssb-font-body, sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ssb-color-dark);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.2s;
}

.ssb-link:hover {
    color: var(--ssb-color-accent);
    text-decoration: underline;
}

/* --- DARK MODE OVERRIDES --- */
html[data-scheme="dark"] .ssb-timeline-container,
body[data-scheme="dark"] .ssb-timeline-container {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: none !important;
}

html[data-scheme="dark"] .ssb-header,
body[data-scheme="dark"] .ssb-header {
    border-bottom-color: #334155 !important;
}

html[data-scheme="dark"] .ssb-title,
body[data-scheme="dark"] .ssb-title {
    color: #f1f5f9 !important;
}

html[data-scheme="dark"] .ssb-eyebrow,
body[data-scheme="dark"] .ssb-eyebrow {
    color: #94a3b8 !important;
}

html[data-scheme="dark"] .ssb-timeline::before,
body[data-scheme="dark"] .ssb-timeline::before {
    background: #334155 !important;
}

html[data-scheme="dark"] .ssb-marker,
body[data-scheme="dark"] .ssb-marker {
    background: #0f172a !important;
    box-shadow: 0 0 0 3px #0f172a !important; /* Dark gap */
}

html[data-scheme="dark"] .ssb-item:hover .ssb-marker,
body[data-scheme="dark"] .ssb-item:hover .ssb-marker {
    background: var(--ssb-color-accent) !important;
}

html[data-scheme="dark"] .ssb-date,
body[data-scheme="dark"] .ssb-date {
    color: #94a3b8 !important;
}

html[data-scheme="dark"] .ssb-link,
body[data-scheme="dark"] .ssb-link {
    color: #e2e8f0 !important;
}

html[data-scheme="dark"] .ssb-link:hover,
body[data-scheme="dark"] .ssb-link:hover {
    color: var(--ssb-color-accent) !important;
}

/* --- SYSTEM AUTOMATIC DARK MODE --- */
@media (prefers-color-scheme: dark) {
    body:not([data-scheme="light"]) .ssb-timeline-container {
        background: #1e293b !important;
        border-color: #334155 !important;
        box-shadow: none !important;
    }

    body:not([data-scheme="light"]) .ssb-header {
        border-bottom-color: #334155 !important;
    }

    body:not([data-scheme="light"]) .ssb-title {
        color: #f1f5f9 !important;
    }

    body:not([data-scheme="light"]) .ssb-eyebrow {
        color: #94a3b8 !important;
    }

    body:not([data-scheme="light"]) .ssb-timeline::before {
        background: #334155 !important;
    }

    body:not([data-scheme="light"]) .ssb-marker {
        background: #0f172a !important;
        box-shadow: 0 0 0 3px #0f172a !important; /* Dark gap */
    }

    body:not([data-scheme="light"]) .ssb-item:hover .ssb-marker {
        background: var(--ssb-color-accent) !important;
    }

    body:not([data-scheme="light"]) .ssb-date {
        color: #94a3b8 !important;
    }

    body:not([data-scheme="light"]) .ssb-link {
        color: #e2e8f0 !important;
    }

    body:not([data-scheme="light"]) .ssb-link:hover {
        color: var(--ssb-color-accent) !important;
    }
}