/*
|--------------------------------------------------------------------------
| Frontend News Detail Content
|--------------------------------------------------------------------------
| CSS ini dibuat khusus untuk menjaga output HTML dari rich text editor
| tetap rapi di halaman detail artikel public tanpa mengganggu style global.
*/

.news-detail-card {
    overflow: hidden;
}

.news-detail-featured-image {
    border-radius: 18px;
    overflow: hidden;
    background: #f6f6f6;
}

.news-detail-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.news-detail-header {
    margin-bottom: 28px;
}

.news-detail-title {
    margin-bottom: 14px;
    line-height: 1.18;
    letter-spacing: -0.03em;
    word-break: break-word;
}

.news-detail-date {
    margin-bottom: 0;
}

.news-detail-body {
    color: #323232;
    font-size: 17px;
    line-height: 1.82;
    overflow-wrap: break-word;
    word-break: normal;
}

.news-detail-body::after {
    content: "";
    display: block;
    clear: both;
}

.news-detail-body > *:first-child {
    margin-top: 0 !important;
}

.news-detail-body > *:last-child {
    margin-bottom: 0 !important;
}

.news-detail-body p {
    margin: 0 0 20px;
    color: #323232;
    line-height: 1.82;
}

.news-detail-body h1,
.news-detail-body h2,
.news-detail-body h3,
.news-detail-body h4,
.news-detail-body h5,
.news-detail-body h6 {
    margin: 36px 0 16px;
    color: #111;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.02em;
}

.news-detail-body h1 {
    font-size: 34px;
}

.news-detail-body h2 {
    font-size: 30px;
}

.news-detail-body h3 {
    font-size: 25px;
}

.news-detail-body h4 {
    font-size: 22px;
}

.news-detail-body h5 {
    font-size: 19px;
}

.news-detail-body h6 {
    font-size: 17px;
}

.news-detail-body strong,
.news-detail-body b {
    font-weight: 700;
    color: inherit;
}

.news-detail-body em,
.news-detail-body i {
    font-style: italic;
}

.news-detail-body u {
    text-underline-offset: 3px;
}

