/* SPDX-License-Identifier: GPL-3.0-or-later */

/*
 * Course tag chips (amd/src/course_card_tags.js). Colours come from the AuST tokens, so light and dark
 * follow the theme with no per-mode rules; each chip is tinted with its tag's own colour, which the JS
 * sets as --pill-color.
 */

/* The row of chips injected into a course card or list row. */
.local-coursematrixtags-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
    margin-top: 0.5em;
    line-height: 1.2;
}

/* Inline variant: on the front page course list the chips sit next to the link text. */
.local-coursematrixtags-pills--inline {
    display: inline-flex;
    margin: 0 0 0 0.5em;
    vertical-align: middle;
}

/*
 * One chip: a soft tint of the tag colour over the surface, with a tag-coloured hairline and text that is
 * the tag colour pulled toward the strong text colour (readable on the tint in both modes whatever hue the
 * admin picked). Falls back to a neutral grey for tags with no colour.
 */
.local-coursematrixtags-pill {
    --pill-color: var(--color-neutral-500, #6b7280);
    display: inline-block;
    max-width: 12rem;
    padding: 0.15em 0.65em;
    border: 1px solid color-mix(in srgb, var(--pill-color) 38%, transparent);
    border-radius: var(--radius-pill, 999px);
    background-color: color-mix(in srgb, var(--pill-color) 14%, var(--color-bg-surface, #fff));
    color: color-mix(in srgb, var(--pill-color) 62%, var(--color-text-strong, #142033));
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold, 600);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Swatch used in the admin manage-tags table. */
.local-coursematrixtags-swatch {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.4em;
    border: 1px solid var(--color-border-default, rgba(0, 0, 0, 0.25));
    border-radius: 0.2em;
    vertical-align: middle;
}
