/* 
   Rich Text Content Styles - Creative Pro Theme (Frontend)
   Matches .richtext-editor styles
   Modified: 2026-02-05
*/

.richtext-content {
    line-height: 1.7;
    color: #333;
    color: var(--color-dark, #333);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
}

@media (max-width: 768px) {
    .richtext-content {
        font-size: 15px !important;
    }
}

.richtext-content strong {
    font-weight: 700;
    color: #111;
}

/* Headings (Animated Underline) */
.richtext-content h1,
.richtext-content h2,
.richtext-content h3,
.richtext-content h4,
.richtext-content h5,
.richtext-content h6 {
    font-weight: 800;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    line-height: 1.25;
    color: #111;
    /* BLACK */
    position: relative;
    display: inline-block;
    width: 100%;
}

.richtext-content h1,
.richtext-content h2,
.richtext-content h3 {
    display: block;
    width: 100%;
}

.richtext-content h1 {
    font-size: 2.5em;
    letter-spacing: -1px;
}

/* Mobile Typography Fix */
@media (max-width: 768px) {
    .richtext-content h1 {
        font-size: 1.8em !important;
    }
}

.richtext-content h2 {
    font-size: 2em;
    letter-spacing: -0.5px;
}

.richtext-content h3 {
    font-size: 1.5em;
}

@media (max-width: 768px) {
    .richtext-content table {
        display: block;
        width: 100% !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* The Animated Line */
.richtext-content h2::after,
.richtext-content h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--color-primary, #1a0946);
    margin-top: 8px;
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.richtext-content h2:hover::after,
.richtext-content h3:hover::after {
    width: 120px;
}

/* Paragraphs */
.richtext-content p {
    margin: 1.2em 0;
    font-size: 1.05rem;
}

/* Lists (3 Columns) */
.richtext-content ul,
.richtext-content ol {
    margin: 1.5em 0;
    padding-left: 20px;
}

.richtext-content li {
    margin-bottom: 0.6em;
    padding-left: 10px;
    position: relative;
    break-inside: avoid;
}

.richtext-content ul {
    list-style: none;
    column-count: 3;
    column-gap: 2rem;
}

@media (max-width: 991px) {
    .richtext-content ul {
        column-count: 2;
    }
}

@media (max-width: 600px) {

    .richtext-content ul,
    .richtext-content ol {
        column-count: 2 !important;
        column-gap: 1rem !important;
    }
}

/* Custom Standard Bullets */
.richtext-content ul li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--color-primary, #1a0946);
    border-radius: 1px;
    transition: transform 0.2s;
}

.richtext-content ul li:hover::before {
    transform: scale(1.5) rotate(45deg);
}

/* Ordered List Numbers */
.richtext-content ol li::marker {
    color: var(--color-primary, #1a0946);
    font-weight: 700;
}


/* SPECIAL: .three-col-list (Responsive via column-width) */
.richtext-content .three-col-list {
    column-width: 16rem;
    column-gap: 3rem;
    padding-left: 0;
}

@media (max-width: 600px) {
    .richtext-content .three-col-list {
        column-count: 2;
        column-width: auto;
        column-gap: 1.25rem;
    }
}

.richtext-content .three-col-list li {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 0.8em;
    padding-left: 25px;
}

.richtext-content .three-col-list li::before {
    top: 10px;
    left: 0;
    width: 6px;
    height: 10px;
    border: solid var(--color-primary, #1a0946);
    border-width: 0 2px 2px 0;
    background: transparent;
    transform: rotate(45deg);
    border-radius: 0;
}

.richtext-content .three-col-list li:hover::before {
    transform: rotate(45deg) scale(1.2);
}

/* Blockquotes */
.richtext-content blockquote {
    font-style: italic;
    font-size: 1.1em;
    border: none;
    background: #f8fafc;
    padding: 2em 2em 2em 3.5em;
    /* Left padding for icon */
    margin: 0;
    color: #333;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.richtext-content blockquote::before {
    content: "\201C";
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 4em;
    line-height: 1;
    color: var(--color-primary, #1a0946);
    font-family: serif;
    opacity: 0.15;
}

.richtext-content blockquote p {
    margin: 0 0 1em;
}

.richtext-content blockquote p:last-child {
    margin-bottom: 0;
}

.richtext-content blockquote::after {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 4px;
    background: var(--color-primary, #1a0946);
    border-radius: 0 4px 4px 0;
}

/* Links (Animated Underline) */
.richtext-content a {
    color: var(--color-primary, #1a0946);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.2s;
}

.richtext-content a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary, #1a0946);
    transition: width 0.3s ease;
    opacity: 0.5;
}

.richtext-content a:hover::after {
    width: 100%;
    opacity: 1;
}

/* Images */
.richtext-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em 0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    transition: transform 0.3s ease;
}

.richtext-content img:hover {
    transform: scale(1.01);
}

/* Tables */
.richtext-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2em 0;
    font-size: 0.95em;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.richtext-content th {
    background: #f1f5f9;
    font-weight: 700;
    text-align: left;
    padding: 1em;
    color: #111;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.richtext-content thead tr:first-child th {
    border-top: 3px solid var(--color-primary, #1a0946);
}

.richtext-content td {
    padding: 1em;
    border-bottom: 1px solid #f1f1f1;
    vertical-align: top;
    color: #555;
}

.richtext-content tr:last-child td {
    border-bottom: none;
}

.richtext-content tr:hover td {
    background-color: #fafbfc;
}

/* Column Layouts */
.richtext-content .row-cols-1,
.richtext-content .row-cols-2,
.richtext-content .row-cols-3,
.row-cols-1[data-cols],
.row-cols-2[data-cols],
.row-cols-3[data-cols] {
    display: grid;
    gap: 24px;
    margin: 1.5em 0;
    width: 100%;
}

.richtext-content .row-cols-1,
.row-cols-1[data-cols="1"] {
    grid-template-columns: 1fr;
}

.richtext-content .row-cols-2,
.row-cols-2[data-cols="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.richtext-content .row-cols-3,
.row-cols-3[data-cols="3"] {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {

    .richtext-content .row-cols-2,
    .richtext-content .row-cols-3,
    .row-cols-2,
    .row-cols-3 {
        grid-template-columns: 1fr !important;
    }
}

/* Responsiveness Fixes for Non-responsive AI Content */
.richtext-content {
    overflow-x: auto;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.richtext-content table {
    display: block;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.richtext-content img,
.richtext-content iframe,
.richtext-content video {
    max-width: 100% !important;
    /* height: auto !important; */
}