/* Gaya konten HTML (halaman, berita, pratinjau admin).
   Tailwind preflight menghapus gaya bawaan heading/list/tabel, jadi dikembalikan di sini. */
.rich-content { color: #334155; font-size: 1rem; line-height: 1.8; overflow-wrap: anywhere; }
.rich-content > * + * { margin-top: 1rem; }
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4, .rich-content h5, .rich-content h6 {
    font-family: 'Playfair Display', Georgia, serif; font-weight: 700; color: #0f172a; line-height: 1.3; margin-top: 1.75rem;
}
.rich-content h1 { font-size: 2rem; }
.rich-content h2 { font-size: 1.6rem; padding-bottom: .5rem; border-bottom: 2px solid #f1e7d0; position: relative; }
.rich-content h2::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 56px; height: 2px; background: #c5a059; }
.rich-content h3 { font-size: 1.3rem; }
.rich-content h4 { font-size: 1.125rem; }
.rich-content h5, .rich-content h6 { font-size: 1rem; }
.rich-content p { margin-bottom: 0; }
.rich-content a { color: #0f2c59; text-decoration: underline; text-underline-offset: 2px; }
.rich-content a:hover { color: #c5a059; }
.rich-content strong, .rich-content b { font-weight: 700; color: #0f172a; }
.rich-content em, .rich-content i { font-style: italic; }
.rich-content u { text-decoration: underline; }
.rich-content s, .rich-content del { text-decoration: line-through; }
.rich-content ul { list-style: disc; padding-left: 1.6rem; }
.rich-content ol { list-style: decimal; padding-left: 1.6rem; }
.rich-content ul ul, .rich-content ol ul { list-style: circle; }
.rich-content li { margin-top: .25rem; }
.rich-content li > ul, .rich-content li > ol { margin-top: .25rem; }
.rich-content blockquote {
    border-left: 4px solid #c5a059; background: linear-gradient(90deg, #fbf6ea, #fff); color: #475569;
    padding: 1rem 1.4rem; font-style: italic; border-radius: 0 1rem 1rem 0; font-size: 1.05em;
}
.rich-content hr { border: 0; border-top: 1px solid #e2e8f0; margin: 1.75rem 0; }
.rich-content img, .rich-content video { max-width: 100%; height: auto; border-radius: 1rem; box-shadow: 0 6px 20px -8px rgba(15,44,89,.25); }
.rich-content iframe { max-width: 100%; border: 0; border-radius: .75rem; }
.rich-content iframe.ql-video, .rich-content .video-wrap iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.rich-content figure { margin: 1.25rem 0; }
.rich-content figcaption { font-size: .85rem; color: #64748b; text-align: center; margin-top: .4rem; }
.rich-content pre {
    background: #0f172a; color: #e2e8f0; padding: 1rem 1.25rem; border-radius: .75rem;
    overflow-x: auto; font-size: .875rem; line-height: 1.6;
}
.rich-content code { background: #f1f5f9; color: #be123c; padding: .1rem .35rem; border-radius: .25rem; font-size: .9em; }
.rich-content pre code { background: transparent; color: inherit; padding: 0; }

/* Tabel: dapat digeser horizontal di layar kecil */
.rich-content table {
    width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; display: block; overflow-x: auto;
    border: 1px solid #e2e8f0; border-radius: 1rem;
}
.rich-content th, .rich-content td { border-bottom: 1px solid #eef2f6; padding: .7rem 1rem; text-align: left; vertical-align: top; }
.rich-content thead th, .rich-content th { background: #0f2c59; color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.rich-content tbody tr:nth-child(even) td { background: #f8fafc; }
.rich-content tbody tr:hover td { background: #fbf6ea; }
.rich-content tr:last-child td { border-bottom: 0; }

/* Kelas bawaan Quill (perataan, indentasi, ukuran) */
.rich-content .ql-align-center { text-align: center; }
.rich-content .ql-align-right { text-align: right; }
.rich-content .ql-align-justify { text-align: justify; }
.rich-content .ql-indent-1 { padding-left: 3rem; }
.rich-content .ql-indent-2 { padding-left: 6rem; }
.rich-content .ql-indent-3 { padding-left: 9rem; }
.rich-content .ql-size-small { font-size: .75em; }
.rich-content .ql-size-large { font-size: 1.5em; }
.rich-content .ql-size-huge { font-size: 2.5em; }
.rich-content .ql-font-serif { font-family: Georgia, 'Times New Roman', serif; }
.rich-content .ql-font-monospace { font-family: Monaco, Courier, monospace; }
.rich-content img[style*="float"], .rich-content img[align] { margin: .25rem 1rem; }
.rich-content::after { content: ""; display: table; clear: both; }

/* ===== Editor admin (Visual / Kode HTML / Pratinjau) ===== */
.asasi-ed { container-type: inline-size; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.asasi-ed:focus-within { border-color: #94a3b8; box-shadow: 0 0 0 3px rgba(15,44,89,.08); }
.asasi-ed-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; border-radius: 16px 16px 0 0; }
.asasi-ed-tabs { display: inline-flex; gap: 2px; padding: 3px; background: #e9eef4; border-radius: 12px; }
.asasi-ed-tabs button { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 9px; color: #64748b; border: 0; background: transparent; transition: all .15s; }
.asasi-ed-tabs button:hover { color: #0f2c59; }
.asasi-ed-tabs button.is-active { background: #fff; color: #0f2c59; box-shadow: 0 1px 3px rgba(15,23,42,.15); }
.asasi-ed-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.asasi-ed-tool-html, .asasi-ed-tool-preview { display: flex; align-items: center; gap: 6px; }
.asasi-ed-tool-html[hidden], .asasi-ed-tool-preview[hidden] { display: none; }
.asasi-ed-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 10px; color: #0f2c59; background: #fff; border: 1px solid #dbe3ec; transition: all .15s; }
.asasi-ed-btn:hover { background: #0f2c59; color: #fff; border-color: #0f2c59; }
.asasi-ed-icon { padding: 7px 9px; }
.asasi-ed-menu-wrap { position: relative; }
.asasi-ed-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 6px; box-shadow: 0 16px 40px -12px rgba(15,23,42,.3); }
.asasi-ed-menu[hidden] { display: none; }
.asasi-ed-menu button { display: block; width: 100%; text-align: left; font-size: 12.5px; font-weight: 600; color: #334155; padding: 8px 12px; border-radius: 9px; border: 0; background: transparent; }
.asasi-ed-menu button:hover { background: #f1f5f9; color: #0f2c59; }
.asasi-ed-seg { display: inline-flex; padding: 2px; background: #e9eef4; border-radius: 10px; }
.asasi-ed-seg button { font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 8px; color: #64748b; border: 0; background: transparent; }
.asasi-ed-seg button.is-active { background: #fff; color: #0f2c59; box-shadow: 0 1px 2px rgba(15,23,42,.15); }
.asasi-ed-body { position: relative; }
.asasi-ed .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid #eef2f6; padding: 8px 10px; background: #fff; }
.asasi-ed .ql-container.ql-snow { border: 0; font-family: inherit; font-size: 15px; }
.asasi-ed .ql-editor { padding: 18px 22px; line-height: 1.7; }
.asasi-ed-code { display: block; width: 100%; box-sizing: border-box; padding: 16px 18px; resize: vertical; border: 0; outline: none; tab-size: 2; white-space: pre; overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.65; background: #0b1220; color: #dbe7ff; caret-color: #fcd34d; }
.asasi-ed-code[hidden], .asasi-ed-stage[hidden] { display: none; }
.asasi-ed-stage { background: repeating-conic-gradient(#f1f5f9 0% 25%, #f8fafc 0% 50%) 50% / 20px 20px; padding: 14px; display: flex; justify-content: center; overflow: auto; }
.asasi-ed-stage[data-device="desktop"] .asasi-ed-preview { width: 100%; }
.asasi-ed-stage[data-device="tablet"] .asasi-ed-preview { width: 768px; max-width: 100%; }
.asasi-ed-stage[data-device="phone"] .asasi-ed-preview { width: 390px; max-width: 100%; }
.asasi-ed-preview { display: block; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 10px 30px -14px rgba(15,23,42,.35); transition: width .2s; }
/* Mode Kode HTML: kode + pratinjau langsung berdampingan (bertumpuk di layar sempit) */
.asasi-ed-body.is-split { display: grid; grid-template-columns: minmax(0, 1fr); }
.asasi-ed-body.is-split .asasi-ed-stage { border-top: 1px solid #e2e8f0; min-height: 260px; }
@container (min-width: 760px) {
    .asasi-ed-body.is-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .asasi-ed-body.is-split .asasi-ed-stage { border-top: 0; border-left: 1px solid #e2e8f0; min-height: 0; }
}
.asasi-ed-body.is-split .asasi-ed-code { resize: none; white-space: pre-wrap; overflow-wrap: anywhere; }
@container (max-width: 759px) { .asasi-ed:not(.is-full) .asasi-ed-body.is-split .asasi-ed-code { height: 200px !important; } }
.asasi-ed-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 7px 14px; font-size: 11px; color: #94a3b8; background: #f8fafc; border-top: 1px solid #e2e8f0; border-radius: 0 0 16px 16px; }
.asasi-ed-stats { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Layar penuh */
.asasi-ed.is-full { position: fixed; inset: 12px; z-index: 9999; display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(2,6,23,.6); }
.asasi-ed.is-full .asasi-ed-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.asasi-ed.is-full .asasi-ed-body.is-split { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
@container (min-width: 760px) { .asasi-ed.is-full .asasi-ed-body.is-split { grid-template-rows: minmax(0, 1fr); } }
.asasi-ed.is-full .ql-container { flex: 1; min-height: 0; height: auto !important; overflow: auto; }
.asasi-ed.is-full .asasi-ed-code { flex: 1; resize: none; }
.asasi-ed.is-full .asasi-ed-stage { flex: 1; }
.asasi-ed.is-full .asasi-ed-preview { height: 100% !important; }
html.asasi-ed-noscroll { overflow: hidden; }

/* Pengaman responsif untuk HTML yang ditulis admin (inline style): layar HP */
.rich-content > * { max-width: 100%; }
.rich-content [style*="display: flex"], .rich-content [style*="display:flex"] { flex-wrap: wrap; }
@media (max-width: 520px) {
    .rich-content [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
    .rich-content [style*="padding: 2rem"], .rich-content [style*="padding:2rem"] { padding: 1.25rem !important; }
}
