/* Styling untuk Halaman Kabar (kabar.css) - VERSI REVISI */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: linear-gradient(135deg, #f8fbfa 0%, #edf5f0 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent-light: #a3b6b5;
    --accent: #5A7D7C;
    --text-dark: #374151;
    --text-muted: #6B7280;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --tag-bg: #eef2ff;
    --tag-text: #4f46e5;
}

.news-section {
    padding: 8rem 7% 4rem;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.news-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.news-header::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    border-radius: 2px;
}

.news-header h1 {
    font-size: 3.2rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-header p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.news-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Properti untuk animasi */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s forwards;
}

/* Keyframe untuk animasi fade-in */
@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* Styling untuk Artikel Unggulan (Featured) */
.news-card.featured {
    grid-column: 1 / -1; /* Mengambil seluruh lebar grid */
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

.news-card.featured .card-image {
    width: 45%;
    flex-shrink: 0;
    padding-top: 25%; /* Aspect ratio lebih lebar */
    height: auto;
}

.news-card.featured .card-content {
    flex-grow: 1;
}

.news-card.featured .card-title {
    font-size: 1.8rem;
}

.news-card.featured .card-description {
    font-size: 1rem;
}

/* Responsif untuk featured card di layar kecil */
@media (max-width: 768px) {
    .news-card.featured {
        flex-direction: column;
        gap: 0;
    }
    .news-card.featured .card-image {
        width: 100%;
        padding-top: 56.25%; /* Kembali ke 16:9 */
    }
}

.card-image {
    width: 100%;
    padding-top: 56.25%; /* Aspect ratio 16:9 */
    position: relative;
    background-color: var(--border-color);
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative; /* Untuk posisi tag */
}

/* Styling Tag Kategori */
.card-category {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background-color: var(--tag-bg);
    color: var(--tag-text);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    line-height: 1.4;
    padding-right: 4rem; /* Beri ruang untuk tag kategori */
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-top: auto;
}

.card-link:hover {
    text-decoration: underline;
}

.card-link i {
    width: 16px;
    height: 16px;
}

/* Styling untuk state loading dan error */
.loading-indicator, .error-message {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 4rem 0;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.page-btn {
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: var(--accent);
    font-weight: 600;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.page-btn:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-muted);
    font-weight: 500;
}