/*
 * jh-color-swatch.css — presentation for the shaped color swatches.
 *
 * Shared by index.html and the generated product pages under public/p/. It was
 * briefly inline in index.html, which is how the product pages ended up with no
 * swatch styling at all and a zero-height color row. One file, both surfaces.
 *
 * Behaviour lives in js/jh-color-swatch.js.
 */
/* ---- Shaped color swatches (2026-11-06) --------------------------------
 * Replaces the text-pill color picker. The pills stacked into several rows
 * on a phone and pushed the controls below the fold, so choosing a color
 * meant scrolling back up to see it. A silhouette in the actual color is
 * about a third the height and shows the color directly.
 *
 * These rules are scoped to .is-swatch, which js/jh-color-swatch.js adds
 * when it decorates. Any chip the module has not touched keeps the old pill
 * styling above, so a script failure degrades to readable text rather than
 * an empty row. Specificity is deliberately 2-3 classes so the max-width:860px
 * overrides further down cannot win against them.
 */
.jh-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.is-swatch-list .color-chip.is-swatch {
    gap: 0;
    border: 0;
    background: none;
    /* Padding is the SELECTION BOX's breathing room, not just a touch target: the gold
       ring is drawn on this element's edge, so the shirt needs room inside it or the
       ring clips the shoulders. Matches the approved mockup, which sat the gold box
       clearly outside the silhouette. 44px art + 7px x2 = 58px, comfortably past the
       44px minimum touch target. */
    padding: 7px;
    min-height: 0;
    border-radius: 12px;
}

.is-swatch-list .color-chip.is-swatch:hover {
    border: 0;
    background: none;
    transform: translateY(-1px);
}

.is-swatch-list .color-chip.is-swatch .color-chip-swatch {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    display: block;
}

.is-swatch-list .color-chip.is-swatch .jh-swatch-svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Selection is a gold ring, not a fill change -- the swatch IS the color,
   so recoloring it to show selection would defeat the point. */
.is-swatch-list .color-chip.is-swatch.is-active {
    background: none;
    border: 0;
    box-shadow: 0 0 0 2px rgba(var(--jh-rgb-gold), 0.95);
}

.is-swatch-list .color-chip.is-swatch:focus-visible {
    outline: 2px solid rgba(var(--jh-rgb-gold), 0.9);
    outline-offset: 2px;
}

/* The color name lives here now instead of on every chip. min-height holds
   the row steady so the page does not jump when the name changes length. */
.color-chip-selected-name {
    margin: 0.1rem 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    min-height: 1.3em;
    color: var(--text-color);
}

/* The list keeps flex-wrap from the page styles; only the gap changes, and the
   old pill-era bottom margin is dropped because the name line below supplies it. */
.is-swatch-list {
    gap: 0.45rem;
    margin-bottom: 0.1rem;
}

/* Sits above the row, matching the heading the non-chip colour layout already had. */
.color-chip-heading {
    display: block;
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
}
