/* =========================================
   BLOG GLOBAL
========================================= */

.blog-page {
    padding: 80px 20px;
    background: #f8fafc;
}

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* =========================================
   HEADER
========================================= */

.blog-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    color: #111827;
}

.blog-subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 40px;
    font-size: 15px;
}

/* =========================================
   SEARCH
========================================= */

.blog-search {
    margin: 30px auto 50px;
    max-width: 600px;
}

.blog-search form {
    display: flex;
    gap: 10px;
}

.blog-search input {
    flex: 1;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.blog-search button {
    padding: 12px 18px;
    border-radius: 10px;
    border: none;
    background: #22c55e;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.blog-search button:hover {
    background: #16a34a;
}

/* =========================================
   LAYOUT
========================================= */


.blog-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr);
    gap: 40px;
    align-items: flex-start;
}

.blog-main {
    width: 100%;
}

.blog-sidebar {
    width: 100%;
    position: sticky;
    top: 100px;
}

/* =========================================
   BLOG GRID
========================================= */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

/* =========================================
   BLOG CARD
========================================= */

.blog-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: #22c55e;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.blog-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.blog-card-content {
    padding: 18px;
}

.blog-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.blog-card h3 a {
    text-decoration: none;
    color: #111827;
}

.blog-card h3 a:hover {
    color: #22c55e;
}

.blog-card p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.blog-meta {
    font-size: 12px;
    color: #9ca3af;
}

/* =========================================
   SIDEBAR
========================================= */

.blog-sidebar {
    position: sticky;
    top: 90px;
}

.sidebar-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.sidebar-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    color: #111827;
}

/* Sidebar Post */

.sidebar-post {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    transition: 0.2s ease;
}

.sidebar-post:hover {
    background: #f3f4f6;
}

.sidebar-post img {
    width: 65px;
    height: 65px;
    border-radius: 12px;
    object-fit: cover;
}

.sidebar-post-content h4 {
    font-size: 13px;
    margin-bottom: 5px;
    color: #111827;
}

.sidebar-meta {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

.sidebar-post-content p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

/* Sidebar Category */

.sidebar-category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-category-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    font-size: 13px;
    color: #111827;
    transition: 0.2s;
}

.sidebar-category-item:hover {
    background: #22c55e;
    color: white;
}

.sidebar-category-item span {
    font-size: 11px;
}

/* =========================================
   PAGINATION
========================================= */

.pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination a {
    padding: 7px 13px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    font-size: 13px;
    color: #111827;
    background: white;
}

.pagination a.active,
.pagination a:hover {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

/* =========================================
   SINGLE POST (FIX SPACING)
========================================= */

.blog-post {
    max-width: 900px;
    margin: 40px auto 80px; /* atas dikurangi */
    padding: 0 20px;
}

.blog-post img {
    width: 100%;
    max-height: 420px;        /* batasi tinggi */
    object-fit: cover;
    border-radius: 16px;
    margin: 20px 0 30px;
}

/* Kurangi jarak atas agar title lebih dekat */
.blog-post h1 {
    font-size: 30px;
    margin-bottom: 8px;
    color: #0f172a;
}

.blog-content a {
    color: #16a34a;
    font-weight: 500;
}


/* Meta lebih jelas */
.blog-post-meta {
    font-size: 13px;
    color: #475569;
    margin-bottom: 20px;
}

/* Konten lebih readable */
.blog-content {
    line-height: 1.9;
    font-size: 16px;
    color: #1e293b; 
}

.blog-content h2,
.blog-content h3 {
    color: #0f172a;
    font-weight: 600;
}

/* Spacing antar paragraf lebih rapi */
.blog-content p {
    margin-bottom: 18px;
      color: #0f172a;
}

/* Heading dalam content */
.blog-content h2,
.blog-content h3 {
    margin-top: 35px;
    margin-bottom: 12px;
    color: #111827;
}

.blog-single-page .blog-wrapper {
    align-items: start; /* sejajarkan atas */
}

.blog-single-page .blog-sidebar {
    position: sticky;
    top: 120px; /* turunkan sedikit */
}

/* Jika masih terlalu tinggi, pakai margin manual */
.blog-single-page .blog-sidebar .sidebar-card {
    margin-top: 40px;
}   


/* =========================================
   BLOG HOME CAROUSEL
========================================= */

.blog-home {
    padding: 80px 20px;
    background: #ffffff;
}

.blog-home-container {
    max-width: 1200px;
    margin: 0 auto;
}

.blog-home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.blog-home-header h2 {
    font-size: 26px;
    font-weight: 700;
}

.blog-view-all {
    color: #16a34a;
    text-decoration: none;
    font-weight: 500;
}

.blog-carousel-wrapper {
    position: relative;
}

.blog-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.blog-carousel::-webkit-scrollbar {
    display: none;
}

.blog-slide {
    min-width: 300px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e7eb;
    transition: 0.3s ease;
}

.blog-slide:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.blog-slide img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.blog-slide-content {
    padding: 15px;
}

.blog-slide-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #111827;
}

.blog-slide-content p {
    font-size: 13px;
    color: #6b7280;
}

/* Navigation */

.blog-nav {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 5;
}

.blog-nav.prev {
    left: -15px;
}

.blog-nav.next {
    right: -15px;
}

.blog-carousel-wrapper {
    overflow: hidden;
}

/* Carousel jangan pakai scroll lagi */
.blog-carousel {
    overflow: hidden !important;
    scroll-behavior: auto !important;
    will-change: transform;
}

/* Slide width stabil untuk infinite JS */
.blog-slide {
    flex: 0 0 auto;
}

/* Pastikan gambar tidak overflow */
.blog-slide img {
    display: block;
    width: 100%;
}

/* Fix tombol tidak kepotong */
.blog-nav.prev {
    left: 5px;
}

.blog-nav.next {
    right: 5px;
}

/* Optional: smoother GPU transform */
.blog-carousel {
    transform: translateZ(0);
}

/* Mobile */

@media (max-width: 768px) {
    .blog-slide {
        min-width: 240px;
    }

    .blog-nav {
        display: none;
    }
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 992px) {

    .blog-wrapper {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: relative;
        top: 0;
    }

    .blog-single-page .blog-wrapper {
        grid-template-columns: 1fr;
    }

    .blog-single-page .blog-sidebar {
        position: relative !important;
        top: 0 !important;
        margin-top: 30px !important;
    }

    .blog-single-page .blog-sidebar .sidebar-card {
        margin-top: 0 !important;
    }

     .blog-single-page .blog-sidebar {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {

    .blog-title {
        font-size: 24px;
    }

    .blog-card img {
        height: 170px;
    }
}

