/* 🌟 Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
}

/* 🌟 Categories Section */
.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: auto;
}

.category {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.category img {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.category:hover {
    transform: scale(1.05);
}

.category:hover img {
    filter: brightness(80%);
}

.category-title {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap; /* Prevents text from breaking into multiple lines */
    overflow: hidden; /* Ensures text stays within bounds of the container */
    text-overflow: ellipsis; /* Adds '...' if text overflows */
}


/* 🌟 Blog Grid */
.blog-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: auto;
}

.blog-post {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.blog-post:hover {
    transform: translateY(-5px);
    cursor: pointer;
}

.blog-post img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-content {
    padding: 15px;
}

.blog-content h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.blog-content p {
    font-size: 14px;
    color: #777;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: #ff6f61;
    text-decoration: none;
    font-weight: bold;
}

.read-more:hover {
    text-decoration: underline;
}

/* 🌟 Popular Articles Section */
.popular-articles-container {
    padding: 20px;
    max-width: 1200px;
    margin: auto;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.popular-article {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    width: calc(33% - 20px);
    transition: transform 0.2s ease-in-out;
}

.popular-article:hover {
    transform: translateY(-5px);
    cursor: pointer;
}

.popular-article img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.popular-article-content {
    padding: 15px;
}

.popular-article h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.popular-article p {
    font-size: 14px;
    color: #777;
}

.popular-article a {
    color: #ff6f61;
    text-decoration: none;
    font-weight: bold;
}

.popular-article a:hover {
    text-decoration: underline;
}

/* 🌟 Responsive */
@media (max-width: 768px) {
    .blog-container {
        grid-template-columns: 1fr;
    }

    .popular-article {
        width: 100%;
    }
}