/* Reset CSS Dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f6f8;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s ease-in-out;
}

/* Navbar */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: #d9534f;
}

.logo span { color: #222; }
.logo.white { color: #ff6b6b; }
.logo.white span { color: #fff; }

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    font-weight: 600;
    color: #555;
}

.nav-links a:hover, .nav-links a.active {
    color: #d9534f;
}

.search-box {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
}

.search-box input {
    border: none;
    padding: 8px 15px;
    outline: none;
}

.search-box button {
    background: #d9534f;
    border: none;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
}

/* Header Halaman & Filter */
.page-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 30px 0;
    margin-bottom: 30px;
}

.breadcrumb {
    display: flex;
    list-style: none;
    font-size: 13px;
    color: #777;
    margin-bottom: 15px;
}

.breadcrumb li+li:before {
    content: "/\00a0";
    padding: 0 5px;
}

.breadcrumb a { color: #777; }
.breadcrumb .active { color: #d9534f; }

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
}

.trending-icon {
    color: #ff6b4a;
}

.page-header h1 {
    font-size: 28px;
    color: #111;
}

.page-header p {
    color: #666;
    font-size: 14px;
}

/* Filter Tombol Waktu */
.time-filter {
    display: flex;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 20px;
}

.filter-btn {
    border: none;
    background: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    border-radius: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background: #d9534f;
    color: #fff;
}

/* Layout utama */
.main-content {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
}

.popular-section {
    flex: 2;
}

.sidebar {
    flex: 1;
}

/* Kartu Berita Populer (Popular Cards) */
.popular-card {
    position: relative;
    background: #fff;
    border-radius: 10px;
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.popular-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Lencana Peringkat (Rank Badges) */
.rank-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 38px;
    height: 38px;
    background: #4a5568;
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    z-index: 2;
}

.rank-badge.gold { background: #f59e0b; }
.rank-badge.silver { background: #94a3b8; }
.rank-badge.bronze { background: #d97706; }

.card-img {
    flex: 0 0 200px;
    height: 130px;
    border-radius: 8px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    flex: 1;
}

.meta-info {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.meta-info .category {
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
}

.card-content h3 {
    font-size: 17px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.card-content h3 a:hover {
    color: #d9534f;
}

.card-content p {
    font-size: 13px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Khusus Rank #1 (Top Rank Style) */
.popular-card.top-rank {
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.popular-card.top-rank .card-img {
    flex: auto;
    width: 100%;
    height: 280px;
    border-radius: 0;
}

.popular-card.top-rank .card-content {
    padding: 20px;
}

.popular-card.top-rank h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.popular-card.top-rank h2 a:hover {
    color: #d9534f;
}

.share-info {
    margin-top: 12px;
    font-size: 12px;
    color: #d9534f;
    font-weight: 600;
}

/* Sidebar Widgets */
.widget {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
    margin-bottom: 25px;
}

.widget-title {
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 2px solid #d9534f;
    padding-bottom: 5px;
}

/* Tag Cloud Widget */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.tag:hover {
    background: #d9534f;
    color: #fff;
}

/* Newsletter Widget */
.newsletter-widget {
    background: #1e293b;
    color: #fff;
}

.newsletter-widget p {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 15px;
}

.newsletter-form input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    margin-bottom: 10px;
    outline: none;
}

.newsletter-form button {
    width: 100%;
    padding: 10px;
    background: #d9534f;
    border: none;
    color: #fff;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

/* Footer */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 30px 0;
    text-align: center;
}

.footer-about p {
    font-size: 13px;
    margin-top: 8px;
}

.footer-bottom-text {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #1e293b;
    font-size: 12px;
}

/* Responsif Display */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .popular-card {
        flex-direction: column;
    }

    .card-img {
        flex: auto;
        width: 100%;
        height: 180px;
    }

    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }

    .header-flex {
        flex-direction: column;
        align-items: flex-start;
    }
}
