/* Interactive jq runner. Colors come from PaperMod's theme variables so the
   widget follows light and dark mode without a second palette. */

.jq-playground {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 24px 0;
    background: var(--code-bg);
}

.jq-playground__row {
    margin-bottom: 12px;
}

.jq-playground__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary);
    margin-bottom: 6px;
}

.jq-playground__json,
.jq-playground__filter,
.jq-playground__out {
    width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px;
    background: var(--theme);
    color: var(--content);
}

.jq-playground__json {
    resize: vertical;
    min-height: 120px;
}

.jq-playground__filter {
    /* The filter is the part people edit most, so give it the accent. */
    font-weight: 600;
}

.jq-playground__json:focus,
.jq-playground__filter:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.jq-playground__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.jq-playground__run {
    /* 48px min target: the widget is used on phones too. */
    min-height: 48px;
    min-width: 96px;
    padding: 0 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 0;
    border-radius: 4px;
    background: var(--primary);
    color: var(--theme);
}

.jq-playground__run:hover:not(:disabled) {
    opacity: 0.85;
}

.jq-playground__run:disabled {
    opacity: 0.5;
    cursor: progress;
}

.jq-playground__status {
    font-size: 0.85rem;
    color: var(--secondary);
}

.jq-playground__out {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 60px;
    max-height: 420px;
    overflow: auto;
}

.jq-playground__out.is-error {
    color: #c0392b;
    border-color: #c0392b;
}

.jq-playground__noscript {
    font-size: 0.9rem;
    color: var(--secondary);
    margin: 0;
}

@media (max-width: 480px) {
    .jq-playground {
        padding: 12px;
    }

    .jq-playground__run {
        width: 100%;
    }
}
