/* ==========================================================================
   Indeks Artikel — indexpage.css
   Tirto.id Clone — Full Responsive Layout
   Prefix: indexpage-
   ========================================================================== */

/* ─── BASE / WRAPPER ────────────────────────────────────────────────── */
.indexpage-wrapper {
    --indexpage-cols-desktop: 3;
    --indexpage-cols-tablet: 2;
    --indexpage-cols-mobile: 1;
    --indexpage-thumb-ratio: 16 / 9;
    --indexpage-border-radius: 4px;
    --indexpage-font-family: 'Inter', sans-serif;
    --indexpage-font-size-title: 15px;
    --indexpage-font-weight-title: 700;
    --indexpage-color-bg: #ffffff;
    --indexpage-color-border: #ececec;
    --indexpage-color-hover: #2563eb;
    --indexpage-color-heading: #111111;
    --indexpage-color-meta: #777777;

    background: var(--indexpage-color-bg);
    font-family: var(--indexpage-font-family);
    color: #333;
    line-height: 1.6;
    padding-bottom: 40px;
}

.indexpage-wrapper *,
.indexpage-wrapper *::before,
.indexpage-wrapper *::after {
    box-sizing: border-box;
}

.indexpage-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ─── BREADCRUMB ────────────────────────────────────────────────────── */
.indexpage-breadcrumb {
    padding: 16px 0 8px;
}
.indexpage-breadcrumb p {
    margin: 0;
    font-size: 13px;
    color: #888;
}
.indexpage-breadcrumb a {
    color: #555;
    text-decoration: none;
}
.indexpage-breadcrumb a:hover {
    color: var(--indexpage-color-hover);
    text-decoration: underline;
}
.indexpage-bc-sep {
    margin: 0 6px;
    color: #ccc;
}
.indexpage-bc-current {
    color: #333;
    font-weight: 500;
}

/* ─── PAGE HEADER ───────────────────────────────────────────────────── */
.indexpage-header {
    padding: 32px 0 28px;
    border-bottom: 1px solid var(--indexpage-color-border);
    margin-bottom: 0;
}
.indexpage-header-title {
    font-size: 40px;
    font-weight: 800;
    color: var(--indexpage-color-heading);
    margin: 0 0 12px;
    line-height: 1.15;
    letter-spacing: -0.5px;
}
.indexpage-header-desc {
    font-size: 18px;
    line-height: 1.7;
    color: #555;
    margin: 0;
    max-width: 720px;
}

/* ─── PROGRAM SECTION ───────────────────────────────────────────────── */
.indexpage-program {
    padding: 32px 0;
    border-bottom: 1px solid var(--indexpage-color-border);
}
.indexpage-program:last-child {
    border-bottom: none;
}

/* Program Header */
.indexpage-program-header {
    margin-bottom: 24px;
}
.indexpage-program-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--indexpage-color-heading);
    margin: 0 0 6px;
    line-height: 1.3;
}
.indexpage-program-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}
.indexpage-program-title a:hover {
    color: var(--indexpage-color-hover);
}
.indexpage-program-desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 14px;
    line-height: 1.5;
}

/* Subcategory Pills */
.indexpage-subcats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.indexpage-subcats li {
    margin: 0;
}
.indexpage-subcat-pill {
    display: inline-block;
    padding: 5px 14px;
    background: #f5f5f5;
    color: #444;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.indexpage-subcat-pill:hover {
    background: var(--indexpage-color-hover);
    color: #fff;
    border-color: var(--indexpage-color-hover);
}

/* ─── ARTICLE GRID ──────────────────────────────────────────────────── */
.indexpage-grid {
    display: grid;
    grid-template-columns: repeat(var(--indexpage-cols-desktop), 1fr);
    gap: 24px;
}

