/* ========================================
   KorапBersih - Clean News Portal CSS
   ======================================== */

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #e94560;
    --text: #333;
    --text-light: #666;
    --bg: #f8f9fa;
    --white: #fff;
    --border: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-family: 'Merriweather', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 25px;
}

.nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

.last-update {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ========================================
   Main Layout
   ======================================== */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.layout {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 25px;
    align-items: start;
}

/* ========================================
   Sidebar Ads
   ======================================== */
.sidebar {
    position: sticky;
    top: 100px;
}

.ad-container {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.ad-label {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-placeholder {
    min-height: 600px;
    background: linear-gradient(180deg, #f0f0f0, #e0e0e0);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========================================
   News Section
   ======================================== */
.news-section {
    margin-bottom: 40px;
}

.section-title {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent);
}

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

/* ========================================
   News Card
   ======================================== */
.news-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.news-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.news-card-content {
    padding: 15px;
}

.news-card-title {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-title a {
    color: inherit;
    text-decoration: none;
}

.news-card-title a:hover {
    color: var(--accent);
}

.news-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

.news-card-source {
    background: var(--primary);
    color: var(--white);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.news-card-date {
    opacity: 0.7;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--primary);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer h3, .footer h4 {
    margin-bottom: 15px;
}

.footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-links a {
    display: block;
    color: var(--white);
    opacity: 0.8;
    text-decoration: none;
    padding: 5px 0;
    font-size: 0.9rem;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ========================================
   Loading State
   ======================================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1200px) {
    .layout {
        grid-template-columns: 160px 1fr 160px;
    }
}

@media (max-width: 992px) {
    .layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}