body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.content-wrapper {
    display: flex;
    gap: 20px;
}

main {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
}

.sidebar {
    width: 300px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.article-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-preview {
    padding: 15px;
}

.article-preview h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.article-preview p {
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-full {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.back-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 1rem;
}

.back-button:hover {
    background: #2980b9;
}

.article-full img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
}

.article-full h1 {
    margin-top: 0;
}

.loading {
    text-align: center;
    padding: 50px;
    font-size: 1.2rem;
    color: #666;
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
}

/* Ad Containers */
.ad-container {
    margin: 20px 0;
    background: #f8f8f8;
    border-radius: 4px;
    overflow: hidden;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-header {
    width: 100%;
    margin: 20px auto;
    min-height: 90px;
}

.ad-sidebar {
    width: 100%;
    position: sticky;
    top: 20px;
    margin-bottom: 20px;
}

.ad-article-top {
    width: 100%;
    margin: 0 auto 30px;
}

.ad-article-middle {
    width: 100%;
    margin: 30px auto;
}

.ad-article-content {
    width: 100%;
    margin: 0 auto 30px;
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        order: -1;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .ad-container {
        min-height: 50px;
    }
    
    .ad-sidebar {
        position: static;
    }
}