/* ===========================================================================
   Run-sheet segment types — colour AND pattern.

   Every element here expects two custom properties set inline, from
   PlanSegmentStyle.Vars(): --seg-color (the fill) and --seg-ink (an "r,g,b"
   triplet that stays legible on it). The pattern is drawn in the ink, so a
   pale segment gets dark texture and a dark one light texture instead of one
   of them vanishing.

   The pattern is not decoration. On the timeline bar, adjacent red and green
   segments are one unbroken block to a viewer with deuteranopia; the texture
   is the channel that still tells them apart. Nothing in a plan may be
   distinguishable by colour alone.

   Used by the plan builder, the segment-type manager, the timeline bar and
   the public share page — one definition so a segment looks like itself
   everywhere.
   =========================================================================== */

.seg-fill {
    background-color: var(--seg-color, #64748B);
    background-repeat: repeat;
}

/* p0 is solid — no background-image at all. */
.seg-p1 { background-image: repeating-linear-gradient(45deg,  rgba(var(--seg-ink), .38) 0 3px, transparent 3px 8px); }
.seg-p2 { background-image: repeating-linear-gradient(-45deg, rgba(var(--seg-ink), .38) 0 3px, transparent 3px 8px); }
.seg-p3 { background-image: repeating-linear-gradient(90deg,  rgba(var(--seg-ink), .38) 0 3px, transparent 3px 8px); }
.seg-p4 { background-image: repeating-linear-gradient(0deg,   rgba(var(--seg-ink), .38) 0 3px, transparent 3px 8px); }

.seg-p5 {
    background-image: radial-gradient(rgba(var(--seg-ink), .45) 1.6px, transparent 1.7px);
    background-size: 8px 8px;
}

.seg-p6 {
    background-image:
        repeating-linear-gradient(0deg,  rgba(var(--seg-ink), .34) 0 2px, transparent 2px 9px),
        repeating-linear-gradient(90deg, rgba(var(--seg-ink), .34) 0 2px, transparent 2px 9px);
}

.seg-p7 {
    background-image:
        linear-gradient(45deg, rgba(var(--seg-ink), .34) 25%, transparent 25% 75%, rgba(var(--seg-ink), .34) 75%),
        linear-gradient(45deg, rgba(var(--seg-ink), .34) 25%, transparent 25% 75%, rgba(var(--seg-ink), .34) 75%);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
}

/* ── The chip that names a segment in a list ───────────────────────────── */

.seg-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 1px 9px 1px 4px; border-radius: 999px;
    font-size: .72rem; font-weight: 600; line-height: 1.6;
    letter-spacing: .02em; white-space: nowrap;
    color: var(--color-sf-on-surface, inherit);
    background: rgba(var(--seg-ink-neutral, 128,128,128), .12);
    border: 1px solid rgba(128,128,128,.28);
}

/* The chip's own little patterned dot — the colour and texture together, small
   enough to sit inside running text. */
.seg-dot {
    width: 14px; height: 14px; border-radius: 50%;
    flex: 0 0 14px; display: inline-block;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}

/* ── The timeline bar ─────────────────────────────────────────────────────
   The whole service as one strip, each segment as wide as its share of the
   running time. Widths are set inline as a flex-grow, so a 35-minute sermon
   is visibly a third of the morning. */

.seg-timeline {
    display: flex; width: 100%; height: 22px; overflow: hidden;
    border-radius: 5px; background: rgba(128,128,128,.18);
}

.seg-timeline > .seg-slice {
    height: 100%; min-width: 3px;
    border-right: 1px solid rgba(255,255,255,.55);
    cursor: default;
}

.seg-timeline > .seg-slice:last-child { border-right: none; }

/* Where the service has actually got to. Not colour alone: the live slice is
   also outlined and lifted above its neighbours. */
.seg-timeline > .seg-slice.is-live {
    outline: 2px solid var(--color-sf-primary, #2f6fed);
    outline-offset: -2px;
    filter: brightness(1.08);
}

.seg-timeline-ends {
    display: flex; justify-content: space-between;
    font-size: .74rem; opacity: .7; margin-top: 3px;
}

/* ── The stripe down the left of a run-sheet row ──────────────────────── */

.seg-stripe {
    width: 6px; align-self: stretch; flex: 0 0 6px;
    border-radius: 3px;
}

/* ── The pattern picker ──────────────────────────────────────────────── */

.seg-pattern-choice {
    width: 46px; height: 30px; border-radius: 6px;
    border: 2px solid transparent; cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}

.seg-pattern-choice.is-chosen { border-color: var(--color-sf-primary, #2f6fed); }

/* A swatch big enough to judge the colour and pattern together while editing. */
.seg-preview {
    height: 34px; border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}
