/*
 * RebelScience article rendering layer.
 *
 * Loaded only for singular posts. This changes presentation without filtering,
 * rewriting, or otherwise mutating Gutenberg content saved in the database.
 */

body.single-post .card-single-article .card_title {
    color: #f4f4f6;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1.6rem, 1.36rem + 0.72vw, 2.08rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.18;
    max-width: 100%;
    text-wrap: pretty;
    width: 100%;
}

body.single-post .card-single-article > .fairy-metas {
    min-width: 0;
    width: 100%;
}

body.single-post .card-single-article .entry-content {
    color: #dedee3;
    font-family: "Muli", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1.04rem, 1rem + 0.18vw, 1.12rem);
    line-height: 1.78;
    overflow-wrap: break-word;
    min-width: 0;
}

body.single-post .entry-content > :first-child {
    margin-top: 0;
}

body.single-post .entry-content > :last-child {
    margin-bottom: 0;
}

body.single-post .entry-content p {
    line-height: inherit;
    margin: 0 0 1.2em;
}

body.single-post .entry-content h1,
body.single-post .entry-content h2,
body.single-post .entry-content h3,
body.single-post .entry-content h4,
body.single-post .entry-content h5,
body.single-post .entry-content h6 {
    color: #f3f3f5;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    letter-spacing: -0.018em;
    line-height: 1.3;
    margin-bottom: 0.65em;
    margin-top: 1.8em;
    text-wrap: pretty;
}

body.single-post .entry-content h2 {
    font-size: clamp(1.38rem, 1.25rem + 0.42vw, 1.7rem);
}

body.single-post .entry-content h3 {
    font-size: clamp(1.2rem, 1.12rem + 0.28vw, 1.42rem);
}

body.single-post .entry-content h4,
body.single-post .entry-content h5,
body.single-post .entry-content h6 {
    font-size: clamp(1.06rem, 1rem + 0.2vw, 1.2rem);
}

body.single-post .entry-content a {
    color: #7db7ff;
    text-decoration-color: rgba(125, 183, 255, 0.42);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    transition: color 160ms ease, text-decoration-color 160ms ease;
}

body.single-post .entry-content a:hover,
body.single-post .entry-content a:focus-visible {
    color: #b4d4ff;
    text-decoration-color: #cd3636;
}

body.single-post .entry-content a:focus-visible {
    border-radius: 3px;
    outline: 2px solid rgba(125, 183, 255, 0.65);
    outline-offset: 3px;
}

body.single-post .entry-content strong,
body.single-post .entry-content b {
    color: #f1f1f3;
    font-weight: 700;
}

body.single-post .entry-content mark {
    background: rgba(96, 165, 250, 0.2);
    border-radius: 0.16em;
    color: #dbeafe;
    padding: 0.04em 0.16em;
}

/* Inline code remains compact and can wrap instead of widening the page. */
body.single-post .entry-content p > code,
body.single-post .entry-content li > code,
body.single-post .entry-content td > code,
body.single-post .entry-content th > code,
body.single-post .entry-content figcaption > code,
body.single-post .entry-content h2 > code,
body.single-post .entry-content h3 > code,
body.single-post .entry-content h4 > code {
    -webkit-box-decoration-break: clone;
    background: #232327;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.28em;
    box-decoration-break: clone;
    color: #9ed0ff;
    font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
    overflow-wrap: anywhere;
    padding: 0.12em 0.34em;
}

/* Native/preformatted blocks and the CodeMirror fallback shown before JS loads. */
body.single-post .entry-content pre:not(.CodeMirror):not(.CodeMirror-line):not(.CodeMirror-line-like),
body.single-post .entry-content .wp-block-code,
body.single-post .entry-content .wp-block-preformatted,
body.single-post .entry-content .code-block > pre.CodeMirror {
    background: #161619;
    border: 1px solid rgba(255, 255, 255, 0.105);
    border-radius: 9px;
    color: #e8e8ec;
    font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    line-height: 1.62;
    margin: 1.65rem 0;
    max-width: 100%;
    overflow: auto;
    padding: 1.15rem 1.2rem;
    tab-size: 4;
    white-space: pre;
    word-wrap: normal;
    -webkit-overflow-scrolling: touch;
}

