/* Preserve JustNews typography/radii; only imported blocks get auto overflow. */
.entry .entry-content blockquote.jnc-callout {
    --jnc-callout-color: var(--theme-color, #1677ff);
    margin: 1.25em 0;
    padding: 16px 20px;
    border: 1px solid var(--theme-line-color, #ddd);
    border-left: 3px solid var(--jnc-callout-color);
    border-radius: var(--theme-border-radius-m, 6px);
    background: var(--theme-el-bg-color, #fff);
    background: color-mix(in srgb, var(--jnc-callout-color) 7%, var(--theme-el-bg-color, #fff));
    color: inherit;
    font: inherit;
    text-indent: 0;
    overflow-wrap: anywhere;
}

.entry .entry-content .jnc-callout[data-jnc-callout="warning"] { --jnc-callout-color: #b77812; }
.entry .entry-content .jnc-callout[data-jnc-callout="danger"],
.entry .entry-content .jnc-callout[data-jnc-callout="bug"] { --jnc-callout-color: #d84b4b; }
.entry .entry-content .jnc-callout[data-jnc-callout="success"],
.entry .entry-content .jnc-callout[data-jnc-callout="tip"] { --jnc-callout-color: #238357; }
.entry .entry-content .jnc-callout[data-jnc-callout="example"] { --jnc-callout-color: #8754b5; }
.style-for-dark .entry .entry-content blockquote.jnc-callout {
    --jnc-callout-color: #83b5ff;
    --jnc-callout-color: color-mix(in srgb, var(--theme-color, #1677ff) 65%, #fff);
}
.style-for-dark .entry .entry-content .jnc-callout[data-jnc-callout="warning"] { --jnc-callout-color: #e5b057; }
.style-for-dark .entry .entry-content .jnc-callout[data-jnc-callout="danger"],
.style-for-dark .entry .entry-content .jnc-callout[data-jnc-callout="bug"] { --jnc-callout-color: #f28e8e; }
.style-for-dark .entry .entry-content .jnc-callout[data-jnc-callout="success"],
.style-for-dark .entry .entry-content .jnc-callout[data-jnc-callout="tip"] { --jnc-callout-color: #79c6a0; }
.style-for-dark .entry .entry-content .jnc-callout[data-jnc-callout="example"] { --jnc-callout-color: #c2a0e6; }
.entry .entry-content blockquote.jnc-callout::before,
.entry .entry-content blockquote.jnc-callout::after { content: none; }

.jnc-callout-title {
    display: flex;
    align-items: baseline;
    gap: 0.5em;
    color: var(--jnc-callout-color);
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 0.5em;
}

.jnc-callout-icon { flex: none; min-width: 1em; text-align: center; }
.jnc-callout-title > span:last-child { min-width: 0; }
.jnc-callout-body { min-width: 0; }
.entry .entry-content .jnc-callout-body > :first-child { margin-top: 0; }
.entry .entry-content .jnc-callout-body > :last-child { margin-bottom: 0; }

.entry-content .wp-block-wpcom-hljs.jnc-code-tools {
    border-radius: var(--theme-border-radius-m, 6px);
    overflow: hidden;
    background: #282c34;
    color: #c5c9d3;
}

.entry-content .jnc-code-tools > .jnc-code-language {
    display: none;
    position: absolute;
    z-index: 1;
    top: 12px;
    right: 56px;
    max-width: calc(100% - 84px);
    padding: 4px 6px;
    border-radius: 3px;
    background: #282c34;
    color: #c5c9d3;
    font-size: 12px;
    line-height: 1.5;
    text-indent: 0;
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-content .jnc-code-tools:hover > .jnc-code-language,
.entry-content .jnc-code-tools:has(:focus-visible) > .jnc-code-language,
.entry-content .jnc-code-tools:has(:focus-visible) > .copy-btn { display: block; }

.jnc-code-footer {
    position: relative;
    background: #282c34;
    text-align: center;
}

.jnc-code-is-collapsed > .jnc-code-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -42px;
    height: 42px;
    background: linear-gradient(to bottom, transparent, #282c34);
    pointer-events: none;
}

.entry-content button.jnc-code-toggle {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 9px 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #bfc6d1;
    font: inherit;
    font-size: 12px;
    line-height: 1.5;
    cursor: pointer;
    white-space: nowrap;
}

.entry-content button.jnc-code-toggle:hover { color: #fff; }
.entry-content button.jnc-code-toggle[hidden],
.jnc-code-footer[hidden] { display: none !important; }
.entry-content button.jnc-code-toggle:focus-visible {
    outline: 2px solid var(--theme-color, #1677ff);
    outline-offset: -3px;
}

.entry .entry-content .jnc-code-tools > pre {
    box-sizing: border-box;
    margin: 0;
    border-radius: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.entry .entry-content .jnc-code-tools > pre.jnc-code-collapsed { max-height: var(--jnc-code-height); padding-bottom: 0; }

.entry-content li.jnc-task-list-item {
    position: relative;
    list-style-type: none;
}

/* Read-only native controls; completed prose retains its original formatting. */
.entry-content input.jnc-task-checkbox {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    left: -1.4em;
    top: 0.35em;
    top: calc((1lh - 1em) / 2);
    box-sizing: border-box;
    display: inline-block;
    width: 1em;
    height: 1em;
    padding: 0;
    margin: 0;
    border: 1px solid var(--theme-gray-color, #777);
    border-radius: 3px;
    background: var(--theme-el-bg-color, #fff);
    font: inherit;
    opacity: 1;
}

.entry-content input.jnc-task-checkbox:checked {
    border-color: var(--theme-color, #1677ff);
    background: var(--theme-color, #1677ff);
}

.entry-content input.jnc-task-checkbox:checked::after {
    content: "";
    position: absolute;
    top: 0.08em;
    left: 0.29em;
    width: 0.27em;
    height: 0.53em;
    border: solid #fff;
    border-width: 0 0.12em 0.12em 0;
    transform: rotate(45deg);
}

@media (forced-colors: active) {
    .entry-content input.jnc-task-checkbox {
        -webkit-appearance: auto;
        appearance: auto;
    }
    .entry-content input.jnc-task-checkbox:checked::after { display: none; }
}

.entry .entry-content pre.jnc-code-block {
    overflow-x: auto;
}

.entry-content pre.jnc-code-block:focus-visible {
    outline: 2px solid var(--theme-color, #1677ff);
    outline-offset: 2px;
}

.wp-block-wpcom-hljs > .copy-btn[data-jnc-copy]:focus-visible {
    display: block;
    outline: 2px solid var(--theme-color, #1677ff);
    outline-offset: 2px;
}

@media (hover: none) {
    /* Persistent touch tools need clearance so the first line remains readable. */
    .entry .entry-content .jnc-code-tools > pre { padding-top: calc(2em + 24px); }
    .entry-content .jnc-code-tools > .copy-btn,
    .entry-content .jnc-code-tools > .jnc-code-language {
        display: block;
    }
}

.entry-content .jnc-math {
    text-indent: 0;
}

.entry-content .jnc-math > mjx-container {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0;
    text-indent: 0;
}

/* Grid uses the glyph row's baseline, not the scrollport's bottom edge. */
.entry-content .jnc-math:not(.jnc-math-display) > mjx-container {
    display: inline-grid;
}

.entry-content .jnc-math:not(.jnc-math-display) > mjx-container > svg {
    display: block;
}

.entry-content .jnc-math-display {
    display: block;
    max-width: 100%;
    margin: 1em 0;
    text-align: center;
    overflow-x: auto;
    overflow-y: hidden;
}

.entry-content .jnc-math-display > mjx-container {
    overflow: visible;
    max-width: none;
}

.entry-content .jnc-math svg {
    display: inline;
    max-width: none;
    overflow: visible;
}

.entry-content .jnc-mermaid {
    max-width: 100%;
    min-width: 0;
    margin: 1.25em 0;
    text-indent: 0;
}

.entry-content .jnc-mermaid-output {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    text-align: center;
}

.entry-content .jnc-mermaid-output > svg {
    display: block;
    margin: 0 auto;
    height: auto;
    max-width: 100%;
}

.entry .entry-content .jnc-mermaid pre {
    overflow-x: auto;
}

.entry-content .jnc-mermaid [hidden] {
    display: none !important;
}

.entry-content .jnc-content-error {
    margin: 0.5em 0;
    color: var(--theme-gray-color, #777);
    font-size: 0.875em;
    text-indent: 0;
}
