/**
 * Copyright 2025 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

@media (forced-colors: active) {
    .spectrum-Code {
        --highcontrast-code-font-color: Text;
    }
}

.spectrum-Code,
.spectrum-Code--sizeM {
    --spectrum-code-font-size: var(--spectrum-code-size-m);
}

.spectrum-Code--sizeXS {
    --spectrum-code-font-size: var(--spectrum-code-size-xs);
}

.spectrum-Code--sizeS {
    --spectrum-code-font-size: var(--spectrum-code-size-s);
}

.spectrum-Code--sizeL {
    --spectrum-code-font-size: var(--spectrum-code-size-l);
}

.spectrum-Code--sizeXL {
    --spectrum-code-font-size: var(--spectrum-code-size-xl);
}

.spectrum-Code {
    --spectrum-code-font-family: var(--spectrum-code-font-family-stack);
    --spectrum-code-cjk-letter-spacing: var(--spectrum-cjk-letter-spacing);
    --spectrum-code-font-color: var(--spectrum-code-color);
    font-family: var(--mod-code-font-family, var(--spectrum-code-font-family));
    font-style: var(--mod-code-font-style, var(--spectrum-code-font-style));
    font-weight: var(--mod-code-font-weight, var(--spectrum-code-font-weight));
    font-size: var(--mod-code-font-size, var(--spectrum-code-font-size));
    line-height: var(--mod-code-line-height, var(--spectrum-code-line-height));
    color: var(--highcontrast-code-font-color, var(--mod-code-font-color, var(--spectrum-code-font-color)));
    margin-block-start: var(--mod-code-margin-start, 0);
    margin-block-end: var(--mod-code-margin-end, 0);
}

.spectrum-Code .spectrum-Code-strong,
.spectrum-Code strong {
    font-style: var(--mod-code-strong-font-style, var(--spectrum-code-strong-font-style));
    font-weight: var(--mod-code-strong-font-weight, var(--spectrum-code-strong-font-weight));
}

.spectrum-Code .spectrum-Code-emphasized,
.spectrum-Code em {
    font-style: var(--mod-code-emphasized-font-style, var(--spectrum-code-emphasized-font-style));
    font-weight: var(--mod-code-emphasized-font-weight, var(--spectrum-code-emphasized-font-weight));
}

.spectrum-Code .spectrum-Code-strong.spectrum-Code-emphasized,
.spectrum-Code em strong,
.spectrum-Code strong em {
    font-style: var(--mod-code-strong-emphasized-font-style, var(--spectrum-code-strong-emphasized-font-style));
    font-weight: var(--mod-code-strong-emphasized-font-weight, var(--spectrum-code-strong-emphasized-font-weight));
}

.spectrum-Code:lang(ja),
.spectrum-Code:lang(ko),
.spectrum-Code:lang(zh) {
    font-family: var(--mod-code-cjk-font-family, var(--spectrum-code-cjk-font-family));
    font-style: var(--mod-code-cjk-font-style, var(--spectrum-code-cjk-font-style));
    font-weight: var(--mod-code-cjk-font-weight, var(--spectrum-code-cjk-font-weight));
    line-height: var(--mod-code-cjk-line-height, var(--spectrum-code-cjk-line-height));
    letter-spacing: var(--mod-code-cjk-letter-spacing, var(--spectrum-code-cjk-letter-spacing));
}

.spectrum-Code:lang(ja) .spectrum-Code-strong,
.spectrum-Code:lang(ja) strong,
.spectrum-Code:lang(ko) .spectrum-Code-strong,
.spectrum-Code:lang(ko) strong,
.spectrum-Code:lang(zh) .spectrum-Code-strong,
.spectrum-Code:lang(zh) strong {
    font-style: var(--mod-code-cjk-strong-font-style, var(--spectrum-code-cjk-strong-font-style));
    font-weight: var(--mod-code-cjk-strong-font-weight, var(--spectrum-code-cjk-strong-font-weight));
}

.spectrum-Code:lang(ja) .spectrum-Code-emphasized,
.spectrum-Code:lang(ja) em,
.spectrum-Code:lang(ko) .spectrum-Code-emphasized,
.spectrum-Code:lang(ko) em,
.spectrum-Code:lang(zh) .spectrum-Code-emphasized,
.spectrum-Code:lang(zh) em {
    font-style: var(--mod-code-cjk-emphasized-font-style, var(--spectrum-code-cjk-emphasized-font-style));
    font-weight: var(--mod-code-cjk-emphasized-font-weight, var(--spectrum-code-cjk-emphasized-font-weight));
}

.spectrum-Code:lang(ja) .spectrum-Code-strong.spectrum-Code-emphasized,
.spectrum-Code:lang(ja) em strong,
.spectrum-Code:lang(ja) strong em,
.spectrum-Code:lang(ko) .spectrum-Code-strong.spectrum-Code-emphasized,
.spectrum-Code:lang(ko) em strong,
.spectrum-Code:lang(ko) strong em,
.spectrum-Code:lang(zh) .spectrum-Code-strong.spectrum-Code-emphasized,
.spectrum-Code:lang(zh) em strong,
.spectrum-Code:lang(zh) strong em {
    font-style: var(--mod-code-cjk-strong-emphasized-font-style, var(--spectrum-code-cjk-strong-emphasized-font-style));
    font-weight: var(--mod-code-cjk-strong-emphasized-font-weight, var(--spectrum-code-cjk-strong-emphasized-font-weight));
}
