﻿/* slider demo styles — plain CSS section. The library ships zero CSS. */

/* ---- Root ----------------------------------------------------------------
   BitBhSlider only adds its default inline layout when you pass neither class
   nor style, so a styled root must be position: relative itself — thumbs are
   absolutely positioned against it. */
.slider {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 20rem;
    height: 1.25rem;
    touch-action: none;   /* keep touch drags on the slider */
    user-select: none;
    cursor: pointer;
}

.slider[data-orientation="vertical"] {
    flex-direction: column;
    width: 1.25rem;
    height: 10rem;
}

.slider[data-disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---- Track (inline: position: relative; flex-grow: 1) -------------------- */
.slider-track {
    border-radius: 999px;
    background: var(--color-fill-strong);
}

.slider-track[data-orientation="horizontal"] { height: 0.375rem; }
.slider-track[data-orientation="vertical"]   { width: 0.375rem; }

/* ---- Range (inline: position: absolute + two edges) ---------------------- */
.slider-range {
    inset: 0;             /* inline left/right (or top/bottom) override two of these */
    border-radius: inherit;
    background: var(--color-primary);
}

.slider-range[data-disabled] { background: var(--color-border-hover); }

/* ---- Thumb (inline: position: absolute + left/bottom % + translate) ------ */
.slider-thumb {
    display: block;
    box-sizing: border-box;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-primary);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(24, 24, 27, 0.25);
    cursor: grab;
    outline: none;
    transition: box-shadow 120ms ease;
}

/* Center the thumb across the track (the inline transform handles the other axis). */
.slider-thumb[data-orientation="horizontal"] { top: 50%; margin-top: -0.625rem; }
.slider-thumb[data-orientation="vertical"]   { left: 50%; margin-left: -0.625rem; }

.slider-thumb:hover         { box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12); }
.slider-thumb:focus-visible { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35); }
.slider-thumb[data-dragging] {
    cursor: grabbing;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.2);
}

.slider-thumb[data-disabled] {
    border-color: var(--color-border-hover);
    cursor: not-allowed;
    box-shadow: none;
}

/* ---- Value bubble rendered through the thumb's Template ------------------ */
.slider-bubbled { margin-top: 2.25rem; }

.slider-bubble {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    background: var(--color-inverse);
    color: var(--color-on-inverse);
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
}

/* ---- Field (BitBhField + BitBhLabel + BitBhDescription) --------------------------- */
.slider-field {
    display: grid;
    gap: 0.6rem;
    width: 100%;
    max-width: 20rem;
}

.slider-label       { font-size: 0.875rem; font-weight: 600; color: var(--color-text); }
.slider-description { margin: 0; font-size: 0.8rem; color: var(--color-muted); }

/* ---- Equalizer (vertical sliders) ---------------------------------------- */
.slider-eq {
    display: flex;
    gap: 2rem;
    padding: 0.5rem 0.75rem;
}

.slider-eq-band {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
}

.slider-eq-label { font-size: 0.8rem; font-weight: 500; color: var(--color-text-tertiary); }

/* ---- Demo layout ----------------------------------------------------------- */
.slider-demo {
    display: grid;
    gap: 1rem;
    width: 100%;
}

.slider-value { margin: 0; font-size: 0.85rem; color: var(--color-muted); }
.slider-value strong { color: var(--color-text); font-weight: 600; font-variant-numeric: tabular-nums; }
