/* Base Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #f59e0b;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 0.5rem;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
header {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: -5px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

nav a:hover, nav a.active {
    color: var(--primary-color);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-light);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#search-input {
    border: none;
    padding: 0.5rem 1rem;
    background-color: transparent;
    width: 200px;
    font-family: inherit;
}

#search-input:focus {
    outline: none;
}

#search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content Styles */
main {
    padding: 2rem 0;
}

.featured-section {
    margin-bottom: 2rem;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
}

.featured-post {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.featured-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-post-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}

.featured-post-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.featured-post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.featured-post-excerpt {
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
}

.read-more:hover {
    background-color: var(--primary-hover);
    color: white;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-options button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.view-options button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#sort-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
}

.posts-container {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.posts-container.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.posts-container.list-view {
    grid-template-columns: 1fr;
}

.post-card {
    background-color: var(--bg-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.post-card-image {
    height: 200px;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-category {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    margin-bottom: 0.5rem;
}

.post-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.post-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.post-card-excerpt {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* List view specific styles */
.posts-container.list-view .post-card {
    display: flex;
}

.posts-container.list-view .post-card-image {
    width: 300px;
    height: auto;
    flex-shrink: 0;
}

.posts-container.list-view .post-card-content {
    flex-grow: 1;
}

.load-more-container {
    text-align: center;
    margin-bottom: 2rem;
}

#load-more-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
}

#load-more-btn:hover {
    background-color: var(--primary-hover);
}

/* Footer Styles */
footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.footer-links h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Skeleton Loader */
.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius);
    height: 300px;
}

.featured-loader {
    height: 400px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    nav ul {
        margin: 1rem 0;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        width: 100%;
    }
    
    .search-container {
        width: 100%;
    }
    
    #search-input {
        width: 100%;
    }
    
    .posts-container.list-view .post-card {
        flex-direction: column;
    }
    
    .posts-container.list-view .post-card-image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 768px) {
    .featured-post {
        height: 300px;
    }
    
    .featured-post-content h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .posts-container.grid-view {
        grid-template-columns: 1fr;
    }
}