/*
 * Gaya konten dari editor TinyMCE (Berita, Pengumuman, Agenda, Infografis, Halaman).
 * Dipakai bersama oleh halaman visitor DAN di dalam editor admin (content_css),
 * sehingga tampilan saat menulis sama dengan yang dilihat pengunjung.
 * Semua elemen diberi nilai eksplisit karena visitor memakai reset Tailwind (preflight)
 * sedangkan editor memakai gaya bawaan browser.
 */

.rich-content {
    font-family: 'Public Sans', system-ui, sans-serif;
    letter-spacing: -0.01em;
    line-height: 1.75;
    color: #334155;
    overflow-wrap: break-word;
}

.rich-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }

/* Paragraf */
.rich-content p {
    margin: 0 0 1.25rem;
    line-height: 1.75;
    color: #334155;
}

/* Judul */
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    font-family: 'Public Sans', system-ui, sans-serif;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.rich-content h1 { font-size: 2em;    font-weight: 800; color: #1e3a8a; margin: 2rem 0 0.75rem; }
.rich-content h2 { font-size: 1.5em;  font-weight: 800; color: #1e3a8a; margin: 2rem 0 0.75rem; }
.rich-content h3 { font-size: 1.25em; font-weight: 700; color: #1e293b; margin: 1.75rem 0 0.75rem; }
.rich-content h4 { font-size: 1.1em;  font-weight: 700; color: #334155; margin: 1.5rem 0 0.5rem; }
.rich-content h5,
.rich-content h6 { font-size: 1em;    font-weight: 700; color: #334155; margin: 1.25rem 0 0.5rem; }

/* Teks inline */
.rich-content strong,
.rich-content b { font-weight: 700; color: #1e293b; }
.rich-content em,
.rich-content i { font-style: italic; }
.rich-content u { text-decoration: underline; }
.rich-content s { text-decoration: line-through; }
.rich-content sub,
.rich-content sup { font-size: 0.75em; line-height: 0; position: relative; }
.rich-content sup { top: -0.5em; }
.rich-content sub { bottom: -0.25em; }

/* Link */
.rich-content a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rich-content a:hover { color: #1d4ed8; }

/* Daftar (bullet & nomor), termasuk bertingkat */
.rich-content ul,
.rich-content ol {
    margin: 0.75rem 0 1.25rem;
    padding-left: 1.75rem;
}
.rich-content ul { list-style-type: disc; }
.rich-content ul ul { list-style-type: circle; }
.rich-content ul ul ul { list-style-type: square; }
.rich-content ol { list-style-type: decimal; }
.rich-content ol ol { list-style-type: lower-alpha; }
.rich-content ol ol ol { list-style-type: lower-roman; }
.rich-content ul ul,
.rich-content ul ol,
.rich-content ol ul,
.rich-content ol ol {
    margin: 0.35rem 0;
    padding-left: 1.5rem;
}
.rich-content li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}
.rich-content li > p { margin-bottom: 0.4rem; }

/* Kutipan */
.rich-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #1e3a8a;
    border-radius: 0 0.5rem 0.5rem 0;
    background-color: #f8fafc;
    font-style: italic;
    color: #334155;
}
.rich-content blockquote p:last-child { margin-bottom: 0; }

/* Gambar & media */
.rich-content img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    border-radius: 0.5rem;
}
.rich-content figure { margin: 1.5rem 0; }
.rich-content figure.image { display: table; }
.rich-content figure.align-center { margin-left: auto; margin-right: auto; }
.rich-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.875em;
    color: #64748b;
    text-align: center;
    font-style: italic;
}
.rich-content iframe,
.rich-content video {
    max-width: 100%;
    border: 0;
}

/* Tabel */
.rich-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: 0.95em;
}
.rich-content th,
.rich-content td {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}
.rich-content th,
.rich-content thead td {
    background-color: #f1f5f9;
    font-weight: 700;
    color: #1e293b;
}
.rich-content table p { margin-bottom: 0; }

/* Garis pemisah */
.rich-content hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

/* Kode */
.rich-content code {
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    background-color: #f1f5f9;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    color: #0f172a;
}
.rich-content pre {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    background-color: #0f172a;
    color: #e2e8f0;
    overflow-x: auto;
    font-size: 0.875em;
    line-height: 1.6;
}
.rich-content pre code {
    padding: 0;
    background: none;
    color: inherit;
}

/* Lampiran PDF (disisipkan lewat tombol "Sisipkan PDF") */
.rich-content .pdf-embed p { margin: 0; }
.rich-content .pdf-embed iframe { border-radius: 0; }
