/* Timeline Slider Styles based on Devouring Details */
.timeline-section {
    position: relative;
    height: 90vh;
    min-height: 650px;
    background-color: #f4f4f4;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    font-family: 'Times New Roman', Times, serif;
}

/* Horizontal orange line */
.timeline-orange-line {
    position: fixed;
    top: 0;
    /* JS Will control this */
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #ff5722;
    z-index: 9999;
    pointer-events: none;
    /* Remove transition to allow tight 1:1 scroll tracking */
}

/* Left vertical ruler (Leveling Staff / Mira Topográfica Style) */
.timeline-ruler {
    position: fixed;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 65px;
    background-color: #fff;
    border: 2px solid #000;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 989;
    pointer-events: auto;
    /* changed from none so it detects hover */
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    opacity: 0.35;
    transition: opacity 0.3s ease;
}

.timeline-ruler:hover {
    opacity: 1;
}

.staff-decimeter {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* distributes evenly */
    border-bottom: 2px solid #000;
    box-sizing: border-box;
    background-color: #fff;
}

.staff-half-decimeter {
    display: flex;
    flex: 1;
    box-sizing: border-box;
}

.staff-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

.staff-col:first-child {
    border-right: 2px solid #000;
}

.staff-e {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #e60000;
}

.staff-gap {
    flex: 1;
    background-color: #fff;
}

.staff-solid {
    flex: 1;
    background-color: transparent;
}

.e-right .staff-gap {
    width: 80%;
    margin-left: 20%;
}

.e-left .staff-gap {
    width: 80%;
    margin-right: 20%;
}

.staff-number-cell {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    /* Matches main page typography */
    font-size: 2rem;
    font-weight: 800;
    /* Outfit is better bolder */
    color: #000;
    background-color: #fff;
    /* Compress text slightly for realistic look */
    transform: scaleX(0.85);
}

/* Action Button */
.timeline-action {
    position: fixed;
    right: 0;
    top: 0;
    /* JS Will control this */
    transform: translateY(-50%);
    background-color: #ff5722;
    z-index: 9999;
    padding: 0;
}

.btn-relevamientos {
    display: block;
    background-color: #ff5722;
    color: #fff;
    padding: 8px 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-relevamientos:hover {
    background-color: #e64a19;
    color: #fff;
}

/* Timeline Wheel (Compass Style) */
.timeline-wheel {
    position: relative;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    background: transparent;
}

/* Detailed compass bezel SVG overlay */
.compass-bezel-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.timeline-wheel::before {
    display: none;
}

.timeline-wheel:active {
    cursor: grabbing;
}

/* Compass Cardinals */
.compass-cardinal {
    position: absolute;
    font-weight: 800;
    font-size: 1.1rem;
    color: #2d3748;
    z-index: 6;
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.compass-cardinal::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    margin: 4px;
}

/* Main cardinals */
.cardinal-n {
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: #e53e3e;
    font-size: 1.4rem;
}

.cardinal-n::before {
    border-width: 0 7px 12px 7px;
    border-color: transparent transparent #e53e3e transparent;
    margin-bottom: 2px;
}

.cardinal-s {
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column-reverse;
    font-size: 1.4rem;
}

.cardinal-s::before {
    border-width: 12px 7px 0 7px;
    border-color: #2d3748 transparent transparent transparent;
    margin-top: 2px;
}

.cardinal-e {
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: row-reverse;
    font-size: 1.4rem;
}

.cardinal-e::before {
    border-width: 7px 0 7px 12px;
    border-color: transparent transparent transparent #2d3748;
    margin-left: 2px;
}

.cardinal-w {
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: row;
    font-size: 1.4rem;
}

.cardinal-w::before {
    border-width: 7px 12px 7px 0;
    border-color: transparent #2d3748 transparent transparent;
    margin-right: 2px;
}

/* Intercardinal labels */
.cardinal-ne {
    top: 13%;
    right: 13%;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
}

.cardinal-nw {
    top: 13%;
    left: 13%;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
}

.cardinal-se {
    bottom: 13%;
    right: 13%;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
}

.cardinal-sw {
    bottom: 13%;
    left: 13%;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
}

.wheel-center {
    width: 100px;
    height: 100px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), inset 0 3px 6px rgba(255, 255, 255, 1), inset 0 -3px 6px rgba(0, 0, 0, 0.12);
    border: 4px solid #d0d0d0;
    position: relative;
    background-image: radial-gradient(circle at 35% 30%, #fff 30%, #dde1e7 100%);
}

.wheel-center::before {
    /* Center pivot pin */
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 30% 30%, #e2e8f0, #94a3b8);
    border-radius: 50%;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.wheel-center::after {
    display: none;
}

/* Custom needle/rotation indicator inside the center */
.compass-needle {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15;
    transition: transform 0.1s ease-out;
}

/* Red (north) point of needle */
.compass-needle::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 38px solid #e53e3e;
    filter: drop-shadow(0 3px 4px rgba(229, 62, 62, 0.4));
}

/* Blue (south) tail of needle */
.compass-needle::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 38px solid #3182ce;
    filter: drop-shadow(0 -3px 4px rgba(49, 130, 206, 0.35));
}

