/**
 * MAHESA CUSTOM ARTICLE TEMPLATE
 * CSS lengkap untuk single post template
 */

/* ===== FEATURED IMAGE FULLWIDTH ===== */
.article-featured-header {
    width: 100vw !important;
    height: 600px !important; 
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    margin-top: -50px !important; /* Sesuaikan sesuai tinggi header */
    margin-bottom: 40px !important;
    z-index: 0 !important;
}

.header-content-container {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 30px 0 !important; /* Hilangkan padding horizontal */
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.1), transparent) !important;
    width: 100% !important;
    color: #fff !important;
    z-index: 2 !important;
    max-width: 1080px !important; /* Sesuaikan dengan lebar konten */
    margin: 0 auto !important; /* Tengahkan container */
}

.article-title {
    font-size: 36px !important;
    margin-bottom: 20px !important;
    color: #fff !important;
    line-height: 1.2 !important;
    font-weight: 700 !important; /* Font lebih bold */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5) !important; /* Tambahkan shadow agar lebih terlihat */
}

.article-meta {
    margin-bottom: 10px !important;
    font-size: 14px !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important; 
}

.article-meta span {
    margin-right: 15px !important;
}

.article-category {
    background-color: #EC1F25 !important;
    padding: 4px 8px !important;
    border-radius: 3px !important;
    font-weight: 500 !important; /* Sedikit lebih bold */
}

.article-reading-time {
    display: inline-flex !important;
    z-index: 99999 !important;
    align-items: center !important;
    background-color: rgba(236, 31, 37, 0.6) !important;
    padding: 3px 8px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
}

.article-reading-time:before {
    content: "⏱" !important;
    margin-right: 5px !important;
}

/* Overlay Gelap pada Featured Image */
.article-featured-header:before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.5)) !important;
    z-index: 1 !important;
}

/* Pastikan kontras baik di semua ukuran layar */
@media (max-width: 768px) {
    .article-featured-header:before {
        background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6)) !important; /* Overlay lebih gelap di mobile */
    }
    
    .header-content-container {
        background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.2)) !important; /* Gradient lebih kuat di mobile */
    }
}

/* ===== MAIN CONTAINER ===== */
#main-content .container {
    padding-top: 0 !important;
}

.content-wrapper {
    display: flex !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
    position: relative !important;
    z-index: 1 !important;
    margin-top: -50px !important;
    background-color: #fff !important;
    border-radius: 15px 15px 0 0 !important;
    padding-top: 20px !important;
}

.article-main-content {
    flex: 1 !important;
    width: 100% !important;
}

/* ===== OVERRIDE DIVI SETTINGS ===== */
body.single-post #page-container #main-header {
    background-color: transparent !important;
    box-shadow: none !important;
    z-index: 88888 !important;
}

body.single-post #et-main-area {
    overflow-x: hidden !important;
}

body.single-post .et_pb_section:first-child {
    padding-top: 0 !important;
}

/* Menu Fixed Header - Lebih Spesifik */
body.single-post #page-container #main-header.et-fixed-header,
html body.single-post.et_fixed_nav #main-header,
body.single-post #page-container #main-header.scrolled {
    background-color: rgba(15,28,46,0.81) !important;
    box-shadow: 0 0 7px rgba(0,0,0,0.1) !important;
}

/* Menu Transparan dengan Spesifisitas Lebih Tinggi */
@media (min-width: 981px) {
    body.single-post:not(.et_fixed_nav) #page-container #main-header:not(.et-fixed-header):not(.scrolled) {
        background-color: transparent !important;
        box-shadow: none !important;
        transition: all 0.3s ease !important;
    }
}

/* JavaScript Helper - Tambahkan kelas scrolled saat di-scroll */
html body.single-post #page-container #main-header.scrolled {
    background-color: rgba(15,28,46,0.81) !important;
    box-shadow: 0 0 7px rgba(0,0,0,0.1) !important;
}

/* ===== BREADCRUMB ===== */
.article-breadcrumb {
    padding: 15px 0 !important;
    margin-bottom: 20px !important;
    font-size: 14px !important;
    border-bottom: 1px solid #eee !important;
}

