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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, #2B5F9E 0%, #3498db 30%, #5DADE2 60%, #F39C12 100%);
    color: #fff;
    padding: 3rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 0;
}

.site-header .container {
    position: relative;
    z-index: 1;
}

.header-content {
    margin-bottom: 1.5rem;
    text-align: center;
}

.site-title {
    margin-bottom: 0.75rem;
}

.site-title a {
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.site-logo {
    height: 80px;
    width: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(0,0,0,0.4);
}

/* Add a subtle gradient overlay for faded edges */
.site-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle at center, transparent 50%, rgba(243, 156, 18, 0.2) 100%);
    pointer-events: none;
}

.site-description {
    color: #e8f1f8;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    font-weight: 300;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.site-nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.site-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.site-nav a.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Special styling for About and Contribute buttons */
.site-nav a.nav-special {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.site-nav a.nav-special:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 300px);
    padding-bottom: 2rem;
}

/* Subject Header */
.subject-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: #fff;
    text-align: center;
}

.subject-header h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.subject-header p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto;
}

/* Search Section */
.search-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-section h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

/* Filters Section */
.filters-section {
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filters-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.25rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.filter-group label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.filter-select {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: #3498db;
}

.btn-reset {
    padding: 0.5rem 1.5rem;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    height: fit-content;
}

.btn-reset:hover {
    background-color: #c0392b;
}

/* Posts Section */
.posts-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.75rem;
}

.posts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.post-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    flex: 1 1 350px;
    max-width: calc(33.333% - 1.5rem);
    order: 0;
}

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

.post-card-title {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.post-card-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.post-card-title a:hover {
    color: #3498db;
}

.post-card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.post-card-author {
    font-style: italic;
}

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

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #3498db;
    color: #fff;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-card-summary {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.post-card-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s;
}

.post-card-link:hover {
    color: #2980b9;
}

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

/* Post Page */
.post {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.post ul,
.post ol {
    margin-left: 3rem;
    margin-bottom: 1.5rem;
}

.post li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #ecf0f1;
}

.post-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-summary {
    font-size: 1.125rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

.post-link {
    margin: 2rem 0;
    text-align: center;
}

.external-link {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.external-link:hover {
    background-color: #2980b9;
}

/* Footer */
.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.site-footer a {
    color: #3498db;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .posts-grid {
        flex-direction: column;
    }
    
    .post-card {
        max-width: 100%;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .site-nav {
        gap: 0.5rem;
    }
    
    .site-logo {
        height: 60px;
        width: 60px;
    }
    
    .site-description {
        font-size: 0.95rem;
    }
    
    .site-nav a {
        padding: 0.5rem 0.9rem;
        font-size: 0.9rem;
    }
}