.wheel-ticks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform-origin: center center;
    z-index: 4;
}

.wheel-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 580px;
    /* Wide enough for labels at 340px offset + text width */
    height: 1px;
    transform-origin: 0 0;
    display: flex;
    align-items: center;
}

.wheel-tick-line {
    width: 10px;
    height: 1px;
    background-color: #ccc;
    margin-left: auto;
    /* Push line to the outer edge of radius */
    transition: background-color 0.3s, width 0.3s;
}

.wheel-item.milestone-item .wheel-tick-line {
    background-color: #888;
    width: 25px;
}

/* Small orange dot at the milestone tick, visible inside compass */
.wheel-tick-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #e53e3e;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 6px;
    opacity: 0.5;
    transition: opacity 0.4s, transform 0.4s;
    transform: scale(1);
}

.wheel-item.active .wheel-tick-dot {
    opacity: 1;
    background-color: #e53e3e;
    transform: scale(1.5);
    box-shadow: 0 0 6px rgba(229, 62, 62, 0.6);
}

.wheel-tick-text {
    position: absolute;
    color: #555;
    font-size: 0.82rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-align: left;
    line-height: 1.3;
    max-width: 220px;
    pointer-events: none;
}

/* Title and year typography */
.wtitle {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1a202c;
}

.wyear {
    font-style: italic;
    color: #e53e3e;
    font-size: 0.78rem;
}

.wheel-tick-desc {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    font-style: normal;
    line-height: 1.4;
    margin-top: 3px;
    max-width: 200px;
    white-space: normal;
    opacity: 0;
    transition: opacity 0.6s ease 0.15s;
}

.wheel-item.milestone-item .wheel-tick-text {
    opacity: 0.6;
}

.wheel-item.active .wheel-tick-text {
    opacity: 1;
    color: #1a202c;
}

.wheel-item.active .wheel-tick-desc {
    opacity: 1;
}

.wheel-item.active .wheel-tick-line {
    background-color: #e53e3e;
    width: 30px;
}

/* External orbiting milestone labels */
.outer-milestone-label {
    position: absolute;
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
    line-height: 1.35;
    text-align: center;
    opacity: 0.55;
    transition: opacity 0.4s ease;
    z-index: 5;
    max-width: 180px;
}

.outer-milestone-label .wheel-tick-desc {
    display: none;
    /* desc only shown when active */
    font-size: 0.68rem;
    color: #64748b;
    white-space: normal;
    margin-top: 2px;
}

.outer-milestone-label.active {
    opacity: 1;
}

.outer-milestone-label.active .wheel-tick-desc {
    display: block;
}

@media (max-width: 768px) {
    .timeline-wheel {
        transform: scale(0.45);
        margin-left: 0;
    }

    .timeline-ruler {
        width: 35px;
        left: 0;
        opacity: 0.25;
    }

    .timeline-ruler:hover,
    .timeline-ruler:active {
        opacity: 0.85;
    }

    .staff-number-cell {
        font-size: 1.2rem;
    }

    .timeline-action {
        display: none !important;
    }

    .timeline-orange-line {
        display: none;
    }

    .wheel-tick-text {
        font-size: 1.6rem;
        /* Bigger unscaled text so it stays readable when scaled by 0.5 */
    }

    .compass-cardinal {
        font-size: 1.8rem;
    }

    .outer-milestone-label {
        max-width: 100px;
    }

    .wtitle {
        font-size: 0.75rem;
    }

    .wyear {
        font-size: 0.65rem;
    }

    .outer-milestone-label .wheel-tick-desc {
        font-size: 0.55rem;
    }
}