/* MyST Theme Options */

:root {
  --cite-group-open: '[';
  --cite-group-close: ']';
}

/* User Provided Stylesheet */

:root {
    --blue: #00509b;
    --indigo: #6610f2;
    --purple: #6f42c1;
    --pink: #e83e8c;
    --red: #eb1c50;
    --orange: #fd7e14;
    --yellow: #ffc107;
    --green: #00c458;
    --light-green: #94d498;
    --teal: #20c997;
    --cyan: #17a2b8;
    --gray: #6e6e6e;
    --gray-dark: #2b2b2b;
    --bright-blue: #00c8ff;
    --gray-light: #c9c9c9;
    --primary: #00509b;
    --secondary: #00c8ff;
    --success: #00c458;
    --info: #00c8ff;
    --warning: #ffc107;
    --danger: #eb1c50;
    --light: #c9c9c9;
    --dark: #1c1c1c;
    --medium-blue: #018dca;
    --white: #fff;
    --off-white: #f5f5f5;
    --medium: #6e6e6e;
    --black: #000;
}

body {
    background-color: var(--white) !important;
    color: var(--dark) !important;
}

code:not([class]) {
    color: var(--green) !important;
}

.article:is(.dark *) {
    background-color: var(--dark) !important;
    color: var(--light) !important;
}

button:is(.dark *) {
    background-color: var(--dark) !important;
    color: var(--gray) !important;
    border-color: var(--blue) !important;
}

.article a:link:is(.dark *) {
    color: var(--cyan) !important;
}

.article a:visited:is(.dark *) {
    color: var(--primary) !important;
}

.article a:hover:is(.dark *),
a:active:is(.dark *) {
    color: var(--secondary) !important;
    font-weight: bold;
}


/* TLA+ syntax highlighting - code block container */
.tla-code-block {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.9em;
    line-height: 1.5;
    padding: 1em;
    background-color: var(--off-white);
    border-radius: 6px;
    overflow-x: auto;
    white-space: pre;
    margin-bottom: 1.5em;
}

/* TLA+ line numbers layout */
.tla-with-line-numbers {
    padding: 0.5em 0;
    white-space: normal;
}

.tla-line {
    display: flex;
    min-height: 1.5em;
}

.tla-line-number {
    display: inline-block;
    width: 3em;
    padding-right: 1em;
    text-align: right;
    color: var(--gray);
    user-select: none;
    flex-shrink: 0;
    font-size: 0.85em;
    opacity: 0.6;
}

.tla-line-content {
    flex: 1;
    white-space: pre;
}

/* TLA+ syntax highlighting - token colors (light mode) */
.tla-keyword {
    color: var(--blue);
    font-weight: bold;
}

.tla-builtin {
    color: var(--purple);
}

.tla-comment {
    color: var(--medium);
    font-style: italic;
}

.tla-string {
    color: var(--red);
}

.tla-number {
    color: var(--green);
}

.tla-operator {
    color: var(--blue);
}

.tla-int-operator {
    color: var(--orange);
}

.tla-custom {
    color: var(--teal);
}

/* TLA+ syntax highlighting - dark mode */
.tla-code-block:is(.dark *) {
    background-color: var(--gray-dark);
}

.tla-keyword:is(.dark *) {
    color: var(--bright-blue);
}

.tla-builtin:is(.dark *) {
    color: var(--teal);
}

.tla-comment:is(.dark *) {
    color: var(--medium);
}

.tla-string:is(.dark *) {
    color: var(--orange);
}

.tla-number:is(.dark *) {
    color: var(--green);
}

.tla-operator:is(.dark *) {
    color: var(--cyan);
}

.tla-int-operator:is(.dark *) {
    color: var(--yellow);
}

.tla-custom:is(.dark *) {
    color: var(--purple);
}

/* ByMC / .ta syntax highlighting - code block container */
.ta-code-block {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.9em;
    line-height: 1.5;
    padding: 1em;
    background-color: var(--off-white);
    border-radius: 6px;
    overflow-x: auto;
    white-space: pre;
    margin-bottom: 1.5em;
}

/* ByMC line numbers layout */
.ta-with-line-numbers {
    padding: 0.5em 0;
    white-space: normal;
}

.ta-line {
    display: flex;
    min-height: 1.5em;
}

.ta-line-number {
    display: inline-block;
    width: 3em;
    padding-right: 1em;
    text-align: right;
    color: var(--gray);
    user-select: none;
    flex-shrink: 0;
    font-size: 0.85em;
    opacity: 0.6;
}

.ta-line-content {
    flex: 1;
    white-space: pre;
}

/* ByMC syntax highlighting - token colors (light mode) */
.ta-keyword {
    color: var(--purple);
    font-weight: bold;
}

.ta-block {
    color: var(--blue);
    font-weight: bold;
}

.ta-rule {
    color: var(--teal);
    font-weight: bold;
}

.ta-builtin {
    color: var(--indigo);
}

.ta-comment {
    color: var(--medium);
    font-style: italic;
}

.ta-string {
    color: var(--red);
}

.ta-number {
    color: var(--green);
}

.ta-operator {
    color: var(--orange);
}

/* ByMC syntax highlighting - dark mode */
.ta-code-block:is(.dark *) {
    background-color: var(--gray-dark);
}

.ta-keyword:is(.dark *) {
    color: var(--pink);
}

.ta-block:is(.dark *) {
    color: var(--bright-blue);
}

.ta-rule:is(.dark *) {
    color: var(--teal);
}

.ta-builtin:is(.dark *) {
    color: var(--purple);
}

.ta-comment:is(.dark *) {
    color: var(--medium);
}

.ta-string:is(.dark *) {
    color: var(--orange);
}

.ta-number:is(.dark *) {
    color: var(--green);
}

.ta-operator:is(.dark *) {
    color: var(--yellow);
}

/* Light/Dark mode specific visibility */
.only-dark {
    display: none !important;
}

:is(.dark *) .only-dark {
    display: inline-block !important;
}

:is(.dark *) .only-light {
    display: none !important;
}