body.single-post .entry-content pre code,
body.single-post .entry-content .wp-block-code code {
    background: transparent;
    border: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
}

/* CodeMirror Blocks: one restrained Rebel surface regardless of plugin theme. */
body.single-post .entry-content .code-block {
    background: #17171a !important;
    border: 1px solid rgba(255, 255, 255, 0.085) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    margin: 1.75rem 0 1.9rem;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

body.single-post .entry-content .code-block > pre.CodeMirror {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

body.single-post .entry-content .code-block .CodeMirror {
    background: #17171a !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #e8e8ec;
    font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    height: auto !important;
    line-height: 1.62;
    max-width: 100%;
    min-width: 0;
    text-shadow: none;
}

body.single-post .entry-content .code-block .CodeMirror.max-height {
    height: auto !important;
    padding-bottom: 0 !important;
}

body.single-post .entry-content .code-block .CodeMirror-scroll {
    margin: 0 !important;
    max-height: none;
    min-height: 0;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 !important;
    -webkit-overflow-scrolling: touch;
}

body.single-post .entry-content .code-block .CodeMirror-lines {
    padding: 0.85rem 0 0.9rem;
}

body.single-post .entry-content .code-block .CodeMirror pre.CodeMirror-line,
body.single-post .entry-content .code-block .CodeMirror pre.CodeMirror-line-like {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
    max-width: none;
    overflow: visible;
    padding: 0 1.15rem;
    white-space: pre;
    word-wrap: normal;
}

body.single-post .entry-content .code-block .CodeMirror-gutters {
    background: #17171a !important;
    border-right: 1px solid rgba(255, 255, 255, 0.055) !important;
}

body.single-post .entry-content .code-block .CodeMirror-linenumber {
    color: #656570;
    padding: 0 0.7rem 0 0.55rem;
}

body.single-post .entry-content .code-block .CodeMirror-cursor {
    border-left-color: #e8e8ec;
}

body.single-post .entry-content .code-block .CodeMirror-fullscreen .CodeMirror-scroll {
    height: 100%;
    max-height: none;
}

body.single-post .entry-content .code-block .CodeMirror-selected,
body.single-post .entry-content .code-block .CodeMirror-line::selection,
body.single-post .entry-content .code-block .CodeMirror-line > span::selection,
body.single-post .entry-content .code-block .CodeMirror-line > span > span::selection {
    background: rgba(96, 165, 250, 0.26);
}

body.single-post .entry-content .code-block .CodeMirror-panel {
    background: #17171a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
    color: #a9a9b1;
}

body.single-post .entry-content .code-block .CodeMirror-panel .info-panel {
    align-items: center;
    height: 2.35rem;
}

body.single-post .entry-content .code-block .CodeMirror-panel .info-panel .language {
    align-items: center;
    align-self: stretch;
    background: transparent !important;
    border-left: 3px solid #cd3636;
    color: #e9e9ec !important;
    display: inline-flex;
    font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    padding: 0 0.9rem;
    text-transform: uppercase;
}

body.single-post .entry-content .code-block .CodeMirror-panel .control-panel {
    align-items: center;
    color: #a9a9b1;
    gap: 0.2rem;
    padding: 0.35rem 0.7rem;
}

body.single-post .entry-content .code-block .CodeMirror-panel .control-panel > span {
    border-radius: 4px;
    margin: 0;
    padding: 0.16rem;
}

body.single-post .entry-content .code-block .CodeMirror-panel .control-panel > span:hover,
body.single-post .entry-content .code-block .CodeMirror-panel .control-panel > span:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    color: #f5f5f6;
    outline: none;
}

/* A consistent, accessible syntax palette overrides the old yellow-heavy themes. */
body.single-post .entry-content .CodeMirror .cm-comment { color: #7f8c98; font-style: italic; }
body.single-post .entry-content .CodeMirror .cm-keyword { color: #c792ea; }
body.single-post .entry-content .CodeMirror .cm-atom,
body.single-post .entry-content .CodeMirror .cm-number { color: #f5b97b; }
body.single-post .entry-content .CodeMirror .cm-def { color: #82baff; }
body.single-post .entry-content .CodeMirror .cm-variable { color: #e8e8ec; }
body.single-post .entry-content .CodeMirror .cm-variable-2,
body.single-post .entry-content .CodeMirror .cm-variable-3 { color: #7dd3c7; }
body.single-post .entry-content .CodeMirror .cm-property { color: #9ecbff; }
body.single-post .entry-content .CodeMirror .cm-operator { color: #f0719b; }
body.single-post .entry-content .CodeMirror .cm-string,
body.single-post .entry-content .CodeMirror .cm-string-2 { color: #addb91; }
body.single-post .entry-content .CodeMirror .cm-builtin { color: #ffcb6b; }
body.single-post .entry-content .CodeMirror .cm-tag { color: #f07178; }
body.single-post .entry-content .CodeMirror .cm-attribute { color: #c3e88d; }
body.single-post .entry-content .CodeMirror .cm-meta { color: #ffcb6b; }
body.single-post .entry-content .CodeMirror .cm-qualifier { color: #89ddff; }
body.single-post .entry-content .CodeMirror .cm-bracket { color: #b2ccd6; }
body.single-post .entry-content .CodeMirror .cm-error { color: #ff6b6b; }

body.single-post .entry-content .CodeMirror-simplescroll-horizontal,
body.single-post .entry-content .CodeMirror-simplescroll-vertical {
    display: none !important;
}

body.single-post .entry-content .code-block .CodeMirror-vscrollbar,
body.single-post .entry-content .code-block .CodeMirror-hscrollbar,
body.single-post .entry-content .code-block .CodeMirror-scrollbar-filler,
body.single-post .entry-content .code-block .CodeMirror-gutter-filler {
    display: none !important;
}

body.single-post .entry-content .code-block .CodeMirror-scroll::-webkit-scrollbar,
body.single-post .entry-content pre::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

body.single-post .entry-content .code-block .CodeMirror-scroll::-webkit-scrollbar-track,
body.single-post .entry-content pre::-webkit-scrollbar-track {
    background: #17171a;
}

body.single-post .entry-content .code-block .CodeMirror-scroll::-webkit-scrollbar-thumb,
body.single-post .entry-content pre::-webkit-scrollbar-thumb {
    background: #44444c;
    border: 2px solid #17171a;
    border-radius: 999px;
}

/* Lists, quotes, separators, and tabular content. */
body.single-post .entry-content ul,
body.single-post .entry-content ol {
    margin: 0 0 1.25em;
    padding-left: 1.35em;
}

body.single-post .entry-content li {
    margin: 0.36em 0;
    padding-left: 0.22em;
}

body.single-post .entry-content li::marker {
    color: #8e8e98;
}

body.single-post .entry-content blockquote,
body.single-post .entry-content .wp-block-quote {
    background: rgba(255, 255, 255, 0.025);
    border-left: 3px solid #cd3636;
    color: #d3d3d9;
    margin: 1.65rem 0;
    padding: 1rem 1.15rem;
}

body.single-post .entry-content blockquote p:last-child {
    margin-bottom: 0;
}

body.single-post .entry-content cite {
    color: #9a9aa3;
    font-size: 0.86em;
}

body.single-post .entry-content hr,
body.single-post .entry-content .wp-block-separator {
    background: linear-gradient(90deg, #cd3636 0 2.75rem, rgba(255, 255, 255, 0.09) 2.75rem 100%);
    border: 0;
    height: 1px;
    margin: 2.2rem 0;
    max-width: none;
}

body.single-post .entry-content table {
    border-collapse: collapse;
    display: block;
    font-size: 0.94em;
    margin: 1.6rem 0;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

body.single-post .entry-content th,
body.single-post .entry-content td {
    border-color: rgba(255, 255, 255, 0.1);
    padding: 0.65rem 0.8rem;
}

body.single-post .entry-content th {
    background: #202024;
    color: #f0f0f2;
}

/* Media keeps its authored dimensions but can never force mobile overflow. */
body.single-post .entry-content figure,
body.single-post .entry-content .wp-block-image,
body.single-post .entry-content .wp-block-gallery,
body.single-post .entry-content .wp-block-embed,
body.single-post .entry-content .wp-block-video,
body.single-post .entry-content .wp-block-audio {
    max-width: 100%;
}

body.single-post .entry-content img,
body.single-post .entry-content video {
    border-radius: 9px;
    height: auto;
    max-width: 100%;
}

body.single-post .entry-content .wp-block-image img,
body.single-post .entry-content .wp-block-gallery img {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

body.single-post .entry-content figcaption,
body.single-post .entry-content .wp-element-caption {
    color: #9797a0;
    font-size: 0.82em;
    line-height: 1.55;
    margin-top: 0.55rem;
    text-align: center;
}

body.single-post .entry-content iframe,
body.single-post .entry-content embed,
body.single-post .entry-content object {
    border: 0;
    max-width: 100%;
}

body.single-post .entry-content .wp-block-embed__wrapper {
    max-width: 100%;
}

body.single-post .entry-content .wp-has-aspect-ratio .wp-block-embed__wrapper {
    height: 0;
    overflow: hidden;
    padding-top: 56.25%;
    position: relative;
}

body.single-post .entry-content .wp-has-aspect-ratio .wp-block-embed__wrapper iframe {
    height: 100%;
    inset: 0;
    position: absolute;
    width: 100%;
}

body.single-post .entry-content audio {
    max-width: 100%;
    width: 100%;
}

@media (max-width: 767px) {
    body.single-post .card-single-article .card_title {
        font-size: clamp(1.48rem, 7vw, 1.9rem);
        line-height: 1.22;
    }

    body.single-post .card-single-article .entry-content {
        font-size: 1.04rem;
        line-height: 1.74;
    }

    body.single-post .entry-content h1,
    body.single-post .entry-content h2,
    body.single-post .entry-content h3,
    body.single-post .entry-content h4,
    body.single-post .entry-content h5,
    body.single-post .entry-content h6 {
        line-height: 1.32;
        margin-top: 1.65em;
    }

    body.single-post .entry-content .code-block,
    body.single-post .entry-content pre:not(.CodeMirror):not(.CodeMirror-line):not(.CodeMirror-line-like),
    body.single-post .entry-content .wp-block-code,
    body.single-post .entry-content .wp-block-preformatted {
        margin-bottom: 1.5rem;
        margin-top: 1.45rem;
    }

    body.single-post .entry-content .code-block .CodeMirror,
    body.single-post .entry-content pre:not(.CodeMirror):not(.CodeMirror-line):not(.CodeMirror-line-like),
    body.single-post .entry-content .wp-block-code,
    body.single-post .entry-content .wp-block-preformatted,
    body.single-post .entry-content .code-block > pre.CodeMirror {
        font-size: 0.82rem;
        line-height: 1.58;
    }

    body.single-post .entry-content .code-block .CodeMirror-lines {
        padding-bottom: 1rem;
        padding-top: 0.9rem;
    }

    body.single-post .entry-content .code-block .CodeMirror pre.CodeMirror-line,
    body.single-post .entry-content .code-block .CodeMirror pre.CodeMirror-line-like {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    body.single-post .entry-content .code-block .CodeMirror-linenumber {
        padding-left: 0.4rem;
        padding-right: 0.55rem;
    }

    body.single-post .entry-content .code-block .CodeMirror-panel .info-panel .language {
        font-size: 0.67rem;
        padding-left: 0.72rem;
        padding-right: 0.72rem;
    }

    body.single-post .entry-content blockquote,
    body.single-post .entry-content .wp-block-quote {
        padding: 0.85rem 0.95rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.single-post .entry-content a {
        transition: none;
    }
}
