/* ==============================================
   CSS LAYOUT FIXES (APPLY TO ALL SINGLE POSTS)
   ============================================== */

/* PERBAIKAN: Memastikan konten area tidak merusak layout Astra */
.content-area,
.site-main {
    padding: 0 !important; 
    margin: 0 auto;
    width: 100% !important; 
}

.single-post-page {
    padding: 0 5%; 
    max-width: 100% !important; 
    margin: 0 !important; 
    background-color: var(--bg-color);
    padding-top: 20px;
    padding-bottom: 60px;
}
.single-post-page #main {
    padding: 0;
}

/* ==============================================
   SINGLE POST ESTETIK STYLE
   ============================================== */

/* --- Header Post --- */
.entry-header {
    text-align: center;
    padding: 40px 0 30px 0;
    max-width: 1100px; 
    margin: 0 auto;
}

.entry-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.entry-meta {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 30px;
}

.entry-meta .author, 
.entry-meta .category, 
.entry-meta time {
    font-weight: 600;
    text-transform: uppercase;
}
.entry-meta .category a {
    color: var(--primary-color);
    text-decoration: none;
}

.featured-image-wrapper {
    margin: 30px auto; 
    max-width: 1200px; 
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.featured-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Grid Layout (Desktop) --- */
.post-layout-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile Default */
    gap: 40px;
    max-width: 1400px; 
    margin: 0 auto 60px auto;
}

@media (min-width: 992px) {
    .post-layout-grid {
        grid-template-columns: 2fr 1fr; 
        align-items: flex-start;
    }
}

/* --- Konten Utama (2/3) --- */
.post-content-main {
    line-height: 1.7;
    font-size: 1.05rem;
    padding-bottom: 40px;
    border-right: none; 
}

@media (min-width: 992px) {
    .post-content-main {
        padding-right: 40px;
        border-right: 1px solid #eee; 
    }
}

/* --- Table of Contents (1/3) & ADS Inside --- */
.sticky-toc-container {
    padding: 20px;
    background-color: var(--white-color);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: none; /* Mobile Hidden */
}

.toc-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

.toc-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: block;
    padding: 5px 0;
    border-left: 3px solid transparent;
}

.toc-list a:hover {
    color: var(--hover-color);
    padding-left: 5px;
}

.toc-list a.is-active {
    color: var(--primary-color);
    font-weight: 700;
    border-left: 3px solid var(--primary-color);
    padding-left: 5px;
}

.toc-list ul ul {
    padding-left: 15px;
    margin-top: 5px;
}

@media (min-width: 992px) {
    .sticky-toc-container {
        display: block;
        position: sticky;
        top: 80px; 
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}

/* --- Mobile ToC Button & Overlay --- */
.mobile-toc-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (min-width: 992px) {
    .mobile-toc-btn {
        display: none;
    }
}

.mobile-toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98); 
    z-index: 1100;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.mobile-toc-overlay.is-open {
    transform: translateY(0);
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.overlay-header h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

#toc-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary-color);
    cursor: pointer;
}

.mobile-toc-overlay .toc-list {
    overflow-y: auto; 
    flex-grow: 1;
}

.mobile-toc-overlay .toc-list a {
    font-size: 1.1rem; 
    padding: 10px 0;
    border-left: none; 
}