@font-face {
    font-family: "metropolis-semibold";
    src: url("/fonts/metropolis.semi-bold.otf");
}

.harlow {
    font-family: "metropolis-semibold";
}

:root {
    --primary-color: #FF8000;
    --accent-purple: #4F46E5;
    --bg-dark: #002F5E;
    --bg-secondary: #16143F;
    --bg-light-blob: #2d2055;
    --text-color: #ffffff;
    --text-color-dark: #333333;
    --card-bg: #ffffff;
}

.template-historia {
    font-family: "metropolis-regular", sans-serif;
    background-color: #16143F;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: 0px;
    font-size: 16px;
}


/* Main Title Section */
.main-header {
    text-align: center;
    margin-top: 90px;
    margin-bottom: 50px;
    padding: 0 20px;
    background: transparent;
    animation: fadeInDown 0.8s ease;
}

.main-header h1 {
    font-size: 40px;
    color: #FF8000;
    margin-bottom: 20px;
    font-weight: 700;
    font-family: "metropolis-semibold", sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-header p {
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.5;
    text-align: center;
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    transition: padding-right 0.3s ease;
}

.timeline-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.timeline-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.column {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.center-line {
    flex: 0 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 300px;
}

/* The vertical line itself */
.line {
    width: 2px;
    background-color: rgba(255, 255, 255, 0.3);
    flex-grow: 1;
}

/* Hide top line of first item and bottom line of last item */
.timeline-container>.timeline-row:first-child .center-line .line:first-child {
    visibility: hidden;
}

.timeline-container>.timeline-row:last-child .center-line .line:last-child {
    visibility: hidden;
}

.dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 10px solid var(--primary-color);
    margin: 5px 0;
    z-index: 2;
    align-self: center;
}

/* Content Text Box */
.content-text {
    padding: 30px;
    background-color: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-self: center;
    gap: 15px;
    color: white;
    box-shadow: none;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.content-image {
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.content-image img {
    width: 100%;
    max-width: 500px;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    transition: transform 0.3s ease;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: subpixel-antialiased;
}

.image-wrapper:hover {
    transform: scale(1.02) translateZ(0);
}

.image-year-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background-color: var(--primary-color);
    border-radius: 0 12px 0 100%;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding-top: 15px;
    padding-right: 15px;
    color: var(--bg-secondary);
    font-weight: 700;
    font-size: 18px;
    pointer-events: none;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Mirror badge for images on the right side (Badge goes to Left) */
.content-image.right-align .image-year-badge {
    right: auto;
    left: 0;
    border-radius: 12px 0 100% 0;
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 15px;
}

.title-badge {
    background-color: #FF8000;
    color: #002F5E;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-container {
    display: flex;
    align-items: center;
    gap: 15px;
    align-self: flex-start;
}

h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

.content-text p {
    font-size: 17px;
    color: #e0e0e0;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Alignment */
.left-align {
    text-align: left;
}

.right-align {
    text-align: left;
}

/* Responsive */
@media screen and (max-width: 1024px) {
    body .main-header {
        margin-top: 10px;
    }

    .main-header h1 {
        padding-top: 90px;
    }
}

@media screen and (max-width: 900px) {

    /* Timeline Responsive */
    .timeline-container {
        padding: 20px;
    }

    .timeline-row {
        flex-direction: column;
        margin-bottom: 60px;
        padding-bottom: 0;
        align-items: center;
    }

    /* Fix stacking order for even rows to be Text-Image */
    .timeline-row:nth-child(even) {
        flex-direction: column-reverse;
    }

    .center-line {
        display: none;
    }

    .column {
        width: 100%;
        flex: auto;
    }

    .content-text,
    .content-image {
        padding: 0 0 20px 0;
        align-self: center;
        text-align: center;
        align-items: center;
    }

    .badge-container {
        align-self: center;
        margin-bottom: 15px;
    }

    h3,
    .content-text p {
        text-align: center;
    }

    img {
        max-width: 100%;
    }
}

.historia-image-zoomable {
    cursor: zoom-in;
}

.historia-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
    padding: 24px;
}

.historia-lightbox[hidden] {
    display: none;
}

.historia-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.historia-lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
}