.article-breadcrumb a {
    color: #666 !important;
}

/* ===== ARTICLE CONTENT ===== */
.article-content {
    margin-bottom: 30px !important;
    line-height: 1.7 !important;
    font-size: 16px !important;
}

.article-content h2 {
    font-size: 28px !important;
    margin: 30px 0 20px !important;
}

.article-content h3 {
    font-size: 24px !important;
    margin: 25px 0 15px !important;
}

.article-content h4 {
    font-size: 20px !important;
    margin: 20px 0 15px !important;
}

.article-content h5 {
    font-size: 18px !important;
    margin: 20px 0 10px !important;
}

.article-content h6 {
    font-size: 16px !important;
    margin: 15px 0 10px !important;
    font-weight: bold !important;
}

/* Link Artikel - Hover */
.article-content a:hover, 
.article-content a:focus {
    color: #EC1F25 !important;
}

/* Semua Link dalam Artikel */
.article-content a {
    color: #EC1F25 !important;
    text-decoration: none !important;
    border-bottom: 1px dotted rgba(236, 31, 37, 0.3) !important;
}

/* ===== TABLE OF CONTENTS ===== */
/* Table of Contents dengan Penomoran */
.article-toc {
    background-color: #f9f9f9 !important;
    border: 1px solid #eee !important;
    border-radius: 5px !important;
    padding: 20px !important;
    margin: 30px 0 !important;
}

.toc-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 15px !important;
}

.toc-header h4 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
}

.toc-toggle {
    cursor: pointer !important;
    color: #EC1F25 !important;
    font-size: 14px !important;
}

.toc-list {
    margin: 0 !important;
    padding-left: 0 !important; /* Hapus padding default */
    list-style-type: none !important; /* Hapus bullet points */
    counter-reset: section; /* Reset counter untuk penomoran utama */
}

/* Item Utama dengan Penomoran */
.toc-list > li {
    margin-bottom: 10px !important;
    counter-increment: section; /* Increment counter untuk item utama */
    padding-left: 30px !important; /* Ruang untuk nomor */
    position: relative !important;
}

.toc-list > li:before {
    content: counter(section) ". " !important;
    position: absolute !important;
    left: 0 !important; 
    font-weight: 600 !important;
    color: #EC1F25 !important;
}

/* Sub Item dengan Penomoran 1.1, 1.2, dll */
.toc-list > li > ul {
    padding-left: 20px !important;
    margin-top: 5px !important;
    counter-reset: subsection; /* Reset counter untuk sub item */
    list-style-type: none !important;
}

.toc-list > li > ul > li {
    margin-bottom: 5px !important;
    counter-increment: subsection; /* Increment counter untuk sub item */
    padding-left: 30px !important;
    position: relative !important;
}

.toc-list > li > ul > li:before {
    content: counter(section) "." counter(subsection) " " !important;
    position: absolute !important;
    left: 0 !important;
    font-weight: 500 !important;
    color: #EC1F25 !important;
}

.toc-list a {
    color: #333 !important;
    text-decoration: none !important;
}

.toc-list a:hover {
    color: #EC1F25 !important;
}

/* Tombol Sembunyikan */
.toc-toggle-button {
    color: #EC1F25 !important;
    cursor: pointer !important;
    background: none !important;
    border: none !important;
    font-size: 14px !important;
    padding: 3px 8px !important;
    border-radius: 3px !important;
    float: right !important;
}

.toc-toggle-button:hover {
    background-color: rgba(236, 31, 37, 0.1) !important;
}

/* ===== AUTHOR BOX ===== */
.author-box {
    display: flex !important;
    background-color: #f9f9f9 !important;
    border-radius: 5px !important;
    padding: 25px !important;
    margin: 40px 0 !important;
}

.author-avatar {
    margin-right: 20px !important;
}

.author-avatar img {
    border-radius: 50% !important;
}

.author-info {
    flex: 1 !important;
}

.author-info h4 {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    font-size: 20px !important;
}

.author-bio {
    margin-bottom: 15px !important;
    line-height: 1.6 !important;
}

.author-socials {
    display: flex !important;
    gap: 10px !important;
}

