/*
 * JSC RC66.2F — Customer Frontend Governance
 * Scope: typography and text-colour governance only.
 * Geometry remains owned by customer/module stylesheets.
 */

:root {
    --jsc-public-font: "Lato", Arial, sans-serif;
    --jsc-public-text: #111111;
    --jsc-public-text-secondary: #222222;
    --jsc-public-text-muted: #444444;
    --jsc-public-placeholder: #555555;
    --jsc-public-link: #006b3f;
    --jsc-public-link-hover: #00552f;

    /* Harmonise existing public-shell tokens without altering layout tokens. */
    --jsc-ink: var(--jsc-public-text);
    --jsc-muted: var(--jsc-public-text-muted);
}

/* Functional public/customer surfaces only. */
:where(
    body.cust-help,
    body.jsc-unified-ticket-page,
    body.jsc-withdraw-page
) {
    font-family: var(--jsc-public-font);
    color: var(--jsc-public-text);
}

:where(
    body.cust-help,
    body.jsc-unified-ticket-page,
    body.jsc-withdraw-page
) :where(
    input,
    select,
    textarea,
    button
) {
    font-family: var(--jsc-public-font);
}

/* Primary readable content: black rather than accumulated mid-grey. */
:where(
    body.cust-help,
    body.jsc-unified-ticket-page,
    body.jsc-withdraw-page
) :where(
    main,
    .main__content,
    .jsc-u-page,
    .jsc-wd-shell,
    .jsc-account-page__content,
    .jsc-kb-content,
    .jsc-my-tickets-page
) :where(
    h1,h2,h3,h4,h5,h6,
    p,li,dt,dd,
    label,
    th,td,
    legend,
    strong,
    .label,
    .form__label,
    .jsc-label,
    .jsc-u-field-value,
    .jsc-u-description,
    .jsc-u-message,
    .article__content
) {
    color: var(--jsc-public-text);
}

/* Form data must remain high contrast. */
:where(
    body.cust-help,
    body.jsc-unified-ticket-page,
    body.jsc-withdraw-page
) :where(input,select,textarea) {
    color: var(--jsc-public-text);
}

:where(
    body.cust-help,
    body.jsc-unified-ticket-page,
    body.jsc-withdraw-page
) :where(input,textarea)::placeholder {
    color: var(--jsc-public-placeholder);
    opacity: 1;
}

/* Secondary information remains visually subordinate, but readable. */
:where(
    body.cust-help,
    body.jsc-unified-ticket-page,
    body.jsc-withdraw-page
) :where(
    small,
    .text-muted,
    .muted,
    .help,
    .hint,
    .form__helper,
    .form__description,
    .jsc-subtitle,
    .jsc-u-eyebrow,
    .jsc-u-meta,
    .jsc-u-field-label,
    .jsc-wd-count
) {
    color: var(--jsc-public-text-muted);
}

/* Functional content links. Exclude button/action/navigation treatments. */
:where(
    body.cust-help,
    body.jsc-unified-ticket-page,
    body.jsc-withdraw-page
) main a:not(.btn):not(.button):not([class*="btn"]):not([class*="action"]):not([class*="nav"]):not([role="button"]) {
    color: var(--jsc-public-link);
}

:where(
    body.cust-help,
    body.jsc-unified-ticket-page,
    body.jsc-withdraw-page
) main a:not(.btn):not(.button):not([class*="btn"]):not([class*="action"]):not([class*="nav"]):not([role="button"]):hover {
    color: var(--jsc-public-link-hover);
}

/* Account / registration / sign-in family. */
body.jsc-account-page :where(h1,h2,h3,p,label,input,select,textarea,td,th) {
    font-family: var(--jsc-public-font);
}

/* Knowledge Base reading typography. */
body[class*="jsc-kb-"] :where(
    .article,
    .article__content,
    .article__content p,
    .article__content li,
    .article__content td,
    .article__content th,
    .kb-category,
    .kb-article
) {
    font-family: var(--jsc-public-font);
    color: var(--jsc-public-text);
}

/* Complaint/petition form family. */
body.jsc-public-form-page :where(
    h1,h2,h3,h4,
    p,label,legend,
    input,select,textarea,
    th,td
) {
    font-family: var(--jsc-public-font);
}

/* Ticket/status and authenticated customer detail family. */
body.jsc-unified-ticket-page :where(
    h1,h2,h3,h4,
    p,label,legend,
    input,select,textarea,
    th,td,
    .jsc-u-description,
    .jsc-u-field-value,
    .jsc-u-message
) {
    font-family: var(--jsc-public-font);
}

/* Preserve semantic/state colours and text placed on coloured controls. */
:where(
    body.cust-help,
    body.jsc-unified-ticket-page,
    body.jsc-withdraw-page
) :where(
    .btn,
    .button,
    [class*="btn"],
    [class*="status"],
    [class*="alert"],
    [class*="notice"],
    [class*="error"],
    [class*="success"],
    [class*="warning"],
    [role="alert"],
    header,
    footer,
    nav
) {
    /* Deliberately no colour override: module/state CSS remains authoritative. */
}
