/* ===================================================================
   Komponen: Konten CMS (Text / Headline / HTML Summernote)
   Dimuat per-section oleh komponen yang merender HTML admin
   (text.php, profile.php, slider.php, benefit.php, include.php).
   Semua rule di-scope di bawah .cms-content agar tidak bentrok
   dengan kelas Bootstrap.
   =================================================================== */

.cms-content {
    color: #334155;
    font-size: 1.02rem;
    line-height: 1.8;
    word-wrap: break-word;
    font-family: 'Poppins', sans-serif !important;
}

.cms-content * {
    font-family: 'Poppins', sans-serif !important;
}

/* ---------- Heading ---------- */
.cms-content h1,
.cms-content h2,
.cms-content h3,
.cms-content h4,
.cms-content h5,
.cms-content h6 {
    color: #1e293b;
    font-weight: 600;
    line-height: 1.35;
    margin: 2rem 0 0.75rem;
    letter-spacing: -0.015em;
    font-family: 'Poppins', sans-serif !important;
}

.cms-content h1 {
    font-size: 2.2rem;
}
.cms-content h2 {
    font-size: 1.85rem;
    font-weight: 600;
}
.cms-content h3 {
    font-size: 1.45rem;
    font-weight: 600;
}
.cms-content h4 {
    font-size: 1.2rem;
}
.cms-content h5 {
    font-size: 1.05rem;
}
.cms-content h6 {
    font-size: 0.95rem;
}

.cms-content h1:first-child,
.cms-content h2:first-child,
.cms-content h3:first-child,
.cms-content h4:first-child,
.cms-content h5:first-child,
.cms-content h6:first-child {
    margin-top: 0;
}

/* ---------- Paragraf & Teks ---------- */
.cms-content p {
    margin: 0 0 1rem;
}

.cms-content strong,
.cms-content b {
    color: #1e293b;
    font-weight: 600;
}

.cms-content em,
.cms-content i:not(.bi) {
    font-style: italic;
}

/* ---------- Link ---------- */
.cms-content a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cms-content a:hover {
    color: #1d4ed8;
}

/* ---------- List ---------- */
.cms-content ul,
.cms-content ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.cms-content ul {
    list-style: disc outside;
}

.cms-content ol {
    list-style: decimal outside;
}

.cms-content li {
    margin-bottom: 0.4rem;
    padding-left: 0.25rem;
}

.cms-content li::marker {
    color: #2563eb;
    font-weight: 600;
}

/* ---------- Blockquote ---------- */
.cms-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #2563eb;
    background: #f1f5f9;
    border-radius: 0.5rem;
    color: #475569;
    font-style: italic;
}

.cms-content blockquote p {
    margin-bottom: 0.5rem;
}

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

/* ---------- Gambar & Media ---------- */
.cms-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 0.5rem 0;
}

.cms-content img.float-left,
.cms-content .float-left {
    float: left;
    max-width: 45%;
    margin: 0.35rem 1.25rem 0.75rem 0;
}

.cms-content img.float-right,
.cms-content .float-right {
    float: right;
    max-width: 45%;
    margin: 0.35rem 0 0.75rem 1.25rem;
}

/* ---------- Video / Iframe (YouTube, dsb.) ---------- */
.cms-content iframe,
.cms-content video {
    max-width: 100%;
    border-radius: 0.75rem;
    border: 0;
}

/* ---------- Tabel (minimalist modern, seragam) ---------- */
/* Pembungkus responsif: tabel digulir horizontal pada layar kecil.
   Dibuat + dinormalisasi otomatis oleh helper lp_nice_tables()
   (penghapus gaya admin: class Bootstrap, style inline, dll.). */
.cms-content .cms-table-responsive {
    margin: 1.4rem 0;
    border: 1px solid #e7eaee;
    border-radius: 0.6rem;
    overflow-x: auto;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    -webkit-overflow-scrolling: touch;
}

/* Semua tabel (terbungkus maupun tidak) mendapat tampilan yang SAMA. */
.cms-content table {
    width: 100%;
    min-width: 520px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #1e293b;
}

.cms-content table caption {
    caption-side: top;
    padding: 0.9rem 1.1rem 0.25rem;
    text-align: left;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
}

.cms-content table thead th {
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: left;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e6e8eb;
    white-space: nowrap;
}

.cms-content .cms-table-responsive table thead th:first-child {
    border-top-left-radius: 0.5rem;
}

.cms-content .cms-table-responsive table thead th:last-child {
    border-top-right-radius: 0.5rem;
}

.cms-content table th,
.cms-content table td {
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #f1f4f7;
}

.cms-content table tbody tr:last-child th,
.cms-content table tbody tr:last-child td {
    border-bottom: 0;
}

.cms-content table tbody tr {
    transition: background-color 0.15s ease;
}

.cms-content table tbody tr:hover {
    background: #f8fafc;
}

.cms-content table tbody tr:hover td,
.cms-content table tbody tr:hover th {
    color: #0f172a;
}

.cms-content table td strong,
.cms-content table td b {
    color: #0f172a;
}

/* ---------- Code & Prase ---------- */
.cms-content pre {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 0.75rem;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

.cms-content code {
    background: #f1f5f9;
    color: #be185d;
    border-radius: 0.3rem;
    padding: 0.15rem 0.4rem;
    font-size: 0.9em;
}

.cms-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* ---------- Tombol (mode HTML bebas: link dengan class btn) ---------- */
.cms-content .btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 0.5rem;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.cms-content .btn-primary {
    background: #2563eb;
    color: #fff;
}

.cms-content .btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.cms-content .btn-outline-primary {
    border-color: #2563eb;
    color: #2563eb;
}

.cms-content .btn-outline-primary:hover {
    background: #2563eb;
    color: #fff;
}

/* ---------- Horizontal Rule ---------- */
.cms-content hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

/* ---------- Responsif Mobile (< 768px) ---------- */
@media (max-width: 767.98px) {
    .cms-content {
        font-size: 0.98rem;
        line-height: 1.75;
    }

    .cms-content h1 {
        font-size: 1.75rem;
    }

    .cms-content h2 {
        font-size: 1.5rem;
    }

    .cms-content img.float-left,
    .cms-content img.float-right,
    .cms-content .float-left,
    .cms-content .float-right {
        float: none;
        display: block;
        max-width: 100%;
        margin: 1rem auto;
    }

    .cms-content .cms-table-responsive {
        border-radius: 0.6rem;
        font-size: 0.85rem;
    }

    .cms-content .cms-table-responsive table {
        font-size: 0.85rem;
    }
}