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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --light-gray: #f4f4f4;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--light-gray);
}

/* Header Styles */
.main-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li a {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

.nav-menu li a:hover {
    color: var(--secondary-color);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 1rem;
}

/* Featured Posts */
.featured-posts {
    margin-bottom: 2rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.post-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 1rem 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    display: flex;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.post-title {
    margin: 0.3rem 0 0.5rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
    padding-top: 0.8rem;
    border-top: 1px solid #eee;
}

/* Posts list styles */
.post-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.category {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background: rgba(44, 62, 80, 0.1);
    border-radius: 4px;
}

.views {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #666;
    font-size: 0.8rem;
}

/* Sidebar */
.content-sidebar-wrapper {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.sidebar {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.widget {
    margin-bottom: 2rem;
}

.widget h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
}

.categories-list,
.recent-posts {
    list-style: none;
}

.categories-list li,
.recent-posts li {
    margin-bottom: 0.5rem;
}

.categories-list a,
.recent-posts a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.categories-list a:hover,
.recent-posts a:hover {
    color: var(--secondary-color);
}

/* Footer */
.main-footer {
    background: var(--primary-color);
    color: #fff;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #fff;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-sidebar-wrapper {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        display: none;
    }
} 

/* Post item styles */
.post-item {
    margin-bottom: 2rem;
}

.post-item-wrapper {
    display: flex;
    gap: 1.5rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.post-item-image {
    flex: 0 0 300px;
    height: 200px;
}

.post-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-item-content {
    flex: 1;
    padding: 1.5rem;
}

/* Mobile menu styles */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .container {
        padding: 1rem;
    }
    
    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        padding: 1rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .menu-open .nav-menu {
        display: block;
    }
    
    .nav-menu li {
        display: block;
        margin: 0.5rem 0;
    }
    
    .content-sidebar-wrapper {
        grid-template-columns: 1fr;
    }
    
    .post-item-wrapper {
        flex-direction: column;
    }
    
    .post-item-image {
        flex: 0 0 200px;
    }
}

@media (max-width: 480px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Loading skeleton styles */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
} 

/* Section header styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.view-all:hover {
    color: var(--secondary-color);
}

/* Load more button */
.load-more {
    text-align: center;
    margin: 2rem 0;
}

.btn-load-more {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-load-more:hover {
    background: var(--secondary-color);
}

.btn-load-more.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .section-header {
        flex-direction: row;
        align-items: center;
        padding: 0 1rem;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .post-item-wrapper {
        margin: 0 1rem;
    }
    
    .sidebar {
        margin: 0 1rem;
    }
    
    .load-more {
        padding: 0 1rem;
    }
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 0.5rem;
}

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

/* Loading and Error styles */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    text-align: center;
} 

/* Post detail styles */
.post-detail {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.post-header {
    padding: 2rem;
    text-align: left;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.post-header .post-title {
    font-size: 2rem;
    margin: 0.5rem 0 1rem;
    color: var(--primary-color);
    line-height: 1.3;
}

.post-header .post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
}

.post-header .category {
    color: var(--primary-color);
    background: rgba(44, 62, 80, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.post-featured-image {
    width: 100%;
    height: 400px;
    position: relative;
}

.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 2rem;
    line-height: 1.7;
    font-size: 1rem;
    color: #333;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.related-posts {
    margin-top: 2rem;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.related-posts h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.related-posts .posts-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Sidebar styles */
.sidebar .widget {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sidebar .widget h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.sidebar .recent-posts li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.sidebar .recent-posts li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-sidebar-wrapper {
        grid-template-columns: 2fr 1fr;
    }
    
    .post-header .post-title {
        font-size: 1.8rem;
    }
    
    .post-featured-image {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .content-sidebar-wrapper {
        grid-template-columns: 1fr;
    }
    
    .post-header {
        padding: 1.5rem;
    }
    
    .post-header .post-title {
        font-size: 1.5rem;
    }
    
    .post-featured-image {
        height: 300px;
    }
    
    .post-content {
        padding: 1.5rem;
    }
    
    .related-posts {
        padding: 1.5rem;
    }
    
    .related-posts .posts-grid {
        grid-template-columns: 1fr;
    }
} 

/* Category page styles */
.category-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

.category-header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.category-header p {
    color: #666;
    font-size: 1.1rem;
}

.categories-list .active a {
    color: var(--primary-color);
    font-weight: 600;
}

.post-count {
    color: #666;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.no-posts {
    text-align: center;
    padding: 3rem;
    color: #666;
    background: #fff;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .category-header {
        padding: 1.5rem 0;
    }
    
    .category-header h1 {
        font-size: 1.5rem;
    }
} 