/* Shared code styling for learning materials + quizzes.
   Notes:
   - Markdown-rendered content uses `.markdown-content`.
   - HTML materials and various rendered blocks use `.content-body`.
*/

.markdown-content code,
.content-body code {
    padding: 0.2em 0.4em;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: inherit;
}

.markdown-content pre,
.content-body pre {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    overflow-x: auto;
    font-size: inherit;
    line-height: 1.4;
    tab-size: 4;
}

.ea-code-block {
    position: relative;
    padding-top: 2.5rem; /* space for the copy button */
}

.ea-code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1;
}

.ea-code-block--copied .ea-code-copy-btn {
    border-color: #198754;
    color: #198754;
}

.markdown-content pre code,
.content-body pre code {
    padding: 0;
    background-color: transparent;
    font-size: inherit;
    white-space: pre;
}
