/* ==========================================================================
   Category Page (Archive) — Tirto.id Clone
   
   Container: max-width 1033px + padding 0 24px
   Sejajar dengan Logo, Top Navigation, Footer, dan semua Widget di Home.
   ========================================================================== */

.categorypage-wrapper {
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
    width: 100%;
}

/* Container HARUS sama dengan semua widget di home: 1033px + padding 0 24px */
.categorypage-container {
    max-width: 1033px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Header Area
   -------------------------------------------------------------------------- */
.categorypage-header {
    padding-top: 12px;
    padding-bottom: 24px;
}

.categorypage-breadcrumb {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    font-weight: 400;
}

.categorypage-breadcrumb a {
    color: #666;
    text-decoration: none;
}

.categorypage-breadcrumb .bc-sep {
    margin: 0 6px;
    color: #ccc;
    font-size: 14px;
}

.categorypage-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-top: 0;
    margin-bottom: 12px;
    color: #111;
}

.categorypage-description {
    font-size: 17px;
    line-height: 1.6;
    color: #333;
    max-width: 900px;
    margin-bottom: 0;
}

.categorypage-description p {
    margin: 0;
}

.categorypage-divider {
    width: 100%;
    border: none;
    border-bottom: 1px dashed #d9d9d9;
    margin-top: 24px;
    margin-bottom: 0;
}

/* ==========================================================================
   Category Index List Section
   ========================================================================== */
.category-index-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.category-index-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Kolom kiri (artikel) lebih besar, kanan (sidebar) lebih kecil */
    gap: 30px;
}

.category-index-main {
    border-right: 1px solid #ececec; /* Garis lurus atas ke bawah pemisah sidebar */
    padding-right: 30px;
}

.category-index-sidebar {
    /* Area kosong untuk widget sidebar nanti */
}

.category-index-header {
    border-top: 2px solid #111;
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e0e0e0;
    margin-bottom: 10px;
}

.category-index-header h2 {
    font-size: 16px;
    font-weight: 800;
    color: #111;
    margin: 0;
    letter-spacing: -0.5px;
}

.category-index-list {
    display: flex;
    flex-direction: column;
}

.category-index-item {
    display: flex;
    padding: 16px 0;
    border-bottom: 1px solid #ececec;
}

.category-index-item:first-child {
    padding-top: 0;
}

.category-index-item:last-child {
    border-bottom: none;
}

.category-index-thumb {
    flex-shrink: 0;
    width: 216px;
    height: 121.5px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    margin-right: 24px;
}

.category-index-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-index-item:hover .category-index-thumb img {
    transform: scale(1.05);
}

/* Pagination */
.category-pagination-wrapper {
    margin-top: 20px;
    padding-top: 25px;
    border-top: 1px dashed #e0e0e0;
}

.category-pagination {
    display: flex;
    gap: 15px;
}

.btn-paginate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #111;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
    border: none;
}

.btn-paginate svg {
    margin-top: 1px;
}

.btn-prev svg {
    margin-right: 6px;
}

.btn-next svg {
    margin-left: 6px;
}

.btn-paginate:hover {
    background: #e0e0e0;
}

