/* tool-patterns/dot-timeline.css — rtp-dot-timeline
 *
 * Events on a shared time axis, one row per series: a label on the left, a
 * track with a dot at each event, a count on the right, decade-style ticks
 * along the top and an optional vertical marker ("the date you picked") that
 * runs through every row at the same position.
 *
 * OPT-IN. A widget links this file; nothing else on the site reads it, so
 * existing pages never change. Presentation only: no maths lives here. Every
 * position arrives already computed by the tool's kernel, as a percentage on
 * a custom property: style="--rtp-at:26.85%".
 *
 * Markup:
 *   <div class="rtp-dot-timeline">
 *     <div class="rtp-dot-timeline__axis" aria-hidden="true">
 *       <span class="rtp-dot-timeline__tick" style="--rtp-at:0%">2000</span> …
 *       <span class="rtp-dot-timeline__tick rtp-dot-timeline__tick--end" style="--rtp-at:100%">2099</span>
 *     </div>
 *     <ol class="rtp-dot-timeline__rows">
 *       <li class="rtp-dot-timeline__row">
 *         <span class="rtp-dot-timeline__label">Day first<span class="rtp-dot-timeline__meta">dd/MM/y</span></span>
 *         <span class="rtp-dot-timeline__track" role="img" aria-label="…">
 *           <span class="rtp-dot-timeline__dot" style="--rtp-at:20.1%" title="…"></span>
 *           <span class="rtp-dot-timeline__dot rtp-dot-timeline__dot--on" style="--rtp-at:20.1%"></span>
 *           <span class="rtp-dot-timeline__marker" style="--rtp-at:26.85%"></span>
 *         </span>
 *         <span class="rtp-dot-timeline__value">29</span>
 *       </li>
 *     </ol>
 *   </div>
 *
 * Tokens only (rt-tokens.css), so the dark theme follows. First used by
 * /palindrome-checker/ (dates view). Catalogue: docs/tool-design-patterns.md.
 */
.rtp-dot-timeline {
    --rtp-label-w: 168px;
    --rtp-value-w: 44px;
    position: relative;
    font-family: var(--rt-font-sans);
    color: var(--rt-ink);
}
.rtp-dot-timeline__axis {
    position: relative;
    height: 18px;
    margin: 0 var(--rtp-value-w) 6px var(--rtp-label-w);
    border-bottom: 1px solid var(--rt-hairline);
}
.rtp-dot-timeline__tick {
    position: absolute;
    left: var(--rtp-at, 0%);
    bottom: 4px;
    transform: translateX(-50%);
    font: 500 10px/1 var(--rt-font-mono);
    color: var(--rt-ink-muted);
    white-space: nowrap;
}
.rtp-dot-timeline__tick:first-child { transform: none; }
.rtp-dot-timeline__tick--end { transform: translateX(-100%); }
.rtp-dot-timeline__rows { list-style: none; margin: 0; padding: 0; }
.rtp-dot-timeline__row {
    display: grid;
    grid-template-columns: var(--rtp-label-w) 1fr var(--rtp-value-w);
    align-items: center;
    min-height: 30px;
    border-bottom: 1px dashed var(--rt-hairline);
}
.rtp-dot-timeline__row:last-child { border-bottom: 0; }
.rtp-dot-timeline__label {
    display: flex;
    flex-direction: column;
    padding-right: 10px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--rt-ink-soft);
}
.rtp-dot-timeline__meta { font: 500 10px/1.3 var(--rt-font-mono); color: var(--rt-ink-muted); }
.rtp-dot-timeline__track {
    position: relative;
    height: 20px;
    background: linear-gradient(var(--rt-hairline), var(--rt-hairline)) 0 50% / 100% 1px no-repeat;
}
.rtp-dot-timeline__dot {
    position: absolute;
    left: var(--rtp-at, 0%);
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--rt-accent);
    opacity: .85;
}
.rtp-dot-timeline__dot--on {
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    background: var(--rt-accent-fill);
    box-shadow: 0 0 0 3px var(--rt-accent-soft);
    opacity: 1;
    z-index: 2;
}
.rtp-dot-timeline__marker {
    position: absolute;
    left: var(--rtp-at, 0%);
    top: -6px;
    bottom: -6px;
    width: 0;
    border-left: 2px solid var(--rt-ink);
    z-index: 1;
}
.rtp-dot-timeline__value {
    text-align: right;
    font: 600 13px/1 var(--rt-font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--rt-ink);
}
@media (max-width: 560px) {
    .rtp-dot-timeline { --rtp-label-w: 0px; --rtp-value-w: 34px; }
    .rtp-dot-timeline__row { grid-template-columns: 1fr var(--rtp-value-w); grid-template-areas: "label label" "track value"; padding: 4px 0; }
    .rtp-dot-timeline__label { grid-area: label; flex-direction: row; gap: 6px; align-items: baseline; padding: 0; }
    .rtp-dot-timeline__track { grid-area: track; }
    .rtp-dot-timeline__value { grid-area: value; }
    .rtp-dot-timeline__tick:nth-child(even) { display: none; }
}
