/* Temperature scaling — interactive element styles only.
   Typography and layout come from base.css + post.css. */

.temp-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0.4em 0 1.2em;
    padding: 6px 12px;
    background: var(--s-surface, #f6f8fa);
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85em;
    flex-wrap: wrap;
    row-gap: 4px;
}

.temp-controls-label {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
}

/* Fixed-width readout block (T over beta) so the slider doesn't
   shift as digits change */
.temp-readouts {
    display: flex;
    flex-direction: column;
    min-width: 8em;
    line-height: 1.4;
}
#temp-readout,
#temp-readout-beta {
    font-variant-numeric: tabular-nums;
    color: #333;
}

.temp-slider-wrap {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
}

/* Custom-drawn slider: a bare accent-color rule lets the browser
   auto-switch between light/dark track themes depending on the accent's
   luminance, which flickers as the temperature color sweeps the range.
   Fixed neutral track + temperature-colored thumb instead. */
.temp-controls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 18px; /* generous hit area */
    background: transparent;
    margin: 0;
}
.temp-controls input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: #dfe2e6;
}
.temp-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: var(--temp-accent, rgb(150, 156, 164));
    margin-top: -5px; /* center 14px thumb on 4px track */
}
.temp-controls input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: #dfe2e6;
}
.temp-controls input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: var(--temp-accent, rgb(150, 156, 164));
}
.temp-controls input[type="range"]:focus-visible {
    outline: none;
}
.temp-controls input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(70, 102, 119, 0.3);
}
.temp-controls input[type="range"]:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(70, 102, 119, 0.3);
}

/* Temperature landmarks above the track: JS positions each span at the
   thumb-center position of the snap it labels (edge labels sit flush). */
.temp-slider-dirs {
    position: relative;
    height: 1.25em;
    font-size: 0.72em;
    line-height: 1.1;
    margin-bottom: 2px;
    user-select: none;
}

.temp-slider-dirs span {
    position: absolute;
    top: 0;
    white-space: nowrap;
}

/* Tick labels are absolutely positioned by JS at the thumb-center
   position of each snap (the thumb travels [w/2, 100% - w/2], so naive
   space-between never lines up, especially with unequal label widths). */
.temp-slider-ticks {
    position: relative;
    height: 1.2em;
    font-size: 0.8em;
    color: #999;
    line-height: 1.1;
}

.temp-slider-ticks span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Top-p truncation slider: its own full-width row below the first */
.temp-rho-wrap {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.temp-rho-wrap input[type="range"] {
    flex: 1;
}

/* Pandoc paragraph-wraps the bare <input>; let the paragraph stretch so
   the slider fills the row */
.temp-rho-wrap p {
    flex: 1;
}

.temp-rho-label {
    line-height: 1.1;
    white-space: nowrap;
}

#temp-rho-readout {
    font-variant-numeric: tabular-nums;
    color: #333;
}

.temp-preset-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Defensive: if Pandoc paragraph-wraps loose inline content inside the
   controls, neutralize the paragraph margins. */
.temp-controls p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Negative-temperature note: a quiet gray callout tucked under the
   controls (a block marginnote has no narrow-viewport toggle mechanism
   and would flow inline beside the slider, so it lives in-column) */
.temp-neg-note {
    margin: -0.8em 0 1.4em;
    padding: 0.4em 0.9em;
    background: var(--s-surface, #f6f8fa);
    border-left: 3px solid #ddd;
    border-radius: 0 4px 4px 0;
    font-size: 0.8em;
    color: #777;
}
.temp-neg-note p { margin: 0; }
.temp-neg-toggle {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    margin-left: 8px;
}
.temp-neg-toggle input {
    vertical-align: middle;
    margin-right: 2px;
}

#temp-preset {
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    font-size: 0.95em;
    color: #333;
}
