/*
 * Coding Ireland proprietary interactive activity
 * Copyright (c) 2017-2026 Coding Ireland. All rights reserved.
 * Ref: CI-see-timeline
 *
 * Budget: interactive mode is a FIXED 620px iframe that never resizes, so the
 * tray, the axis and the detail strip together must fit it. Display mode
 * starts at 480 and may grow to a hard cap of 700.
 * Palette + [hidden] fix: ../shared/css/see-activity.css
 */

.tl-container {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.tl-prompt {
    margin: 0;
    padding: .45rem .8rem;
    border-radius: 10px;
    background: var(--see-subtle);
    border: 1px solid var(--see-bright);
    color: var(--see-ink);
    font-weight: 700;
    font-size: 1rem;
}

/* ------------------------------------------------------------------ stage */
.tl-stage {
    position: relative;
    width: 100%;
    min-height: 190px;
    border-radius: 12px;
    background: #fff;
    border: 2px solid var(--maths-border);
    overflow: hidden;
}

.tl-stage.tl-over { border-color: var(--see-accent); background: var(--see-subtle); }

.tl-axis { display: block; }

.tl-axis-line {
    stroke: var(--see-ink);
    stroke-width: 3;
    stroke-linecap: round;
}

.tl-tick { stroke: var(--maths-grid-line); stroke-width: 2; }

.tl-tick-label {
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 700;
    fill: var(--maths-ink-muted);
    text-anchor: middle;
}

/* the change-or-continuity overlay: the beat this interactive exists for */
.tl-compare-band { fill: var(--see-soft); }
.tl-compare-edge { stroke: var(--see-accent); stroke-width: 2; stroke-dasharray: 5 4; }

.tl-gap-line {
    stroke: var(--see-bright);
    stroke-width: 2;
    marker-start: none;
}

.tl-gap-label {
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 800;
    fill: var(--see-accent);
    text-anchor: middle;
}

/* --------------------------------------------------------- placed events */
.tl-placed {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tl-pin {
    position: absolute;
    top: 82px;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: var(--see-accent);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--see-accent);
}

.tl-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    padding: .3rem .5rem;
    border-radius: 10px;
    border: 2px solid var(--maths-border);
    border-top: 5px solid var(--see-accent);
    background: #fff;
    font-family: 'Nunito', sans-serif;
    max-width: 160px;
    text-align: center;
}

.tl-card-placed {
    position: absolute;
    transform: translateX(-50%);
    pointer-events: auto;
    cursor: pointer;
    max-width: 132px;
}

.tl-card-placed.tl-above { top: 4px; }
.tl-card-placed.tl-below { top: 118px; }

.tl-card-label {
    font-weight: 800;
    font-size: .86rem;
    line-height: 1.15;
    color: var(--maths-ink);
}

.tl-card-year {
    font-weight: 700;
    font-size: .78rem;
    color: var(--see-accent);
}

.tl-card-img {
    width: 100%;
    max-height: 34px;
    object-fit: cover;
    border-radius: 5px;
}

/* Dropped off the mark: a faint leader to where it belongs. Never a tick or a
 * cross — nothing here is marked, and the axis is the feedback. */
.tl-leader {
    position: absolute;
    height: 0;
    border-top: 2px dotted var(--see-bright);
}

.tl-leader-above { top: 62px; }
.tl-leader-below { top: 112px; }

/* ------------------------------------------------------------------ tray */
.tl-tray-wrap {
    border-top: 1px dashed var(--maths-border);
    padding-top: .35rem;
}

.tl-tray-label {
    font-weight: 800;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--maths-ink-muted);
    margin-bottom: .25rem;
}

.tl-tray {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    min-height: 56px;
}

.tl-card-tray {
    min-height: 54px;
    justify-content: center;
    cursor: grab;
    touch-action: none;
}

.tl-dragging { opacity: .35; }

/* ---------------------------------------------------------------- detail */
.tl-detail {
    padding: .4rem .7rem;
    border-radius: 9px;
    background: var(--maths-surface-alt);
    color: var(--maths-ink);
    font-size: .93rem;
    line-height: 1.3;
}

.tl-offaxis {
    position: absolute;
    right: 8px;
    bottom: 6px;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: var(--maths-surface-alt);
    color: var(--maths-ink-muted);
    font-size: .76rem;
    font-weight: 700;
    pointer-events: none;
}

.tl-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1.2rem;
    color: var(--maths-ink-muted);
}

/* ----------------------------------------------------------- display mode
 * The header, and with it Reset and Fullscreen, is hidden by the shared rules.
 * Nothing in display mode may need a teacher to press anything. */
body.display-mode .tl-tray-wrap { display: none !important; }

body.display-mode .tl-container { gap: .3rem; }

body.display-mode .tl-card-label { font-size: .95rem; }
body.display-mode .tl-card-year { font-size: .85rem; }
body.display-mode .tl-tick-label { font-size: 13px; }

body.display-mode .tl-prompt {
    text-align: center;
    font-size: 1.05rem;
}

@media (max-width: 560px) {
    .tl-card-placed { max-width: 104px; }
    .tl-card-label { font-size: .78rem; }
}