.news-detail-body a {
    color: var(--primary-color, #f15a24);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    word-break: break-word;
}

.news-detail-body a:hover {
    color: #111;
}

/*
 * Global template lama memiliki rule `li { list-style: none; }`.
 * Karena itu marker bullet/number harus dikembalikan langsung ke elemen li
 * dengan specificity tinggi dan !important agar tampilan frontend sama
 * seperti di text editor admin.
 */
.news-detail-body ul,
.news-detail-body ol {
    margin: 0 0 28px 1.25em !important;
    padding-left: 1.25em !important;
    list-style-position: outside !important;
}

.news-detail-body ul {
    list-style-type: disc !important;
}

.news-detail-body ol {
    list-style-type: decimal !important;
}

.news-detail-body ul > li,
.news-detail-body ul li {
    display: list-item !important;
    list-style-type: disc !important;
    list-style-position: outside !important;
}

.news-detail-body ol > li,
.news-detail-body ol li {
    display: list-item !important;
    list-style-type: decimal !important;
    list-style-position: outside !important;
}

.news-detail-body li {
    margin: 0 0 20px !important;
    padding-left: 0.15em !important;
    line-height: 1.78;
    color: inherit;
}

.news-detail-body li::marker {
    color: currentColor;
    font-size: 0.9em;
    font-weight: 700;
}

.news-detail-body li > p {
    margin: 0 0 10px;
}

.news-detail-body li > p:last-child {
    margin-bottom: 0;
}

.news-detail-body li > ul,
.news-detail-body li > ol {
    margin-top: 12px !important;
    margin-bottom: 12px !important;
}

.news-detail-body blockquote {
    position: relative;
    margin: 30px 0;
    padding: 22px 26px;
    border-left: 5px solid var(--primary-color, #f15a24);
    background: #fff7f1;
    border-radius: 0 14px 14px 0;
    color: #222;
    font-size: 18px;
    line-height: 1.75;
}

.news-detail-body blockquote p:last-child {
    margin-bottom: 0;
}

.news-detail-body img {
    max-width: 100%;
    height: auto !important;
    display: block;
    margin: 28px auto;
    border-radius: 14px;
}

.news-detail-body figure {
    margin: 30px 0;
}

.news-detail-body figure img {
    margin: 0 auto;
}

.news-detail-body figcaption {
    margin-top: 10px;
    color: #777;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.news-detail-body table {
    width: 100%;
    max-width: 100%;
    margin: 30px 0;
    border-collapse: collapse;
    border-spacing: 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
}

.news-detail-body table th,
.news-detail-body table td {
    min-width: 120px;
    padding: 13px 15px;
    border: 1px solid #e4e4e4;
    vertical-align: top;
    line-height: 1.6;
}

.news-detail-body table th {
    background: #f7f7f7;
    color: #111;
    font-weight: 700;
}

.news-detail-body hr {
    margin: 34px 0;
    border: 0;
    border-top: 1px solid #e8e8e8;
    opacity: 1;
}

.news-detail-body pre {
    margin: 26px 0;
    padding: 18px 20px;
    overflow-x: auto;
    border-radius: 14px;
    background: #171717;
    color: #f4f4f4;
    font-size: 14px;
    line-height: 1.7;
}

.news-detail-body code {
    padding: 3px 6px;
    border-radius: 6px;
    background: #f2f2f2;
    color: #111;
    font-size: 0.92em;
}

.news-detail-body pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.news-detail-body iframe,
.news-detail-body video {
    max-width: 100%;
    border-radius: 14px;
}

.news-detail-body iframe {
    display: block;
    margin: 28px auto;
}

.news-detail-body .ql-align-center,
.news-detail-body [style*="text-align: center"] {
    text-align: center;
}

.news-detail-body .ql-align-right,
.news-detail-body [style*="text-align: right"] {
    text-align: right;
}

.news-detail-body .ql-align-justify,
.news-detail-body [style*="text-align: justify"] {
    text-align: justify;
}

.news-detail-body .ql-indent-1 {
    padding-left: 3em;
}

.news-detail-body .ql-indent-2 {
    padding-left: 6em;
}

.news-detail-body .ql-indent-3 {
    padding-left: 9em;
}

.news-detail-body .ql-size-small {
    font-size: 0.82em;
}

.news-detail-body .ql-size-large {
    font-size: 1.25em;
}

.news-detail-body .ql-size-huge {
    font-size: 1.55em;
}

.news-detail-body .MsoNormal,
.news-detail-body [class*="Mso"] {
    margin-bottom: 20px;
    line-height: 1.82;
}

.news-detail-sidebar {
    position: sticky;
    top: 110px;
}

.news-latest-item {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #ececec;
}

.news-latest-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.news-latest-item a {
    display: block;
    color: #111;
    font-weight: 600;
    line-height: 1.55;
}

@media (max-width: 991px) {
    .news-detail-sidebar {
        position: static;
        top: auto;
    }
}

@media (max-width: 767px) {
    .news-detail-body {
        font-size: 16px;
        line-height: 1.78;
    }

    .news-detail-title {
        font-size: 32px;
    }

    .news-detail-body h1 {
        font-size: 29px;
    }

    .news-detail-body h2 {
        font-size: 26px;
    }

    .news-detail-body h3 {
        font-size: 22px;
    }

    .news-detail-body h4 {
        font-size: 20px;
    }

    .news-detail-body ul,
    .news-detail-body ol {
        margin-left: 1em !important;
        padding-left: 1.05em !important;
    }

    .news-detail-body blockquote {
        padding: 18px 20px;
        font-size: 16px;
    }

    .news-detail-body table th,
    .news-detail-body table td {
        min-width: 110px;
        padding: 11px 12px;
        font-size: 14px;
    }
}
