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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

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

/* Header and Navigation */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-logo i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.admin-link {
    background: var(--accent-color);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    padding: 2.5rem 0 1.5rem;
    margin-top: 70px;
    min-height: 280px;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 1rem 0.5rem 1rem;
    min-height: 100%;
    height: 100%;
}

.hero-text h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.hero-image {
    text-align: center;
}

.hero-image i {
    font-size: 12rem;
    opacity: 0.8;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #d97706;
    transform: translateY(-2px);
}


.btn-secondary {
    background: #f3f4f6; /* subtle light gray background for visibility */
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Sections */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

/* Featured Posts */
.featured-section {
    padding: 4rem 0;
    background: var(--bg-white);
}

.featured-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.featured-post {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
}

.featured-post:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-large);
}

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.post-category {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.post-card h3,
.featured-post h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.post-title-link {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

.post-title-link:hover {
    color: var(--primary-color);
}

.post-card p,
.featured-post p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Categories */
.categories-section {
    padding: 4rem 0;
    background: var(--bg-light);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.category-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Posts Section */
.posts-section {
    padding: 4rem 0;
    background: var(--bg-white);
}

.posts-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.load-more-container {
    text-align: center;
}

/* Newsletter */
.newsletter-section {
    background: var(--text-dark);
    color: white;
    padding: 4rem 0;
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap;
    align-items: stretch;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    min-width: 200px;
    max-width: 100%;
    min-height: 44px;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-logo i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* Loading placeholders */
.loading-placeholder {
    opacity: 0.7;
}

.post-image-placeholder {
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Improved responsive base styles */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

/* Flexible images */
img {
    max-width: 100%;
    height: auto;
}

/* Better form inputs */
input, textarea, select {
    max-width: 100%;
    min-height: 44px;
    font-size: 1rem;
}

/* Improved focus states */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.6s; }

/* Lazy loading styles */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* Error message styles */
.error-message {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 2rem;
}

/* Utility classes for responsive design */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

/* Responsive text sizing */
.responsive-text-sm {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.responsive-text-base {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
}

.responsive-text-lg {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
}

.responsive-text-xl {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
}

.responsive-text-2xl {
    font-size: clamp(1.5rem, 5vw, 2rem);
}

.responsive-text-3xl {
    font-size: clamp(2rem, 6vw, 3rem);
}

/* Single Post Page Styles */
.single-post {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent-color);
}

.post-header {
    margin-bottom: 2rem;
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.post-meta-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.featured-image-placeholder {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

.post-body {
    margin-bottom: 3rem;
}

.post-excerpt {
    font-size: 1.125rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
}

.post-content-text {
    font-size: 1.125rem;
    line-height: 1.8;
}

.post-content-text p {
    margin-bottom: 1.5rem;
}

.post-content-text p:last-child {
    margin-bottom: 0;
}

/* Enhanced formatting for post content */
.post-content-text h1,
.post-content-text h2,
.post-content-text h3 {
    margin: 2rem 0 1rem 0;
    color: var(--text-dark);
    font-weight: 700;
}

.post-content-text h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.post-content-text h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.post-content-text h3 {
    font-size: 1.25rem;
}

.post-content-text code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.post-content-text pre {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content-text pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.post-content-text strong {
    font-weight: 600;
    color: var(--text-dark);
}

.post-content-text em {
    font-style: italic;
    color: var(--text-light);
}

.post-content-text a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: var(--transition);
}

.post-content-text a:hover {
    color: var(--accent-color);
}

.post-actions {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.social-share h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: white;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-btn.copy {
    background: var(--secondary-color);
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.post-engagement {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.engagement-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    background: transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
}

.engagement-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.post-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.nav-posts {
    display: flex;
    gap: 1rem;
}

.nav-post {
    display: flex;
    flex-direction: column;
    max-width: 200px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
}

.nav-post:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.nav-title {
    font-weight: 500;
    line-height: 1.4;
}

.related-posts {
    margin-bottom: 3rem;
}

.related-posts h3 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.related-post-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.related-post-image {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.related-post-content {
    padding: 1rem;
}

.related-post-category {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.related-post-content h4 {
    margin-bottom: 0.5rem;
}

.related-post-content h4 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

.related-post-content h4 a:hover {
    color: var(--primary-color);
}

.related-post-content p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.related-post-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.loading-container,
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
}

.error-message {
    max-width: 500px;
    padding: 2rem;
}

.error-message i {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.error-message h2 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Responsive Design for Single Post */
@media (max-width: 768px) {
    .single-post {
        padding: 1rem 0;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-meta-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .post-stats {
        flex-wrap: wrap;
    }
    
    .featured-image,
    .featured-image-placeholder {
        height: 250px;
    }
    
    .post-navigation {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-posts {
        flex-direction: column;
    }
    
    .nav-post {
        max-width: none;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .post-engagement {
        justify-content: center;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}