.author-social {
    display: inline-block !important;
    padding: 5px 10px !important;
    background-color: #eee !important;
    border-radius: 3px !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 12px !important;
    text-transform: capitalize !important;
}

.author-social:hover {
    background-color: #EC1F25 !important;
    color: #fff !important;
}

.author-social.facebook {
    background-color: #3b5998 !important;
    color: #fff !important;
}

.author-social.twitter {
    background-color: #1da1f2 !important;
    color: #fff !important;
}

.author-social.instagram {
    background-color: #c13584 !important;
    color: #fff !important;
}

.author-social.linkedin {
    background-color: #0077b5 !important;
    color: #fff !important;
}

/* ===== SOCIAL SHARE ===== */
.social-share-container {
    margin: 30px 0 !important;
    padding: 20px 0 !important;
    border-top: 1px solid #eee !important;
    border-bottom: 1px solid #eee !important;
}

.social-share-buttons {
    display: flex !important;
    gap: 15px !important;
}

.share-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
}

.share-btn svg {
    width: 20px !important;
    height: 20px !important;
    fill: #fff !important;
}

.share-btn.facebook {
    background-color: #3b5998 !important;
}

.share-btn.twitter {
    background-color: #1da1f2 !important;
}

.share-btn.linkedin {
    background-color: #0077b5 !important;
}

.share-btn.whatsapp {
    background-color: #25d366 !important;
}

/* ===== ARTICLE TAGS ===== */
.article-tags {
    margin-bottom: 30px !important;
}

.article-tags a {
    display: inline-block !important;
    margin-right: 8px !important;
    margin-bottom: 8px !important;
    padding: 6px 10px !important;
    background-color: #f5f5f5 !important;
    border-radius: 3px !important;
    color: #666 !important;
    font-size: 12px !important;
}

/* Tag Hover */
.article-tags a:hover {
    background-color: #EC1F25 !important;
    color: #fff !important;
}

/* ===== POST NAVIGATION ===== */
.post-navigation {
    display: flex !important;
    justify-content: space-between !important;
    margin: 40px 0 !important;
    border-top: 1px solid #eee !important;
    border-bottom: 1px solid #eee !important;
    padding: 20px 0 !important;
}

.nav-previous, .nav-next {
    flex: 0 0 48% !important;
}

.nav-next {
    text-align: right !important;
}

.prev-post, .next-post {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    color: #333 !important;
}

.next-post {
    flex-direction: row-reverse !important;
}

.nav-thumbnail {
    width: 70px !important;
    height: 70px !important;
    background-size: cover !important;
    background-position: center !important;
    border-radius: 5px !important;
    margin-right: 15px !important;
    flex-shrink: 0 !important;
}

.next-post .nav-thumbnail {
    margin-right: 0 !important;
    margin-left: 15px !important;
}

.nav-info {
    display: flex !important;
    flex-direction: column !important;
}

.nav-label {
    font-size: 12px !important;
    color: #666 !important;
    margin-bottom: 5px !important;
}

.nav-title {
    font-weight: bold !important;
    line-height: 1.3 !important;
}

.prev-post:hover .nav-title,
.next-post:hover .nav-title {
    color: #EC1F25 !important;
}

/* ===== ARTIKEL TERKAIT (UPDATED) ===== */
/* ===== ARTIKEL TERKAIT - FIX LAYOUT ===== */
.related-posts {
    margin: 40px 0 30px !important;
    padding: 0 !important;
    clear: both !important;
}

.related-posts h3 {
    margin-bottom: 20px !important;
    font-size: 24px !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 10px !important;
}

.related-fallback-message {
    font-style: italic !important;
    margin-bottom: 15px !important;
    color: #666 !important;
    font-size: 14px !important;
}

.related-posts-container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
}

.related-post-item {
    border: 1px solid #eee !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    transition: all 0.3s ease !important;
}

.related-post-item:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.related-post-link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    text-decoration: none !important;
    color: inherit !important;
}

.related-post-image {
    flex: 0 0 auto !important;
    height: 180px !important;
    overflow: hidden !important;
    position: relative !important;
}

.related-post-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.related-post-item:hover .related-post-image img {
    transform: scale(1.05) !important;
}

