/* ====================
   assets/css/main.css
   ==================== */

:root {
    --primary-color: #1a73e8;
    --secondary-color: #5f6368;
    --background-color: #f8f9fa;
    --text-color: #202124;
    --border-color: #e8eaed;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 24px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    background: #fff;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.nav-menu {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    background: #f1f3f4;
    color: var(--primary-color);
}

/* Weather Info Styling */
.weather-info {
    margin-left: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--secondary-color);
}
.weather-info span:first-child {
    font-weight: 600;
    color: var(--primary-color);
}
@media (max-width: 768px) {
    .weather-info {
        margin-left: 0;
        margin-top: 12px;
        font-size: 14px;
        justify-content: flex-start;
    }
}

/* Category Tabs */
.category-tabs {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 8px;
}

.tab-item {
    padding: 12px 20px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-color);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab-item.active,
.tab-item:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Main Content */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

/* Hero Section */
.hero-section {
    margin-bottom: 32px;
}

.hero-article {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.hero-article:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.hero-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.hero-content {
    padding: 24px;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--text-color);
}

.hero-excerpt {
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--secondary-color);
    flex-wrap: wrap;
}

.source-name {
    font-weight: 600;
    color: var(--primary-color);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.news-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: var(--transition);
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-excerpt {
    font-size: 14px;
    color: var(--secondary-color);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-section {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
}

.trending-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background 0.3s ease;
}

.trending-item:hover {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin: 0 -12px;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 24px;
}

.trending-content {
    flex: 1;
}

.trending-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.trending-source {
    font-size: 12px;
    color: var(--secondary-color);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 16px 20px;
    }
    .search-bar {
        width: 100%;
        margin: 16px 0;
    }
    .nav-menu {
        display: none;
    }
    .main-container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 16px;
    }
    .hero-title {
        font-size: 24px;
    }
    .news-grid {
        grid-template-columns: 1fr;
    }
    .tabs-container {
        padding: 0 16px;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    body {
        background: #202124;
        color: #e8eaed;
    }
    .header {
        background: #303134;
        border-bottom-color: #5f6368;
    }
    .category-tabs {
        background: #303134;
        border-bottom-color: #5f6368;
    }
    .news-card,
    .hero-article,
    .sidebar-section {
        background: #303134;
    }
    .search-input {
        background: #303134;
        border-color: #5f6368;
        color: #e8eaed;
    }
    .trending-item {
        border-bottom-color: #5f6368;
    }
    .trending-item:hover {
        background: #404144;
    }
}

.single-featured-image,
.single .post-thumbnail img {
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 100%;
    height: auto;
    display: block;
}