/* WPSolutionsPRO 2.5.1: code blocks in articles (dark theme, line numbers, copy button). */
.wsp-code {
    --code-bg: #0f172a;
    --code-bar: #111c33;
    --code-border: #1e2a44;
    --code-text: #e2e8f0;
    --code-muted: #64748b;
    margin: 28px 0;
    border: 1px solid var(--code-border);
    border-radius: 14px;
    background: var(--code-bg);
    overflow: hidden;
    box-shadow: 0 18px 40px -24px rgba(15, 23, 42, .55);
    font-size: 14px;
    text-align: left;
}
.wsp-code__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 9px 16px;
    background: var(--code-bar);
    border-bottom: 1px solid var(--code-border);
    color: #94a3b8;
    font: 600 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.wsp-code__dots { display: inline-flex; gap: 6px; margin-right: 6px; }
.wsp-code__dots i { width: 10px; height: 10px; border-radius: 50%; background: #334155; }
.wsp-code__dots i:nth-child(1) { background: #f87171; }
.wsp-code__dots i:nth-child(2) { background: #fbbf24; }
.wsp-code__dots i:nth-child(3) { background: #34d399; }
.wsp-code__lang { margin-right: auto; }
.wsp-code__copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    font: 600 12px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
}
.wsp-code__copy:hover { background: #1e293b; color: #fff; }
.wsp-code__copy:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.wsp-code__copy.is-done { border-color: #22c55e; color: #4ade80; }
.wsp-code__copy svg { flex: none; }

.wsp-code pre.wsp-code__pre {
    display: flex;
    margin: 0;
    padding: 16px 0;
    max-height: 640px;
    overflow: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--code-text);
    font: 400 14px/1.65 ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
    tab-size: 4;
    white-space: pre;
    word-wrap: normal;
    -webkit-overflow-scrolling: touch;
}
/* Stronger than the theme's inline-code rule (.blog-single-area .entry-content code: dark text, .88em, padding),
   which made brackets and commas invisible and shifted lines against the line numbers. */
figure.wsp-code pre.wsp-code__pre > code {
    display: block;
    flex: 1 0 auto;
    margin: 0;
    padding: 0 20px;
    background: none !important;
    border: 0;
    border-radius: 0;
    color: var(--code-text) !important;
    font: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
    word-break: normal;
    box-shadow: none;
}
.wsp-code__gutter {
    position: sticky;
    left: 0;
    flex: none;
    min-width: 44px;
    padding: 0 12px 0 14px;
    background: var(--code-bg);
    border-right: 1px solid var(--code-border);
    color: var(--code-muted);
    text-align: right;
    white-space: pre;
    user-select: none;
    -webkit-user-select: none;
}
.wsp-code__pre::-webkit-scrollbar { height: 10px; width: 10px; }
.wsp-code__pre::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; border: 2px solid var(--code-bg); }

/* Tokens (GitHub-dark-like palette). */
.wsp-code .tk-c { color: #7c8aa5; font-style: italic; }
.wsp-code .tk-s { color: #a5d6ff; }
.wsp-code .tk-k { color: #ff7b72; }
.wsp-code .tk-f { color: #d2a8ff; }
.wsp-code .tk-v { color: #ffa657; }
.wsp-code .tk-n { color: #79c0ff; }
.wsp-code .tk-y { color: #7ee787; }
.wsp-code .tk-p { color: #79c0ff; }
.wsp-code .tk-t { color: #ff7b72; }
.wsp-code .tk-o { color: #e2e8f0; }
.wsp-code .wsp-code__pre ::selection { background: rgba(96, 165, 250, .35); }

@media (max-width: 575px) {
    .wsp-code { margin: 22px -12px; border-radius: 10px; font-size: 13px; }
    .wsp-code pre.wsp-code__pre { font-size: 12.5px; }
    .wsp-code__dots { display: none; }
}
@media print {
    .wsp-code { background: #fff; box-shadow: none; border-color: #ccc; }
    .wsp-code pre.wsp-code__pre { color: #000; max-height: none; white-space: pre-wrap; }
    figure.wsp-code pre.wsp-code__pre > code { color: #000 !important; white-space: pre-wrap; }
    .wsp-code__copy, .wsp-code__gutter { display: none; }
}
