/* Studoes rich post content blocks.
   Shared rendering for composer, preview, and published Post Detail. */

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 13px;
    background: #f8fbff;
    color: #374151;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block h3 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 1.08rem;
    font-weight: 850;
    line-height: 1.35;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block p:last-child,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block ul:last-child,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block ol:last-child {
    margin-bottom: 0;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block--summary {
    border-color: #99f6e4;
    background: #f0fdfa;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block--summary h3 {
    color: #134e4a;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block--key-points {
    border-color: #bfdbfe;
    background: #eff6ff;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block--key-points h3 {
    color: #1e3a8a;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block--key-points ul,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block--key-points ol {
    margin: 0 0 0 1.2rem;
    padding-left: .85rem;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block--quote,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) blockquote {
    margin: 16px 0;
    padding: 14px 16px;
    border-left: 4px solid #7c3aed;
    border-radius: 10px;
    background: #f5f3ff;
    color: #4c1d95;
    font-style: italic;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) pre.ss-post-block--code,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block--code,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) pre:not(.fr-code) {
    overflow-x: auto;
    margin: 16px 0;
    padding: 14px;
    border: 1px solid #1e293b;
    border-radius: 12px;
    background: #0f172a;
    color: #e5e7eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .86rem;
    line-height: 1.6;
    white-space: pre;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) pre.ss-post-block--code code,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block--code code,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) pre code {
    display: inline;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-media,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-media-block {
    margin: 18px auto;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-editor-media--small {
    width: min(100%, 420px);
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-editor-media--medium {
    width: min(100%, 760px);
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-editor-media--full {
    width: 100%;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-media img,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-media video,
:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-youtube-embed iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 0;
    border-radius: 12px;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-media figcaption:empty {
    display: none;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-media figcaption {
    margin-top: 8px;
    color: #64748b;
    font-size: .82rem;
    font-style: italic;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-youtube-embed {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 13px;
    background: #0f172a;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-youtube-embed iframe {
    height: 100%;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-reference-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-reference-link::before {
    content: "↗";
    color: #64748b;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-academic-numbering-block {
    margin: 0 0 16px;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-academic-numbering-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 6px 0;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-academic-numbering-marker {
    flex: 0 0 auto;
    min-width: 38px;
    color: #1d4ed8;
    font-weight: 800;
}

:where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-academic-numbering-text {
    flex: 1 1 auto;
    min-width: 16px;
}

@media (max-width: 640px) {
    :where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-block,
    :where(.ss-rich-content, .ss-post-content, .studoes-rich-content) .ss-post-media {
        padding: 12px;
    }
}
