:root {
    --primary-400: #2dd4bf;
    --primary-600: #0d9488;
}

/* ===== Base / Shell ===== */
.blog-section {
    color: #111827;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin-inline: auto;
    margin-top: 64px;
    max-width: 1420px;
    padding-bottom: 80px;
    padding-inline: 20px;
}

/* ===== Grid ===== */
.blog-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 5px;
    align-items: start;
}

.search-item {
    grid-row: 1;
    grid-column: 1;
    margin-bottom: 3px;
}

.left-content {
    grid-row: 2;
    grid-column: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.right-sidebar {
    grid-row: 3;
    grid-column: 1;
}

.blog-container.searching .left-content {
    grid-template-columns: 1fr !important;
}

/* ===== Headings ===== */
h5 {
    color: #292929;
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 24px 0;
}

/* ===== Search ===== */
.search-control {
    position: relative;
}

.search-input {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    height: 48px;
    outline: 0;
    padding: 0 44px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.search-input:hover {
    background: #fff;
    border-color: #d1d5db;
    box-shadow: none;
}

.search-control:hover .search-input {
    background: #fff !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
}

.search-icon {
    height: 18px;
    width: 18px;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    object-fit: contain;
    pointer-events: none;
}

.btn-clear {
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    height: 28px;
    width: 28px;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.btn-clear img {
    height: 16px;
    width: 16px;
    display: block;
}

.btn-clear:hover {
    background: transparent;
}

.search-control.has-value .btn-clear {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    display: none;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d9488;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }

    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* ===== Cards ===== */
.blog-card {
    color: inherit;
    display: block;
    text-decoration: none;
}

.image-wrap {
    border-radius: 12px;
    overflow: hidden;
}

.image-wrap img {
    aspect-ratio: 456 / 300;
    display: block;
    width: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .image-wrap img {
    transform: scale(1.06);
}

.meta {
    color: #161616;
    font-size: 16px;
    margin-top: 10px;
}

.dot {
    margin: 0 6px;
}

.category {
    color: #1e88e5;
    font-weight: 600;
}

.title {
    color: #111827;
    font-size: 26px;
    font-weight: 600;
    margin-top: 8px;
}

/* ===== Sidebar: Recent Post & Tags ===== */
.recent-post .post-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.post-item .thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.post-item .thumb img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-item:hover .thumb img {
    transform: scale(1.06);
}

.post-item small {
    color: #161616;
    font-size: 13px;
}

.post-item p {
    color: #111827;
    font-size: 17px;
    font-weight: 600;
    margin: 4px 0 0;
}

.label {
    color: #1e88e5;
    font-weight: 600;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag-list span {
    background: #ffffff;
    border: 1px solid #262626;
    border-radius: 999px;
    color: #111827;
    font-size: 18px;
    font-weight: 550;
    padding: 8px 26px;
    user-select: none;
    transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.tag-list span:hover {
    border-color: var(--primary-600);
    color: var(--primary-600);
    transform: translateY(-1px);
}

.tag-list span.active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: #fff;
}


/* ===== Pagination ===== */
.pagination-circle {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 30px;
}

.left-content .pagination-circle {
    grid-column: 1 / -1;
}

.pagination-circle .page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #000;
    color: #000;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination-circle .page:hover {
    border-color: var(--primary-400);
    color: var(--primary-400);
}

.pagination-circle .page.active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: #fff;
}

.pagination-circle .page.next {
    font-size: 0;
}

.pagination-circle .page .icon-arrow {
    width: 20px;
    height: 20px;
    display: block;
}

/* ===== Compact (Saat Search) ===== */
.blog-card.compact {
    display: grid !important;
    align-items: center;
    column-gap: 24px;
    grid-template-columns: minmax(320px, 456px) 1fr;
    padding: 8px 0;
}

.blog-card.compact .image-wrap {
    width: 100%;
    height: 300px;
    border-radius: 16px;
    overflow: hidden;
}

.blog-card.compact .image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: auto;
}

.blog-card.compact .meta {
    font-size: 14px;
    margin-top: 0;
}

.blog-card.compact .title {
    font-size: 28px;
    line-height: 1.2;
    margin-top: 6px;
}

/* ===== Mobile & Tablet (≤991px) ===== */
@media (max-width: 991px) {
    .image-wrap img {
        aspect-ratio: auto;
    }

    .post-item .thumb {
        width: 64px;
        height: 64px;
    }

    .blog-card.compact {
        display: block !important;
    }

    .blog-card.compact .image-wrap {
        height: auto;
        border-radius: 12px;
    }

    .blog-card.compact .title {
        font-size: 18px;
    }
}

/* ===== Tablet (≤768px) ===== */
@media (max-width: 768px) {
    h5 {
        font-size: 20px;
    }

    .title {
        font-size: 20px;
    }

    .meta {
        font-size: 14px;
    }

    .recent-post p {
        font-size: 15px;
    }

    .recent-post small {
        font-size: 12px;
    }

    .tag-list span {
        font-size: 14px;
        padding: 6px 18px;
    }
}

/* ===== Mobile (≤576px) ===== */
@media (max-width: 576px) {
    h5 {
        font-size: 32px;
        margin-bottom: 24px; /* 🔹 kurangi jarak di mobile */
    }

    .search-item {
        margin-bottom: 1px; /* 🔹 kurangi jarak antara search dan konten */
    }

    .title {
        font-size: 18px;
        line-height: 1.3;
    }

    .meta {
        font-size: 13px;
    }

    .recent-post p {
        font-size: 14px;
    }

    .recent-post small {
        font-size: 11px;
    }

    .tag-list span {
        font-size: 13px;
        padding: 5px 14px;
    }
}

/* ===== Desktop (≥992px) ===== */
@media (min-width: 992px) {
    .blog-container {
        grid-template-columns: 1fr 340px;
        grid-template-rows: auto 1fr;
        gap: 20px;
    }

    .search-item {
        grid-column: 2;
        grid-row: 1;
        margin-bottom: auto;
    }

    .left-content {
        grid-column: 1;
        grid-row: 1 / span 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px;
        margin-bottom: 60px;
    }

    .right-sidebar {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        gap: 30px;
        max-width: 340px;
        width: 100%;
    }
}

/* ===== No Results ===== */
.no-results {
    border: 1px dashed #d0d0d0;
    border-radius: 12px;
    color: #111827;
    padding: 24px;
    text-align: center;
}

/* ===== Category Filter ===== */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.category-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: #fff;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
