/* Prime gap explorer (/prime-gap-explorer): the From / To pair, the row of numbers of the selected gap (coloured by
   smallest factor), the legend line styles and the table's row buttons. Tiles, panels, the chart, fields and the theme
   come from the app kit (css/app-kit, docs/app-kit.md). Loaded only on this app's page (StylePaths). The colours mix
   the kit's series colours into the panel, so they follow the app's light and dark theme (declared on the panel, where
   the stage's tokens apply, not on the root, which carries the control panel's). */

.pg-landing-app .pg-gap {
    --pg-f2: color-mix(in srgb, var(--ak-series-1) 18%, var(--ak-panel));
    --pg-f3: color-mix(in srgb, var(--ak-series-3) 24%, var(--ak-panel));
    --pg-f5: color-mix(in srgb, var(--ak-series-7) 30%, var(--ak-panel));
    --pg-f7: color-mix(in srgb, var(--ak-series-5) 26%, var(--ak-panel));
    --pg-f11: color-mix(in srgb, var(--ak-series-4) 34%, var(--ak-panel));
}

.pg-landing-app .pg-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ak-space-2);
}

.pg-landing-app .pg-range > .ak-row { min-width: 0; }

/* Legend swatches for the two guide curves: a line and a dashed line. */
.pg-landing-app .pg-swatch-line,
.pg-landing-app .pg-swatch-dash {
    width: 18px;
    height: 0;
    border-radius: 0;
    background: none;
    border-top: 2px solid var(--ak-swatch);
}

.pg-landing-app .pg-swatch-dash { border-top-style: dashed; }

/* The selected gap: its caption and the Previous / Next buttons on one line. */
.pg-landing-app .pg-caption {
    margin: 0;
    flex: 1 1 18rem;
    min-width: 0;
    font-size: var(--ak-fs-sm);
    font-variant-numeric: tabular-nums;
}

/* The numbers from one prime to the next: the two primes in the accent, each composite coloured by its smallest
   factor, which is written under it. */
.pg-landing-app .pg-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pg-landing-app .pg-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0.2rem 0.3rem;
    border-radius: var(--ak-radius-sm, 6px);
    background: var(--pg-f11);
    color: var(--ak-text);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.pg-landing-app .pg-num { font-size: var(--ak-fs-sm); font-weight: 600; }
.pg-landing-app .pg-fac { font-size: 0.68rem; color: var(--ak-muted); }

.pg-landing-app .pg-prime,
.pg-landing-app .pg-cell.pg-prime {
    background: var(--ak-accent);
    color: var(--ak-on-accent);
}

.pg-landing-app .pg-f2 { background: var(--pg-f2); }
.pg-landing-app .pg-f3 { background: var(--pg-f3); }
.pg-landing-app .pg-f5 { background: var(--pg-f5); }
.pg-landing-app .pg-f7 { background: var(--pg-f7); }
.pg-landing-app .pg-f11 { background: var(--pg-f11); }

/* Numbers of a million or more: the composites show their distance from the first prime (+1, +2 ...). */
.pg-landing-app .pg-strip--offsets .pg-cell:not(.pg-prime) { min-width: 2.2rem; }

/* A long gap: small squares without text (the number and factor are in the tooltip), the two primes still written. */
.pg-landing-app .pg-strip--compact { gap: 2px; align-items: center; }

.pg-landing-app .pg-strip--compact .pg-cell:not(.pg-prime) {
    min-width: 0;
    width: 12px;
    height: 12px;
    padding: 0;
    border-radius: 2px;
}

.pg-landing-app .pg-factors { margin-top: var(--ak-space-2); }
.pg-landing-app .pg-factors-label { color: var(--ak-muted); }

.pg-landing-app .pg-key {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-inline-end: 0.3rem;
    border-radius: 2px;
    vertical-align: -1px;
    border: 1px solid var(--ak-border);
}

/* The gap in each row of the table is a button that selects it. */
.pg-landing-app .pg-row-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ak-accent);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.pg-landing-app .pg-table tbody tr { cursor: pointer; }
.pg-landing-app .pg-table td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
