/*
 * Content labels (content-labels-tw-se): the TW / SE pills an author can put on a publication,
 * shown right before its title, plus the matching toggles in the compose form.
 *
 * Plain CSS (no gulp build), added on every page by TJForumPlugin::base_render_before(), so the
 * same colours reach the front end AND the dashboard moderation queue (/log/*), which doesn't
 * load the theme stylesheet. Theme-specific layout (compose toggles row, sidebar-card flex row,
 * tooltip width) lives in the theme LESS. Doc: docs/content-labels.md.
 *
 * Contrast (WCAG AA, 12px bold): white on #E11D48 ≈ 4.7:1; #0F172A on #F97316 ≈ 7:1.
 * White on orange would fail, hence the dark SE text.
 */

.ContentLabels {
    display: inline-flex;
    gap: 4px;
    margin-right: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

/* Dashboard moderation queue: next to the 13px bold title, `middle` put the pills ~7px high
   (dashboard font metrics); baseline alignment centres them on the text. The front-end
   headings (30px thread <h1>, 20px list titles) look right with `middle`. */
.Dashboard .post-content .ContentLabels {
    vertical-align: baseline;
}

.ContentLabel {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 0.02em;
    vertical-align: middle;
    cursor: help;
}

/* iOS only dispatches taps to non-interactive elements that look clickable. */
@media (hover: none) {
    .ContentLabel {
        cursor: pointer;
    }
}

.ContentLabel:focus {
    outline: 2px solid #0F172A;
    outline-offset: 2px;
}

.ContentLabel:focus:not(:focus-visible) {
    outline: none;
}

.ContentLabel--TW {
    background-color: #E11D48;
    color: #FFFFFF;
}

.ContentLabel--SE {
    background-color: #F97316;
    color: #0F172A;
}

/* Compose form toggles: outlined when off, filled (same colours as the pills) when on. */
.ContentLabelToggle {
    background-color: #FFFFFF;
    color: #0F172A;
    border: 2px solid currentColor;
    font-weight: 700;
    cursor: pointer;
}

.ContentLabelToggle--TW {
    border-color: #E11D48;
}

.ContentLabelToggle--SE {
    border-color: #F97316;
}

.ContentLabelToggle--TW[aria-pressed="true"] {
    background-color: #E11D48;
    color: #FFFFFF;
}

.ContentLabelToggle--SE[aria-pressed="true"] {
    background-color: #F97316;
    color: #0F172A;
}
