/**
 * RichEditor styles for frontend display
 * These styles are scoped to only apply to container-section boxes with rich text content
 */

/* Target only container sections with rich text content */
.oc-box--container-section .richeditor-content {
    /* Typography defaults */
    word-wrap: break-word;
}

/* Headings */
.oc-box--container-section .richeditor-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.oc-box--container-section .richeditor-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.875rem;
    margin-top: 1.75rem;
}

.oc-box--container-section .richeditor-content h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.oc-box--container-section .richeditor-content h4 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.625rem;
    margin-top: 1.25rem;
}

.oc-box--container-section .richeditor-content h5 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.oc-box--container-section .richeditor-content h6 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

/* Paragraphs */
.oc-box--container-section .richeditor-content p {
    margin-bottom: 1rem;
    line-height: 1.75;
}

/* Lists */
.oc-box--container-section .richeditor-content ul {
    list-style-type: disc;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.oc-box--container-section .richeditor-content ol {
    list-style-type: decimal;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.oc-box--container-section .richeditor-content li {
    margin-bottom: 0.5rem;
}

/* Nested lists */
.oc-box--container-section .richeditor-content ul ul,
.oc-box--container-section .richeditor-content ol ol,
.oc-box--container-section .richeditor-content ul ol,
.oc-box--container-section .richeditor-content ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Links */
.oc-box--container-section .richeditor-content a {
    color: #5b21b6; /* Purple to match theme */
    text-decoration: underline;
}

.oc-box--container-section .richeditor-content a:hover {
    color: #4c1d95;
}

/* Strong and emphasis */
.oc-box--container-section .richeditor-content strong {
    font-weight: 700;
}

.oc-box--container-section .richeditor-content em {
    font-style: italic;
}

/* Blockquotes */
.oc-box--container-section .richeditor-content blockquote {
    border-left: 4px solid #5b21b6;
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1rem;
    color: #4b5563;
}

/* Code */
.oc-box--container-section .richeditor-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
}

.oc-box--container-section .richeditor-content pre {
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.oc-box--container-section .richeditor-content pre code {
    background-color: transparent;
    padding: 0;
}

/* Tables */
.oc-box--container-section .richeditor-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.oc-box--container-section .richeditor-content table th,
.oc-box--container-section .richeditor-content table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.oc-box--container-section .richeditor-content table th {
    background-color: #f9fafb;
    font-weight: 600;
}

/* Alternating row colors */
.oc-box--container-section .richeditor-content table.oc-alternate-rows tbody tr:nth-child(even),
.oc-box--container-section .richeditor-content table.fr-alternate-rows tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Images */
.oc-box--container-section .richeditor-content img {
    max-width: 100%;
    height: auto;
}

/* Centered images */
.oc-box--container-section .richeditor-content img.fr-dib {
    display: block;
    margin: 1.25rem auto;
}

/* Left-aligned images */
.oc-box--container-section .richeditor-content img.fr-fil,
.oc-box--container-section .richeditor-content img.fr-dii.fr-fil {
    float: left;
    margin: 0.5rem 1rem 0.5rem 0;
}

/* Right-aligned images */
.oc-box--container-section .richeditor-content img.fr-fir,
.oc-box--container-section .richeditor-content img.fr-dii.fr-fir {
    float: right;
    margin: 0.5rem 0 0.5rem 1rem;
}

/* Rounded images */
.oc-box--container-section .richeditor-content img.fr-rounded,
.oc-box--container-section .richeditor-content img.oc-img-rounded {
    border-radius: 0.5rem;
}

/* Bordered images */
.oc-box--container-section .richeditor-content img.fr-bordered,
.oc-box--container-section .richeditor-content img.oc-img-bordered {
    border: 4px solid #e5e7eb;
}

/* Image captions */
.oc-box--container-section .richeditor-content .fr-img-caption {
    text-align: center;
    margin-bottom: 1rem;
}

.oc-box--container-section .richeditor-content .fr-img-caption span {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Horizontal rules */
.oc-box--container-section .richeditor-content hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* Special text styles from RichEditor */
.oc-box--container-section .richeditor-content .fr-text-gray,
.oc-box--container-section .richeditor-content .oc-text-gray {
    color: #9ca3af !important;
}

.oc-box--container-section .richeditor-content .fr-text-bordered,
.oc-box--container-section .richeditor-content .oc-text-bordered {
    border-top: 1px solid #374151;
    border-bottom: 1px solid #374151;
    padding: 0.625rem 0;
}

.oc-box--container-section .richeditor-content .fr-text-spaced,
.oc-box--container-section .richeditor-content .oc-text-spaced {
    letter-spacing: 0.05em;
}

.oc-box--container-section .richeditor-content .fr-text-uppercase,
.oc-box--container-section .richeditor-content .oc-text-uppercase {
    text-transform: uppercase;
}

.oc-box--container-section .richeditor-content .fr-class-highlighted,
.oc-box--container-section .richeditor-content .oc-class-highlighted {
    background-color: #fef08a;
    padding: 0.125rem 0.25rem;
}

.oc-box--container-section .richeditor-content .fr-class-code,
.oc-box--container-section .richeditor-content .oc-class-code {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    padding: 0.625rem;
    display: block;
    margin-bottom: 1rem;
}

/* Videos */
.oc-box--container-section .richeditor-content .fr-video {
    margin-bottom: 1rem;
}

.oc-box--container-section .richeditor-content .fr-video.fr-rv {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.oc-box--container-section .richeditor-content .fr-video.fr-rv iframe,
.oc-box--container-section .richeditor-content .fr-video.fr-rv embed,
.oc-box--container-section .richeditor-content .fr-video.fr-rv object {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Clear floats */
.oc-box--container-section .richeditor-content .clearfix:after {
    clear: both;
    content: "";
    display: block;
    height: 0;
}