/* Shared brand-colour picker — presentation.
 *
 * Paired with int_ui/_color_picker.html and int_ui/color-picker.js. The surface
 * shows only `.pf-brand-swatch`; clicking it reveals `.pf-color-popover` (a
 * saturation/value gradient box, a hue bar, and a hex entry beneath it).
 *
 * Dynamic colours and thumb positions arrive as inline style attributes from the
 * JS (CSP: style-src-attr). What lives here is everything hue-invariant — the two
 * gradient overlays, the hue ramp, and the box chrome.
 *
 * Colours are literal rather than design tokens on purpose: this file is shared by
 * apps with different palettes (prac_com is Bootstrap-default, int_lms is forest
 * green), and a var(--color-…) reference would resolve in one and fall back to
 * nothing in the other.
 */

.pf-brand-picker { position: relative; display: inline-block; }

.pf-brand-swatch {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: .5rem;
  background-color: var(--pf-swatch, #3A5BA0);
  box-shadow: inset 0 0 0 2px #fff, 0 1px 2px rgba(0, 0, 0, .15);
  cursor: pointer;
}
.pf-brand-swatch:hover {
  box-shadow: inset 0 0 0 2px #fff, 0 .25rem .6rem rgba(0, 0, 0, .25);
}
.pf-brand-swatch:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }

.pf-color-popover {
  position: absolute;
  z-index: 1080;                 /* above Bootstrap modal body */
  top: calc(100% + .5rem);
  left: 0;
  width: 220px;
  padding: .65rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .6rem;
  box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .18);
}
.pf-color-popover[hidden] { display: none; }

.pf-cp-sv {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: .4rem;
  cursor: crosshair;
  background:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, rgba(255, 255, 255, 0)),
    var(--pf-hue, #ff0000);
}
.pf-cp-hue {
  position: relative;
  width: 100%;
  height: 14px;
  margin-top: .55rem;
  border-radius: .4rem;
  cursor: ew-resize;
  background: linear-gradient(to right,
    #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
}
.pf-cp-thumb {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.pf-cp-sv-thumb { top: 0; left: 0; }
.pf-cp-hue-thumb { top: 50%; left: 0; }
.pf-cp-hex { text-transform: uppercase; }
