/* Story timeline on the public Episodes page (missions/partials/timeline*), from the Spectre package
   (public/css/spectre/components.css). Colours come from the theme tokens in css/ragnarok/shadow.css. */
.story-tl-switch {
    display: inline-flex;
    gap: 2px;
    margin: 0 0 1.1rem;
    padding: 3px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-line);
    border-radius: 999px;
}
.story-tl-switch a {
    padding: 4px 16px;
    font-family: var(--sp-font-display);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--sp-text-dim);
    border-radius: 999px;
}
.story-tl-switch a:hover { color: var(--pp-lt); }
.story-tl-switch a.is-active { color: var(--pp-ink); background: var(--pp); }

.story-tl-season { margin-top: 0.6em; }
/* Season markers sit ON the one date-ordered line (missions/partials/timeline-mark): the spine runs on past
   them (no block over it, so no colour clash in any theme) and a diamond on the spine marks where each run starts.
   A season seen again ("continued") or episodes in no season after a season's run get a quiet marker. */
.story-tl > .story-tl__mark { position: relative; list-style: none; margin: 6px 0 14px; padding: 0; background: none; display: flow-root; }
.story-tl > .story-tl__mark::before { content: ''; position: absolute; top: 1.05em; left: calc(var(--story-tl-spine) + 1px - var(--story-tl-indent) - 6px); width: 12px; height: 12px; transform: rotate(45deg); background: var(--sp-text-hi); box-shadow: 0 0 0 3px var(--sp-bg); }
.story-tl > .story-tl__mark--continued::before, .story-tl > .story-tl__mark--none::before { top: 0.55em; left: calc(var(--story-tl-spine) + 1px - var(--story-tl-indent) - 4px); width: 8px; height: 8px; background: var(--sp-text-dim); }
.story-tl > .story-tl__mark + .story-tl__mark { margin-top: 0; }
@media (max-width: 640px) { .story-tl > .story-tl__mark { padding-left: 6px; } }   /* phones: the narrower indent, clear of the diamond */
.story-tl-season--minor { margin: 0.2em 0 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sp-text-dim); }
.story-tl-season__cont { font-weight: 400; letter-spacing: 0.06em; text-transform: none; font-style: italic; }
.story-tl-season__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: -0.2em 0 0.6em; font-size: 0.86rem; color: var(--sp-text-dim); }
.story-tl-season__meta strong { font-family: var(--sp-font-mono); color: var(--sp-text-hi); }

.story-tl {
    --story-tl-indent: 30px;
    --story-tl-spine: 9px;              /* left edge of the 2px spine */
    position: relative;
    margin: 0;
    padding: 6px 0 2px var(--story-tl-indent);
    list-style: none;
}
.story-tl::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--story-tl-spine);
    border-left: 2px solid var(--sp-line-strong);
}
.story-tl--nested { margin-top: 12px; }
.story-tl--nested::before { border-left-style: dashed; }

.story-tl__item {
    --story-tl-dot: var(--sp-text-dim);
    position: relative;
    margin: 0;
    padding: 0 0 16px;
}
.story-tl__item:last-child { padding-bottom: 6px; }
.story-tl__item--active    { --story-tl-dot: var(--sp-success); }
.story-tl__item--upcoming  { --story-tl-dot: var(--sp-warning); }
.story-tl__item--completed { --story-tl-dot: var(--sp-text-dim); }
.story-tl__item--hiatus    { --story-tl-dot: var(--sp-danger); }

.story-tl__dot {
    position: absolute;
    top: 15px;
    left: calc(var(--story-tl-spine) + 1px - var(--story-tl-indent) - 6px);  /* centred on the spine */
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--story-tl-dot);
    box-shadow: 0 0 0 3px var(--sp-bg);
}
.story-tl__item--active > .story-tl__dot { box-shadow: 0 0 0 3px var(--sp-bg), 0 0 0 5px var(--story-tl-dot); }
/* Where the story is now: ONE marker per current deepest episode. An episode holding the current
   sub-episode gets a plain dot; the sub-episode's own dot gives way to a marker on the main
   (outermost) line, joined to its card by a dashed line. --story-tl-main: from an item's left edge
   back to the main line's centre (set on the outer list); --story-tl-step: each nested list's indent. */
.story-tl:not(.story-tl--nested) { --story-tl-main: calc(var(--story-tl-indent) - var(--story-tl-spine) - 1px); --story-tl-step: var(--story-tl-indent); }
.story-tl__item--holds-now { --story-tl-dot: var(--sp-text-dim); }
.story-tl__item--holds-now > .story-tl__dot { box-shadow: 0 0 0 3px var(--sp-bg); }
.story-tl__item--now.story-tl__item--sub > .story-tl__dot { visibility: hidden; }
.story-tl__now {
    position: absolute;
    top: 15px;
    left: calc(0px - var(--story-tl-main) - var(--story-tl-depth, 0) * var(--story-tl-step) - 6px);
    width: calc(var(--story-tl-main) + var(--story-tl-depth, 0) * var(--story-tl-step) + 6px);
    height: 12px;
    pointer-events: none;
    z-index: 1;
}
.story-tl__now::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--story-tl-dot);
    box-shadow: 0 0 0 3px var(--sp-bg), 0 0 0 5px var(--story-tl-dot);
}
.story-tl__now::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 0;
    top: 5px;
    border-top: 2px dashed var(--story-tl-dot);
}

