/*
 * รูปแบบของข้อความที่จัดรูปแบบ (Rich Text) — ใช้ทั้งหน้าเว็บและกล่องแก้ไขในหน้า editor
 * HTML สร้างโดย includes/rich_text.php (หน้าเว็บ) และ assets/js/rich-editor.js (กล่องแก้ไข)
 */
.rt-size-sm { font-size: .85em; }
.rt-size-lg { font-size: 1.25em; }
.rt-size-xl { font-size: 1.6em; line-height: 1.35; }

.rt-mark, .rte-content mark {
    background-color: #fff59d;
    color: inherit;
    padding: 0 .15em;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.rt-h2, .rt-h3, .rt-h4,
.rte-content h2, .rte-content h3, .rte-content h4 {
    color: var(--heading-color, var(--primary, #0E1F4E));
    font-weight: 700;
    line-height: 1.35;
    margin: 1.1em 0 .45em;
}
.rt-h2, .rte-content h2 { font-size: 1.6em; }
.rt-h3, .rte-content h3 { font-size: 1.3em; }
.rt-h4, .rte-content h4 { font-size: 1.1em; }
.rt-h2:first-child, .rt-h3:first-child, .rt-h4:first-child { margin-top: 0; }

.rt-list, .rte-content ul, .rte-content ol {
    margin: .5em 0 .9em;
    padding-left: 1.6em;
}
.rt-list li, .rte-content li { margin: .25em 0; }
.rt-list li::marker { color: var(--secondary, #3B82D6); }

.rt-quote, .rte-content blockquote {
    margin: 1em 0;
    padding: .8em 1.1em;
    border-left: 4px solid var(--accent, #2E9E50);
    background: rgba(46, 158, 80, .07);
    border-radius: 0 10px 10px 0;
    color: inherit;
    font-style: italic;
}

.rt-align-center { text-align: center; }
.rt-align-right { text-align: right; }
.rt-align-justify { text-align: justify; text-justify: inter-character; }

.rt-hr, .rte-content hr {
    border: 0;
    height: 1px;
    background: currentColor;
    opacity: .2;
    margin: 1.5em 0;
}

.rt-figure, .rte-content figure.rt-figure {
    margin: 1.4em 0;
    text-align: center;
}
.rt-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: inline-block;
}
.rt-figure figcaption {
    margin-top: .5em;
    font-size: .88em;
    color: var(--text-muted, #64748B);
}

.rt-video, .rte-content .rt-embed {
    position: relative;
    width: 100%;
    max-width: 860px;
    margin: 1.4em auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.rt-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ลิงก์ในเนื้อหา */
.article-content a, .rt-content a, .rte-content a {
    color: var(--secondary, #3B82D6);
    text-decoration: underline;
    text-underline-offset: 3px;
}
