/* =============================================================
   Fire History Timeline
   ============================================================= */

/* CTA scroll button — pulse to invite interaction, hidden while frame is active */
@keyframes fh-cta-pulse {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(8px); }
}

#button-cta-scroll {
    animation: fh-cta-pulse 1.5s ease-in-out infinite;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#button-cta-scroll:hover {
    animation-play-state: paused;
}

#button-cta-scroll.is-hidden {
    animation: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Stage — only scroll spacers, no visual content */
.fh-stage {
    position: relative;
}

/* .fh-scroll-spacer — height set inline via JS, no other styles needed */

/* ── Fixed frame — shown while stage is active ───────────────── */

.fh-frame {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(100vh / 3.4);
    z-index: 100;
    visibility: hidden; /* initial hide — opacity, transform and visibility managed by GSAP */
}

/* .fh-frame.is-visible — state class only, visual state managed by GSAP */

/* ── Timeline viewport — fills the frame ────────────────────── */

.fh-timeline-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border: 2px solid #ffffff;
    background: #ffffff;
    margin: 0 var(--space-l) var(--space-l);
    border-radius: 20px;
    box-shadow: 0 0 20px 0px #e4b54854;
}

/* Center arrow — marks the current time position */
.fh-timeline-arrow {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    color: var(--primary);
    line-height: 0;
}

.fh-timeline-arrow svg {
    display: block;
    width: 14px;
    height: 14px;
}

/* Scrolling strip */
.fh-timeline-strip {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    will-change: transform;
}

/* Date labels */
.fh-date-labels {
    position: relative;
    height: 38px;
    padding-top: 16px; /* leave room for the arrow */
}

.fh-date-label {
    position: absolute;
    bottom: -1px;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background-color: #777;
    white-space: nowrap;
    letter-spacing: 0;
    text-transform: uppercase;
    padding: 2px 10px;
}

/* Ruler */
.fh-ruler {
    height: 22px;
    /* background-image set via JS */
}

/* Event rows */
.fh-event-rows {
    position: relative;
    padding-top: 8px;
    /* background set dynamically by JS to match ruler tick spacing */
    /* height set dynamically by JS based on max coexisting events */
}

.fh-event-row {
    position: absolute;
    height: 26px;
    width: 100%;
    pointer-events: none;
}

/* Orange event line — sits below the label text */
.fh-event-line {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--primary);
}

/* ── Event main image — white radial gradient behind multiply image ── */

div:has(> .fh-event-main-image) {
    position: relative;
}

div:has(> .fh-event-main-image)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 100%;
    aspect-ratio: 3 / 2;
    background: radial-gradient(ellipse at center,
        #ffffff       0%,
        rgba(255,255,255,0.9) 25%,
        rgba(255,255,255,0.7) 40%,
        rgba(255,255,255,0.35) 50%,
        rgba(255,255,255,0.1) 60%,
        transparent   70%
    );
    pointer-events: none;
    z-index: 0;
    transform: scale(1.5);
}

.fh-event-main-image {
    position: relative;
    z-index: 1;
}

/* Period wrapper — hidden until JS triggers split-flap animation */
.fh-event-period-wrapper {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fh-event-period-wrapper.is-visible {
    opacity: 1;
}

/* Event label — pinned/faded via JS, no CSS transition */
.fh-event-label {
    display: block;
    position: absolute;
    top: 0;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 20px;
    line-height: 26px;
    height: 26px;
    color: var(--color-text);
    white-space: nowrap;
    pointer-events: auto;
    text-decoration: none;
    cursor: pointer;
}

.fh-event-label:hover {
    color: var(--primary);
}

/* Mobile header — only visible on mobile */
.fh-mobile-header {
    display: none;
}

@media (max-width: 768px) {
    .fh-frame {
        background: var(--secondary-darkest);
        display: flex;
        flex-direction: column;
        width: 100vw;
        overflow: hidden;
        height: calc(100vh / 4 + 42px);
    }

    .fh-timeline-viewport {
        position: relative;
        inset: auto;
        flex: 1;
        min-height: 0;
        margin: 0 var(--space-xs) var(--space-xs);
    }

    .fh-mobile-header {
        display: block;
        text-align: center;
        flex-shrink: 0;
        padding: 10px var(--space-s);
    }

    .fh-event-row {
        height: 20px;
    }

    .fh-event-label {
        font-size: 16px;
        line-height: 20px;
        height: 20px;
    }

    .fh-mobile-header h5 {
        color: var(--neutral-40);
        margin: 0;
    }
}

.fh-rotate-overlay {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: calc(100vh / 4 + 42px);
    background: var(--secondary-darkest);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 100;
}

.fh-rotate-overlay__icon {
    color: var(--neutral-40);
    width: 40px;
    height: 40px;
}

.fh-rotate-overlay__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.fh-rotate-overlay p {
    color: var(--neutral-40);
    font-family: var(--gp-font--headings);
    font-size: 1rem;
    margin: 0;
    text-align: center;
    padding: 0 var(--space-s);
}

/* ── Landscape mobile — hide frame, show rotate overlay ───────────────── */

@media (orientation: landscape) and (max-height: 500px) {
    .fh-frame {
        display: none;
    }

    .fh-rotate-overlay {
        display: flex;
    }
}

/* Event text paragraphs — fire icon bullet via ::before */
.fh-event-texts-div p::before {
    content: '';
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='%23e84610' d='M192 0C79.7 101.3 0 220.9 0 300.5 0 425 79 512 192 512s192-87 192-211.5c0-79.9-80.2-199.6-192-300.5zm0 448c-56.5 0-96-39-96-94.8 0-13.5 4.6-61.5 96-161.2 91.4 99.7 96 147.7 96 161.2 0 55.8-39.5 94.8-96 94.8z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: -0.1em;
    margin-right: 0.4em;
}