.story-tl__card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 10px 14px 12px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-radius);
}
.story-tl__main { flex: 1 1 auto; min-width: 0; }
.story-tl__kicker {
    margin: 0 0 2px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sp-text-dim);
}
.story-tl__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.story-tl__title {
    margin: 0;
    font-family: var(--sp-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.story-tl__item--sub .story-tl__title { font-size: 1.02rem; }
.story-tl__title a { color: var(--sp-text-hi); text-decoration: none; }
.story-tl__title a:hover { color: var(--pp-lt); }
.story-tl__date {
    margin-top: 3px;
    font-family: var(--sp-font-display);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--pp-lt);
}
.story-tl__stats {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px 18px;
    margin: 8px 0 0;
    padding: 4px 12px;
    font-size: 0.84rem;
    background: var(--sp-surface-2);
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-radius-sm);
}
.story-tl__stat { display: flex; gap: 6px; align-items: baseline; }
.story-tl__stat dt { margin: 0; font-weight: 400; color: var(--sp-text-dim); }
.story-tl__stat dd { margin: 0; font-family: var(--sp-font-mono); font-weight: 700; color: var(--sp-text-hi); }
.story-tl__links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 0.86rem; }
.story-tl__read { font-weight: 600; color: var(--pp); text-decoration: none; }
.story-tl__read:hover { color: var(--pp-lt); }
.story-tl__edit { color: var(--sp-text-dim); text-decoration: none; }
.story-tl__edit:hover { color: var(--pp-lt); }
.story-tl__thumb {
    flex: 0 0 168px;
    display: block;
    overflow: hidden;
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-radius-sm);
    background: var(--sp-surface-2);
}
.story-tl__thumb:empty { aspect-ratio: 16 / 9; }   /* the editor's empty picture slot */
.story-tl__thumb img { display: block; width: 100%; height: auto; max-height: 200px; object-fit: contain; }   /* banners: the whole picture (title art included), the box takes its shape */
.story-tl__thumb--portrait { flex: 0 0 110px; aspect-ratio: 3 / 4; }   /* character pictures: head and shoulders, like the manifest */
.story-tl__thumb--portrait img { height: 100%; max-height: none; object-fit: cover; object-position: center top; }   /* keep faces in the crop (portraits) */

@media (max-width: 640px) {
    .story-tl { --story-tl-indent: 22px; --story-tl-spine: 6px; }
    .story-tl--nested { --story-tl-indent: 16px; --story-tl-spine: 4px; }
    .story-tl:not(.story-tl--nested) { --story-tl-step: 16px; }
    .story-tl__card { gap: 10px; padding: 9px 10px 10px; }
    .story-tl__thumb { flex-basis: 84px; }
    .story-tl__thumb--portrait { flex-basis: 64px; }
    .story-tl__title { font-size: 1.04rem; }
    .story-tl__item--sub .story-tl__title { font-size: 0.98rem; }
    .story-tl__stats { gap: 2px 12px; padding: 4px 8px; }
}

/* Status badges on the timeline (Past / Present / Future / Hiatus), from the package's
   theme.css, scoped here so Ragnarok's other pages keep their own look. */
.story-tl-wrap .badge, .story-tl .badge {
    display: inline-block;
    padding: 2px 8px;
    font-family: var(--sp-font-display);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--sp-text);
    background: var(--sp-surface-2);
    border: 1px solid var(--sp-line-strong);
    border-radius: 999px;
}
.story-tl-wrap .badge-gray,   .story-tl .badge-gray   { color: var(--sp-text-dim); }
.story-tl-wrap .badge-purple, .story-tl .badge-purple { color: var(--pp-lt); background: rgba(var(--pp-rgb),0.12); border-color: rgba(var(--pp-rgb),0.5); }
.story-tl-wrap .badge-green,  .story-tl .badge-green  { color: #a3f0d4; background: rgba(var(--sp-success-rgb),0.12); border-color: rgba(var(--sp-success-rgb),0.5); }
.story-tl-wrap .badge-red,    .story-tl .badge-red    { color: #ffb4b2; background: rgba(var(--sp-danger-rgb),0.12); border-color: rgba(var(--sp-danger-rgb),0.5); }
.story-tl-wrap .badge-yellow, .story-tl .badge-yellow { color: #ffe58f; background: rgba(var(--sp-warning-rgb),0.12); border-color: rgba(var(--sp-warning-rgb),0.5); }
