/* tool-patterns/segment-strip.css — rtp-segment-strip
 *
 * A proportional strip: one row of segments whose widths the TOOL'S KERNEL
 * decides (a share of the whole, in percent), each with a short label inside and
 * a tick label under its left edge, an optional "lead-in" segment drawn hatched,
 * one segment that can be marked current, and an optional "today" marker.
 *
 * 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. Widths
 * arrive as a custom property on each segment: style="--rtp-w:9.2%".
 *
 * Markup:
 *   <div class="rtp-segment-strip" role="img" aria-label="…">
 *     <ol class="rtp-segment-strip__bar">
 *       <li class="rtp-segment-strip__seg rtp-segment-strip__seg--lead" style="--rtp-w:7.2%">
 *         <span class="rtp-segment-strip__label">…</span><span class="rtp-segment-strip__tick">0</span></li>
 *       <li class="rtp-segment-strip__seg rtp-segment-strip__seg--current" style="--rtp-w:9.3%">…</li>
 *     </ol>
 *     <span class="rtp-segment-strip__today" style="--rtp-at:31.5%"><span>Today</span></span>
 *   </div>
 *
 * Tokens only (rt-tokens.css), so the dark theme follows. First used by
 * /major-luck-cycle-calculator/. Catalogue: docs/tool-design-patterns.md.
 */
.rtp-segment-strip {
    position: relative;
    margin: 4px 0 30px;
    padding-top: 18px;              /* room for the "today" flag */
}
.rtp-segment-strip__bar {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 52px;
    border-radius: 8px;
    overflow: visible;
    background: var(--rt-bg-inset);
}
.rtp-segment-strip__seg {
    position: relative;
    flex: 0 0 var(--rtp-w, 10%);
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rt-surface);
    border: 1px solid var(--rt-hairline);
    border-left-width: 0;
    color: var(--rt-ink);
    font-family: var(--rt-font-cjk, var(--rt-font-sans));
    font-size: 14px;
    font-weight: 600;
    line-height: 1.05;
    text-align: center;
}
.rtp-segment-strip__seg:first-child { border-left-width: 1px; border-radius: 8px 0 0 8px; }
.rtp-segment-strip__seg:last-child { border-radius: 0 8px 8px 0; }
.rtp-segment-strip__seg--lead {
    background: repeating-linear-gradient(135deg, var(--rt-bg-inset) 0 6px, var(--rt-surface) 6px 12px);
    color: var(--rt-ink-muted);
    font-family: var(--rt-font-mono);
    font-size: 10px;
    font-weight: 600;
}
.rtp-segment-strip__seg--current {
    background: var(--rt-accent-soft);
    border-color: var(--rt-accent);
    border-left-width: 1px;
    box-shadow: inset 0 -3px 0 var(--rt-accent);
}
.rtp-segment-strip__seg--empty { flex-basis: 0; border: 0; }
/* --narrow: too thin for its label or tick; the next segment's tick says where it ends. */
.rtp-segment-strip__seg--narrow .rtp-segment-strip__label,
.rtp-segment-strip__seg--narrow .rtp-segment-strip__tick { display: none; }
.rtp-segment-strip__label { display: block; overflow: hidden; padding: 0 2px; }
.rtp-segment-strip__tick {
    position: absolute;
    left: -1px;
    top: 100%;
    margin-top: 4px;
    font-family: var(--rt-font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--rt-ink-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.rtp-segment-strip__today {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--rtp-at, 0);
    width: 0;
    border-left: 2px solid var(--rt-accent-text);
    pointer-events: none;
}
.rtp-segment-strip__today > span {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(-50%);
    padding: 0 4px;
    border-radius: 3px;
    background: var(--rt-accent-fill);
    color: #fff;
    font-family: var(--rt-font-mono);
    font-size: 9px;
    line-height: 14px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .rtp-segment-strip__bar { height: 60px; }
    .rtp-segment-strip__seg { font-size: 13px; }
    .rtp-segment-strip__tick { font-size: 9px; }
    .rtp-segment-strip__seg:nth-child(even) .rtp-segment-strip__tick { display: none; }
    .rtp-segment-strip__seg--lead .rtp-segment-strip__label { display: none; }
    /* --stack: narrow segments set a short CJK label one character a line. */
    .rtp-segment-strip--stack .rtp-segment-strip__seg:not(.rtp-segment-strip__seg--lead) .rtp-segment-strip__label { width: 1.1em; word-break: break-all; }
}
