/* pperl tier + feature badges.
 *
 * Rendered by the pperl_badges Sphinx extension. Colors chosen so min
 * (always available) is visually quiet, max (specialized builds) is
 * distinctive, and feature badges (pdl, shell) each have their own hue
 * so a reader can spot "this is PDL" at a glance.
 */

.pperl-badges {
    display: inline-flex;
    gap: 0.35rem;
    margin: 0.15rem 0 0.25rem 0;
    vertical-align: baseline;
}

.pperl-badge {
    display: inline-block;
    padding: 0.05em 0.55em;
    font-size: 0.78em;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-family: var(--pst-font-family-monospace, monospace);
    white-space: nowrap;
    cursor: help;
    border: 1px solid transparent;
}

/* Tier: mutually exclusive. Hue progression (gray → blue → purple)
 * mirrors GitLab's free → premium → ultimate tier progression, which
 * users already understand from download pages. */

.pperl-tier-min {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
}

.pperl-tier-std {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.pperl-tier-max {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #c4b5fd;
}

/* Feature badges: additive on top of the tier. Distinct hues per feature
 * so the reader learns color = feature without reading the label each
 * time. */

.pperl-feature-pdl {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.pperl-feature-shell {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fdba74;
}

/* Dark mode: pydata-sphinx-theme toggles `data-theme="dark"` on <html>.
 * Slightly desaturate and lift the text contrast. */

html[data-theme="dark"] .pperl-tier-min {
    background: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
}

html[data-theme="dark"] .pperl-tier-std {
    background: #1e3a8a;
    color: #dbeafe;
    border-color: #1e40af;
}

html[data-theme="dark"] .pperl-tier-max {
    background: #4c1d95;
    color: #ede9fe;
    border-color: #5b21b6;
}

html[data-theme="dark"] .pperl-feature-pdl {
    background: #14532d;
    color: #dcfce7;
    border-color: #166534;
}

html[data-theme="dark"] .pperl-feature-shell {
    background: #7c2d12;
    color: #ffedd5;
    border-color: #9a3412;
}

/* Placeholder when metadata is missing — signals a build-system bug,
 * not a prose mistake. */

.pperl-badges-missing {
    font-weight: 700;
    color: #b91c1c;
    background: #fee2e2;
    padding: 0.05em 0.55em;
    border-radius: 999px;
}

/* `{ext}` role: CPAN modules that pperl does NOT ship natively.
 * Rendered as a metacpan link with a small "ext" subscript marker so
 * readers can see at a glance which references leave pperl's native
 * surface. Keep the inline `<code>` visual consistent with plain
 * backticked module names — only the subscript + link behaviour differ.
 */

a.pperl-ext {
    text-decoration: none;
    white-space: nowrap;
}

a.pperl-ext:hover {
    text-decoration: underline;
}

.pperl-ext-marker {
    font-size: 0.6em;
    font-weight: 600;
    line-height: 1;
    padding: 0 0.2em;
    margin-left: 0.15em;
    border-radius: 0.2em;
    background: #e5e7eb;
    color: #4b5563;
    vertical-align: sub;
    text-transform: lowercase;
    letter-spacing: 0.05em;
}

html[data-theme="dark"] .pperl-ext-marker {
    background: #374151;
    color: #d1d5db;
}
