/* GemKit: colour charts and measurement scales. Loaded on the pages that show them (home,
   gemstone archive, gemstone page). Colours come from the data (--swatch, --gem-color); everything
   else follows the theme tokens and currentColor, so it also works on the home page dark band. */

/* ── Colour chart ── */
.gc-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.gc-swatch {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: var(--swatch, transparent);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.10);
}

.gc-swatch--light { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22); }

/* Colours that are not a single hue */
.gc-swatch--multicolor { background: conic-gradient(from 30deg, #A3162D, #E2B92B, #1E7044, #1F4E9C, #6D3A8C, #A3162D); }
.gc-swatch--bicolor { background: linear-gradient(135deg, #E58FB3 0 50%, #2E8A57 50% 100%); }
.gc-swatch--color-change { background: linear-gradient(135deg, #127A78 0 50%, #8E2A5E 50% 100%); }
.gc-swatch--banded { background: repeating-linear-gradient(90deg, #6A7C8E 0 3px, #D9D6CF 3px 6px); }

.gc-swatches--lg {
    gap: var(--space-sm) var(--space-md);
}

.gc-swatches--lg .gc-swatch {
    width: 44px;
    height: 44px;
}

.gc-swatch-item {
    display: grid;
    gap: 6px;
    justify-items: start;
}

.gc-swatch-name {
    font-size: var(--text-xs);
    line-height: 1.2;
    opacity: 0.75;
}

/* ── Measurement scales ── */
.gc-scale {
    display: grid;
    gap: 8px;
}

.gc-scale-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
}

.gc-scale-name {
    font-size: var(--text-sm);
    opacity: 0.75;
}

.gc-scale-value {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1;
}

.gc-scale-value small {
    margin-left: 6px;
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 600;
    opacity: 0.75;
}

.gc-scale-track {
    position: relative;
    height: 8px;
    border-radius: 2px;
    background: color-mix(in srgb, currentColor 9%, transparent);
}

/* Mohs scale graduations: one mark per degree */
.gc-scale--mohs .gc-scale-track {
    background:
        repeating-linear-gradient(90deg, transparent 0 calc(100% / 9 - 1px), color-mix(in srgb, currentColor 22%, transparent) calc(100% / 9 - 1px) calc(100% / 9)),
        color-mix(in srgb, currentColor 9%, transparent);
}

.gc-scale-band {
    position: absolute;
    top: -2px;
    bottom: -2px;
    min-width: 5px;
    border-radius: 2px;
    background: var(--gem-color, currentColor);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 35%, transparent);
}

.gc-scale.is-otl .gc-scale-band { border-radius: 2px 0 0 2px; }

.gc-scale-ticks {
    position: relative;
    height: 14px;
    font-size: var(--text-xs);
    line-height: 1;
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
}

.gc-scale-ticks span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
}

.gc-scale-ticks span:first-child { transform: none; }
.gc-scale-ticks span:last-child { transform: translateX(-100%); }

@media (max-width: 640px) {
    .gc-swatches--lg .gc-swatch { width: 36px; height: 36px; }
    .gc-scale--mohs .gc-scale-ticks span:nth-child(even):not(:last-child) { visibility: hidden; }
}