.related-post-content {
    flex: 1 !important;
    padding: 15px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.related-post-content h4 {
    font-size: 16px !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

.related-post-meta {
    display: flex !important;
    justify-content: space-between !important;
    font-size: 12px !important;
    color: #666 !important;
    margin-top: auto !important;
}

.related-post-category {
    color: #EC1F25 !important;
    font-weight: 500 !important;
}

.related-post-date {
    color: #888 !important;
}

/* Fix untuk spasi berlebihan */
.comment-respond {
    margin-top: 30px !important;
}

#comments, 
.comment-respond,
.comments-area {
    margin-top: 30px !important;
}

/* Jarak antara artikel terkait dan komentar */
.related-posts + .comment-respond,
.related-posts + #comments,
.related-posts + .comments-area {
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 1px solid #eee !important;
}

/* Responsive */
@media (max-width: 768px) {
    .related-posts-container {
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }
    
    .related-post-image {
        height: 160px !important;
    }
    
    .related-post-content {
        padding: 12px !important;
    }
    
    .related-post-content h4 {
        font-size: 14px !important;
    }
}

@media (max-width: 480px) {
    .related-posts-container {
        grid-template-columns: 1fr !important;
    }
    
    .related-post-image {
        height: 180px !important;
    }
}
/* ===== COMMENTS ===== */
.article-comments {
    margin-top: 40px !important;
}

.article-comments h3 {
    margin-bottom: 20px !important;
    font-size: 24px !important;
}

.comments-form {
    margin-bottom: 30px !important;
}

.comment-form-author,
.comment-form-email,
.comment-form-comment {
    margin-bottom: 15px !important;
}

.comment-form-author label,
.comment-form-email label,
.comment-form-comment label {
    display: block !important;
    margin-bottom: 5px !important;
}

.comment-form-author input,
.comment-form-email input,
.comment-form-comment textarea {
    width: 100% !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

.form-submit {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    margin-top: 20px !important;
}

.form-submit input[type="submit"] {
    background-color: #EC1F25 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-weight: bold !important;
}

/* ===== RESPONSIVE STYLES ===== */
@media (min-width: 1080px) {
    .header-content-container {
        padding-left: calc((100vw - 1080px) / 2 + 30px) !important;
        padding-right: calc((100vw - 1080px) / 2 + 30px) !important;
    }
    
    .header-content-container {
        padding: 30px 15px !important; /* Tambahkan sedikit padding di mobile */
    }
}

@media (max-width: 980px) {
    .article-featured-header {
        height: 450px !important;
        margin-top: -80px !important; /* Sesuaikan untuk tablet */
    }
}

@media (max-width: 768px) {
    .article-featured-header {
        height: 400px !important;
        margin-top: -60px !important; /* Sesuaikan untuk mobile */
    }
    
    .header-content-container {
        padding: 20px 5% !important;
    }
    
    .article-title {
        font-size: 24px !important;
        margin-bottom: 10px !important;
    }
    
    .article-meta {
        font-size: 12px !important;
    }
    
    .article-meta span {
        margin-right: 8px !important;
        margin-bottom: 5px !important;
        display: inline-block !important;
    }
    
    .related-posts-container {
        grid-template-columns: 1fr !important;
    }
    
    .author-box {
        flex-direction: column !important;
    }
    
    .author-avatar {
        margin-right: 0 !important;
        margin-bottom: 15px !important;
        text-align: center !important;
    }
    
    .post-navigation {
        flex-direction: column !important;
    }
    
    .nav-previous, .nav-next {
        flex: 0 0 100% !important;
    }
    
    .nav-previous {
        margin-bottom: 20px !important;
    }
    
    .nav-next {
        text-align: left !important;
    }
    
    .next-post {
        flex-direction: row !important;
    }
    
    .next-post .nav-thumbnail {
        margin-left: 0 !important;
        margin-right: 15px !important;
    }
}

@media (max-width: 480px) {
    .article-featured-header {
        height: 350px !important;
    }
    
    .article-title {
        font-size: 20px !important;
    }
    
    /* Tampilkan meta items dalam 2 baris jika perlu */
    .article-meta {
        display: flex !important;
        flex-wrap: wrap !important;
    }
}