/* Timeline Scale Styles */
.ts-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0;
}

.ts-wrapper {
    position: relative;
    /* min-height set dynamically inline */
    margin: 0 auto;
    padding: 2rem 0;
}

/* Timeline scale box - tall narrow box with border */
.ts-scale-box {
    position: absolute;
    left: 50%;
    top: 0;
    width: 50px;
    /* height set dynamically inline */
    background: var(--wp--preset--color--accent-6, #f0f0f0);
    border: 1px solid var(--wp--preset--color--accent-2, #669bbc);
    transform: translateX(-50%);
    z-index: 1;
}

/* Decorative element at bottom of scale */
.ts-scale-decorative {
    position: absolute;
    left: 50%;
    width: 50px;
    background: var(--wp--preset--color--accent-6, #f0f0f0);
    border-left: 1px solid var(--wp--preset--color--accent-2, #669bbc);
    border-right: 1px solid var(--wp--preset--color--accent-2, #669bbc);
    transform: translateX(-50%);
    z-index: 1;
    overflow: visible;
}

.ts-decorative-marker {
    position: absolute;
    left: 0;
    width: 20%;
    height: 1px;
    background: var(--wp--preset--color--accent-2, #669bbc);
    opacity: 0.3;
}

/* Decade sections */
.ts-decade-section {
    position: absolute;
    left: 0;
    width: 100%;
    height: 120px;
}

/* Decade years inside the box */
.ts-decade-year {
    position: absolute;
    /* top: 5px; */
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--wp--preset--color--contrast, #333);
    line-height: 1;
}

/* Decade horizontal marker lines (full width) */
.ts-decade-line {
    position: absolute;
    /* top: 20px; */
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--wp--preset--color--accent-2, #669bbc);
    opacity: 0.6;
}

/* Individual year markers (25% width, left-aligned) */
.ts-year-line {
    position: absolute;
    left: 0;
    width: 25%;
    height: 1px;
    background: var(--wp--preset--color--accent-2, #669bbc);
    opacity: 0.3;
}

/* Riot items - wider, less vertical space */
.ts-riot-item {
    position: absolute;
    width: 400px;
    z-index: 3;
    transition: z-index 0s;
}

.ts-riot-item:hover,
.ts-riot-item.ts-active,
.ts-riot-item.ts-pinned {
    z-index: 100;
}

/* Pin icon */
.ts-pin-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    color: var(--wp--preset--color--accent-1, #780000);
    fill: none;
    z-index: 10;
    transition: transform 0.2s ease, color 0.2s ease, fill 0.2s ease;
}

.ts-pin-icon:hover {
    transform: scale(1.2);
}

.ts-pin-icon:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.ts-riot-item.ts-active .ts-pin-icon,
.ts-riot-item.ts-pinned .ts-pin-icon {
    color: var(--wp--preset--color--accent-2, #669bbc);
    fill: var(--wp--preset--color--accent-2, #669bbc);
}

.ts-riot-item.ts-riot-left {
    right: calc(50% + 55px); /* 25px to scale edge + 30px white space */
}

.ts-riot-item.ts-riot-right {
    left: calc(50% + 55px); /* 25px to scale edge + 30px white space */
}

/* Connector lines - now SVG, positioned inline */
.ts-riot-connector {
    z-index: 2;
    pointer-events: none;
}

.ts-riot-connector polyline {
    stroke: var(--wp--preset--color--accent-2, #669bbc);
    stroke-width: 1;
    transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.ts-riot-item.ts-active .ts-riot-connector polyline,
.ts-riot-item.ts-pinned .ts-riot-connector polyline {
    stroke: var(--wp--preset--color--accent-1, #c1121f);
    stroke-width: 2;
}

/* Riot content boxes - simplified borders and padding */
.ts-riot-content {
    background: var(--wp--preset--color--accent-3);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ts-riot-content:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.ts-riot-title {
    margin: 0 0 0.5rem 0;
    font-size: var(--wp--preset--font-size--small);
    line-height: 1.3;
    color: var(--wp--preset--color--contrast, #000);
}

.ts-riot-title .ts-riot-year {
    color: var(--wp--preset--color--contrast, #000);
    font-weight: 400;
    font-size: inherit;
}

.ts-riot-title a {
    color: var(--wp--preset--color--accent-1, #780000);
    text-decoration: none;
    flex: 1;
}

.ts-riot-title a:hover {
    text-decoration: underline;
}

.ts-riot-location {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--contrast);
    margin-top: 0.25rem;
    line-height: 1.2;
}

.ts-riot-researchers {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--contrast);
    margin-top: 0.25rem;
    line-height: 1.1;
}

.ts-riot-researchers a {
    color: var(--wp--preset--color--accent-1, #780000);
    text-decoration: none;
}

.ts-riot-researchers a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .ts-wrapper {
        padding: 1rem 0;
    }
    
    .ts-riot-item {
        width: 250px;
    }
    
    .ts-riot-item.ts-riot-left {
        right: calc(50% + 55px);
    }
    
    .ts-riot-item.ts-riot-right {
        left: calc(50% + 55px);
    }
}

@media (max-width: 480px) {
    .ts-container {
        padding: 1rem;
    }
    
    .ts-riot-item {
        width: 200px;
    }
    
    .ts-riot-item.ts-riot-left {
        right: calc(50% + 45px); /* 25px to scale edge + 20px white space */
    }
    
    .ts-riot-item.ts-riot-right {
        left: calc(50% + 45px); /* 25px to scale edge + 20px white space */
    }
    
    .ts-riot-content {
        padding: 0.75rem;
    }
    
    .ts-decade-year {
        font-size: 0.7rem;
        padding: 1px 4px;
        min-width: 35px;
    }
}
