/* Variables */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-gray: #f5f6fa;
    --border-color: #ddd;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

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

/* Container */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.blog-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.blog-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.blog-description {
    color: #666;
    font-size: 1.1rem;
}

/* Search Bar */
.blog-search {
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-button {
    padding: 0.8rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.search-button:hover {
    background-color: #2980b9;
}

/* Content Layout */
.blog-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

/* Sidebar */
.blog-sidebar {
    flex: 0 0 250px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
    height: fit-content;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h2 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.tags-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.tag-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: translateX(5px);
}

.tag-item.active-tag {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

.tag-name {
    font-size: 0.95rem;
}

/* Main Content */
.blog-main-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.search-results-header {
    margin-bottom: 2rem;
}

.search-results-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.blog-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.blog-image {
    position: relative;
    padding-top: 60%;
}

.blog-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-details {
    padding: 1.5rem;
}

.blog-details h3 {
    margin-bottom: 1rem;
}

.blog-details h3 a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.2rem;
}

.blog-details h3 a:hover {
    color: var(--secondary-color);
}

.blog-excerpt {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.article-tag {
    padding: 0.2rem 0.6rem;
    background-color: var(--light-gray);
    border-radius: 15px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
}

.article-tag:hover {
    background-color: var(--secondary-color);
    color: white;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.publish-date {
    color: #666;
}

.read-more {
    color: var(--secondary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--primary-color);
}

/* No Articles Message */
.no-articles {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-articles i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.reset-search {
    display: inline-block;
    margin-top: 1rem;
    color: var(--secondary-color);
    text-decoration: none;
}

.reset-search:hover {
    text-decoration: underline;
}

/* Clear Filters */
.clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.clear-filters:hover {
    text-decoration: underline;
}

.clear-filters.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 992px) {
    .blog-content {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        order: 2;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-container {
        padding: 1rem;
    }

    .blog-header {
        padding: 1.5rem;
    }

    .blog-header h1 {
        font-size: 2rem;
    }

    .search-form {
        flex-direction: column;
    }

    .search-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .blog-main-content {
        padding: 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .blog-details h3 a {
        font-size: 1.1rem;
    }
}
