/* ==============================================
   1. GLOBAL LAYOUT FIXES
   ============================================== */

/* Memastikan konten area tidak merusak layout Astra */
.content-area,
.site-main {
    padding: 0; 
    margin: 0 auto;
    width: 100%;
}

.blog-archive-page {
    padding: 0 5%;
    max-width: 1300px; 
    margin: 0 auto;
    background-color: var(--bg-color);
    padding-top: 20px;
    padding-bottom: 60px;
}

.blog-archive-page #main {
    padding: 0;
}


/* ==============================================
   2. HEADER & INTRO
   ============================================== */

.page-header {
    text-align: center;
    padding: 40px 0 50px 0;
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
}


/* ==============================================
   3. NEW LAYOUT: MAIN CONTENT + SIDEBAR
   ============================================== */

/* Wrapper utama pembagi kolom */
.blog-layout-container {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: Tumpuk ke bawah */
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 60px auto;
}

/* Desktop: 2/3 Konten, 1/3 Sidebar */
@media (min-width: 992px) {
    .blog-layout-container {
        grid-template-columns: 2fr 1fr;
        align-items: flex-start;
    }
}

/* --- Kolom Kiri: Grid Artikel (.archive-grid) --- */
.archive-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 30px;
    /* Max-width dihapus karena sudah diatur oleh parent .blog-layout-container */
}

/* Tablet & Desktop: Grid menjadi 2 kolom (karena ada sidebar, 3 kolom terlalu sempit) */
@media (min-width: 600px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ==============================================
   4. CARD ARTIKEL STYLES
   ============================================== */

.blog-card {
    background-color: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 51, 102, 0.15);
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

/* --- Kategori & Perbaikan Warna Link --- */
.card-category {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background-color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 5;
    text-transform: uppercase;
    /* Fallback color */
    color: #ffffff; 
}

/* PERBAIKAN: Target Link di dalam Category agar Putih */
.card-category a {
    color: #ffffff !important; /* Memaksa warna putih */
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-category a:hover {
    color: var(--secondary-color) !important;
}

/* --- Konten Kartu --- */
.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.entry-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.entry-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.entry-title a:hover {
    color: var(--hover-color);
}

.entry-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
}

.entry-summary {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
}


/* ==============================================
   5. SIDEBAR STYLES (NEW)
   ============================================== */

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

/* --- Widget: Search Box --- */
.search-form {
    display: flex;
    gap: 10px;
}
.search-field {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
}
.search-submit {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}
.search-submit:hover {
    background: var(--hover-color);
}

/* --- Widget: Popular Posts --- */
.popular-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.popular-posts-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 15px;
}
.popular-posts-list li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.pop-img {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
}
.pop-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pop-desc {
    display: flex;
    flex-direction: column;
}
.pop-desc a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 5px;
    transition: color 0.2s;
}
.pop-desc a:hover {
    color: var(--primary-color);
}
.pop-date {
    font-size: 0.75rem;
    color: #999;
}

/* --- Widget: Categories --- */
.widget-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget-categories li {
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.widget-categories li:last-child {
    border-bottom: none;
}
.widget-categories li a {
    color: var(--text-color);
    text-decoration: none;
    transition: padding 0.2s, color 0.2s;
    font-weight: 500;
}
.widget-categories li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}


/* ==============================================
   6. PAGINATION
   ============================================== */

.pagination-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 0 0 0;
}

.pagination-container .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 4px;
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 600;
}

.pagination-container .page-numbers:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--primary-color);
}

.pagination-container .page-numbers.current {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
    pointer-events: none;
}