.category-index-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-index-meta {
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.category-index-meta .cat-name {
    color: #2f5fd3;
    font-weight: 600;
    text-decoration: none;
}

.category-index-meta .meta-sep {
    color: #ccc;
    margin: 0 8px;
}

.category-index-meta .date {
    color: #888;
}

.category-index-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 22px;
    max-height: 22px;
    overflow: hidden;
    color: #111;
    margin: 0 0 8px 0;
    max-width: 403px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.category-index-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.category-index-item:hover .category-index-title a {
    color: #1a56db;
}

.category-index-excerpt {
    font-size: 14px;
    line-height: 18px;
    color: #555;
    margin: 0;
    max-width: 403px;
    max-height: 54px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Responsive */
@media (max-width: 768px) {
    .category-index-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .category-index-main {
        border-right: none;
        padding-right: 0;
    }
    .category-index-item {
        flex-direction: column;
    }
    .category-index-thumb {
        width: 100%;
        margin-right: 0;
        margin-bottom: 16px;
    }
}

/* ==========================================================================
   Product Ads Widget (Sidebar Clone)
   ========================================================================== */
.product-ads-widget {
    margin-bottom: 30px;
}

.product-ads-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.product-card {
    border: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 100%;
}

.product-card:hover {
    border-color: #b0b0b0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-arrow {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    border: 1px solid #555;
    z-index: 2;
}

.product-arrow svg {
    width: 14px;
    height: 14px;
    stroke: #444;
}

.product-info {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: #901919;
    margin-bottom: 4px;
    line-height: 1.2;
}

.product-title {
    font-size: 14px;
    color: #111;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-store {
    font-size: 13px;
    color: #5c6c7b;
    margin-top: auto;
}
/* --------------------------------------------------------------------------
   Berita Utama Widget (Category Sidebar)
   -------------------------------------------------------------------------- */
.widget-bu-container .widget-title {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    margin: 0 0 15px 0;
    padding-bottom: 12px;
    border-top: 2px solid #000;
    border-bottom: 1px dashed #ccc;
    padding-top: 12px;
}

.bu-list {
    display: flex;
    flex-direction: column;
}

.bu-item {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    gap: 16px;
}

.bu-item:first-child {
    padding-top: 0;
}

.bu-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bu-meta {
    font-size: 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.bu-cat {
    color: #2d5bd1;
    font-weight: 600;
}

.bu-sep {
    color: #ccc;
    margin: 0 6px;
}

.bu-time {
    color: #888;
}

.bu-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.bu-title a {
    color: #111;
    text-decoration: none;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bu-title a:hover {
    color: #0d47a1;
}

.bu-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    overflow: hidden;
    background: #f0f0f0;
}

.bu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* --------------------------------------------------------------------------
   Responsive Header
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .categorypage-container {
        padding: 0 16px;
    }
    .categorypage-title {
        font-size: 32px;
    }
    .categorypage-description {
        font-size: 16px;
    }
}

/* --------------------------------------------------------------------------
   Override: Headline Widget di dalam Category Page
   Hapus max-width & padding bawaan .headline-widget-inner agar card
   sejajar dengan garis divider categorypage-container.
   -------------------------------------------------------------------------- */
.categorypage-container .headline-widget-section {
    padding: 0;
}

.categorypage-container .headline-widget-inner {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* Perkecil jarak card baris atas (bawah) & baris bawah (atas) */
.categorypage-container .hw-grid > .hw-sidebar-card:nth-child(2) {
    padding: 0 16px 12px 20px !important;
}
.categorypage-container .hw-grid > .hw-sidebar-card:nth-child(3) {
    padding: 0 0 12px 20px !important;
}
.categorypage-container .hw-grid > .hw-sidebar-card:nth-child(4) {
    padding: 12px 16px 0 20px !important;
}
.categorypage-container .hw-grid > .hw-sidebar-card:nth-child(5) {
    padding: 12px 0 0 20px !important;
}

/* Perkecil font judul utama */
.categorypage-container .hw-main-title {
    font-size: 22px;
    line-height: 1.25;
    margin: 0 0 6px;
}

/* Perkecil font deskripsi */
.categorypage-container .hw-main-desc {
    font-size: 13px;
    line-height: 1.5;
}

/* Perkecil meta row */
.categorypage-container .hw-meta-row {
    margin-bottom: 6px;
    font-size: 12px;
}

/* Perkecil padding body utama */
.categorypage-container .hw-main-body {
    padding-top: 10px;
}

/* Perkecil font judul sidebar card */
.categorypage-container .hw-sidebar-title {
    font-size: 13px;
    line-height: 1.3;
}

/* Perkecil padding body sidebar */
.categorypage-container .hw-sidebar-body {
    padding-top: 6px;
}

/* Perkecil meta sidebar */
.categorypage-container .hw-sidebar-meta {
    margin-bottom: 4px;
    font-size: 11px;
}
