/* ========================================
   Components - Timeline, Cards, Reusables
   ======================================== */

/* --- Timeline --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-md) 0;
}

.timeline__line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(51, 255, 102, 0.3) 10%,
        rgba(51, 255, 102, 0.3) 90%,
        transparent 100%
    );
    transform: translateX(-50%);
}

.timeline__item {
    position: relative;
    width: 50%;
    padding: var(--space-sm);
    margin-bottom: var(--space-md);
}

.timeline__item--left {
    padding-right: var(--space-lg);
    text-align: center;
}

.timeline__item--right {
    margin-left: 50%;
    padding-left: var(--space-lg);
    text-align: center;
}

/* Timeline dot on the line */
.timeline__item::before {
    content: '';
    position: absolute;
    top: var(--space-md);
    width: 10px;
    height: 10px;
    background: var(--verde-fosforo);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(51, 255, 102, 0.5);
    z-index: 1;
}

.timeline__item--left::before {
    right: -5px;
}

.timeline__item--right::before {
    left: -5px;
}

.timeline__card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(51, 255, 102, 0.1);
    border-radius: 8px;
    padding: var(--space-md);
    transition: border-color 0.3s, transform 0.3s;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

.timeline__card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 0;
    transition: background 0.3s;
}

.timeline__card:hover::after {
    background: rgba(0, 0, 0, 0.55);
}

.timeline__card > * {
    position: relative;
    z-index: 1;
}

/* --- Curiosidades card backgrounds --- */
.timeline__item:nth-of-type(1) .timeline__card {
    background-image: url('../assets/images/curiosidades/spain-population.jpg');
}
.timeline__item:nth-of-type(2) .timeline__card {
    background-image: url('../assets/images/curiosidades/old-computer.jpg');
}
.timeline__item:nth-of-type(3) .timeline__card {
    background-image: url('../assets/images/curiosidades/old-tv.jpg');
}
.timeline__item:nth-of-type(4) .timeline__card {
    background-image: url('../assets/images/curiosidades/pesetas.jpg');
}
.timeline__item:nth-of-type(5) .timeline__card {
    background-image: url('../assets/images/curiosidades/google.png');
}
.timeline__item:nth-of-type(6) .timeline__card {
    background-image: url('../assets/images/curiosidades/furby.jpg');
}
.timeline__item:nth-of-type(7) .timeline__card {
    background-image: url('../assets/images/curiosidades/imac-g3.jpg');
}
.timeline__item:nth-of-type(8) .timeline__card {
    background-image: url('../assets/images/curiosidades/madrid.jpg');
}
.timeline__item:nth-of-type(9) .timeline__card {
    background-image: url('../assets/images/curiosidades/nokia.jpg');
}

.timeline__card:hover {
    border-color: rgba(51, 255, 102, 0.3);
    transform: translateY(-2px);
}

.timeline__icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: var(--space-xs);
}

.timeline__card h3 {
    font-family: var(--font-vcr);
    font-size: 1.2rem;
    color: var(--verde-fosforo);
    margin-bottom: var(--space-xs);
}

.timeline__card p {
    color: var(--gris-estatica);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- Mobile Timeline (single column) --- */
@media (max-width: 767px) {
    .timeline__line {
        left: 20px;
    }

    .timeline__item,
    .timeline__item--left,
    .timeline__item--right {
        width: 100%;
        margin-left: 0;
        padding-left: 50px;
        padding-right: 0;
        text-align: center;
    }

    .timeline__item--left::before,
    .timeline__item--right::before {
        left: 15px;
        right: auto;
    }
}