/* ─── ARTICLE CARD ──────────────────────────────────────────────────── */
.indexpage-card {
    display: flex;
    flex-direction: column;
    background: var(--indexpage-color-bg);
    border: 1px solid var(--indexpage-color-border);
    border-radius: var(--indexpage-border-radius);
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.indexpage-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Thumbnail */
.indexpage-thumbnail {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: var(--indexpage-thumb-ratio);
    background: #f0f0f0;
}
.indexpage-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.indexpage-card:hover .indexpage-thumbnail img {
    transform: scale(1.05);
}

/* Card Body */
.indexpage-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Meta (Category + Date) */
.indexpage-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.indexpage-meta-category {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s;
}
.indexpage-meta-category:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
.indexpage-meta-date {
    font-size: 12px;
    color: var(--indexpage-color-meta);
}
.indexpage-meta-sep {
    color: #ddd;
    font-size: 10px;
}

/* Title */
.indexpage-title {
    font-size: var(--indexpage-font-size-title);
    font-weight: var(--indexpage-font-weight-title);
    line-height: 1.35;
    margin: 0;
    min-height: 56px;
}
.indexpage-title a {
    color: var(--indexpage-color-heading);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}
.indexpage-card:hover .indexpage-title a {
    color: var(--indexpage-color-hover);
}

/* ─── PAGINATION ────────────────────────────────────────────────────── */
.indexpage-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 40px 0 24px;
    font-family: var(--indexpage-font-family);
}
.indexpage-pagination a,
.indexpage-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    color: #555;
    gap: 4px;
}
.indexpage-pagination a:hover {
    background: #f0f0f0;
    color: var(--indexpage-color-hover);
}
.indexpage-pagination-current {
    background: var(--indexpage-color-hover) !important;
    color: #fff !important;
    font-weight: 600 !important;
}
.indexpage-pagination-disabled {
    opacity: 0.35;
    pointer-events: none;
}
.indexpage-pagination-dots {
    pointer-events: none;
    color: #aaa;
}
.indexpage-pagination-numbers {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.indexpage-pagination-prev,
.indexpage-pagination-next {
    font-weight: 600;
}
.indexpage-pagination svg {
    flex-shrink: 0;
}

/* ─── EMPTY STATE ───────────────────────────────────────────────────── */
.indexpage-empty {
    text-align: center;
    padding: 48px 24px;
    color: #aaa;
    font-size: 15px;
}

/* ─── RESPONSIVE: TABLET (≤ 1024px) ────────────────────────────────── */
@media (max-width: 1024px) {
    .indexpage-grid {
        grid-template-columns: repeat(var(--indexpage-cols-tablet), 1fr);
        gap: 20px;
    }
    .indexpage-header-title {
        font-size: 32px;
    }
    .indexpage-header-desc {
        font-size: 16px;
    }
    .indexpage-program-title {
        font-size: 20px;
    }
}

/* ─── RESPONSIVE: MOBILE (≤ 768px) ─────────────────────────────────── */
@media (max-width: 768px) {
    .indexpage-container {
        padding: 0 16px;
    }
    .indexpage-grid {
        grid-template-columns: repeat(var(--indexpage-cols-mobile), 1fr);
        gap: 16px;
    }
    .indexpage-header {
        padding: 24px 0 20px;
    }
    .indexpage-header-title {
        font-size: 26px;
    }
    .indexpage-header-desc {
        font-size: 15px;
        line-height: 1.6;
    }
    .indexpage-program {
        padding: 24px 0;
    }
    .indexpage-program-title {
        font-size: 18px;
    }
    .indexpage-program-desc {
        font-size: 13px;
    }
    .indexpage-title {
        min-height: auto;
    }

    /* Card: horizontal layout on mobile for compactness */
    .indexpage-card {
        flex-direction: row;
        align-items: stretch;
    }
    .indexpage-thumbnail {
        width: 120px;
        min-width: 120px;
        aspect-ratio: auto;
        height: auto;
    }
    .indexpage-card-body {
        padding: 10px 12px;
        justify-content: center;
    }
    .indexpage-meta {
        margin-bottom: 4px;
    }
    .indexpage-meta-category {
        font-size: 11px;
    }
    .indexpage-meta-date {
        font-size: 11px;
    }
    .indexpage-title {
        font-size: 14px !important;
        -webkit-line-clamp: 2;
    }

    /* Subcategory pills: scrollable */
    .indexpage-subcats {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .indexpage-subcats::-webkit-scrollbar {
        display: none;
    }
    .indexpage-subcat-pill {
        white-space: nowrap;
        font-size: 12px;
        padding: 4px 12px;
    }

    /* Pagination */
    .indexpage-pagination {
        padding: 28px 0 16px;
        gap: 2px;
    }
    .indexpage-pagination a,
    .indexpage-pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
        padding: 0 6px;
    }
}

/* ─── RESPONSIVE: SMALL MOBILE (≤ 480px) ───────────────────────────── */
@media (max-width: 480px) {
    .indexpage-header-title {
        font-size: 22px;
    }
    .indexpage-header-desc {
        font-size: 14px;
    }
    .indexpage-thumbnail {
        width: 100px;
        min-width: 100px;
    }
    .indexpage-card-body {
        padding: 8px 10px;
    }
}
