/* =============================================================
   R316 Code Block — Styles
   Works in both the Gutenberg editor and on the frontend.
   ============================================================= */

/* Wrapper */
.r316-code-block-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 1.5em;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

/* Header bar — holds the language label + copy button */
.r316-code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #1a1a2e;
    padding: 6px 14px;
    min-height: 36px;
}

/* Language label */
.r316-code-block-label {
    font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a78bfa; /* soft purple — matches a typical R316 feminine palette */
}

/* Copy button */
.r316-code-block-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: 5px;
    padding: 3px 10px;
    cursor: pointer;
    color: #c4b5fd;
    font-size: 12px;
    font-family: inherit;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.r316-code-block-copy:hover,
.r316-code-block-copy:focus-visible {
    background: rgba(167, 139, 250, 0.15);
    border-color: #a78bfa;
    color: #ede9fe;
    outline: none;
}

.r316-code-block-copy[data-copied="true"] {
    color: #6ee7b7;
    border-color: rgba(110, 231, 183, 0.5);
}

/* Editor-only "Copy" label (non-interactive) */
.r316-code-block-copy--editor {
    pointer-events: none;
    opacity: 0.6;
}

/* Prism <pre> reset — remove Prism's default margin */
.r316-code-block-wrapper > pre[class*="language-"] {
    margin: 0;
    border-radius: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    background: #1e1e2e; /* consistent dark bg */
    padding: 20px 22px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.7;
}

/* Scrollbar styling */
.r316-code-block-wrapper > pre[class*="language-"]::-webkit-scrollbar {
    height: 5px;
}
.r316-code-block-wrapper > pre[class*="language-"]::-webkit-scrollbar-track {
    background: #1e1e2e;
}
.r316-code-block-wrapper > pre[class*="language-"]::-webkit-scrollbar-thumb {
    background: #4c3b6e;
    border-radius: 3px;
}

/* ======================
   Editor-specific styles
   ====================== */
.r316-code-block-editor-area {
    background: #1e1e2e;
    padding: 16px 20px;
}

.r316-code-plain-text {
    width: 100%;
    min-height: 120px;
    background: transparent !important;
    color: #cdd6f4 !important;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
    font-size: 13.5px !important;
    line-height: 1.7 !important;
    border: none !important;
    box-shadow: none !important;
    resize: vertical;
    caret-color: #a78bfa;
}

.r316-code-plain-text:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Editor wrapper reset */
.r316-code-block-editor-wrapper {
    padding: 0 !important;
}
