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

:root {
    --primary-color: #e74c3c;
    --secondary-color: #34495e;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #ddd;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

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

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary-color);
}

/* Header */
.header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.logo a {
    color: var(--primary-color);
}

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

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Sections */
section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--secondary-color);
}

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

.post-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-image img {
    transform: scale(1.1);
}

.post-content {
    padding: 1.5rem;
}

.post-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.post-category a {
    color: #fff;
}

.post-title {
    font-size: 1.3rem;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.post-title a {
    color: var(--secondary-color);
}

.post-excerpt {
    color: #666;
    margin: 1rem 0;
    line-height: 1.6;
}

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

.read-more {
    color: var(--primary-color);
    font-weight: 600;
}

/* News Page */
.news-page {
    min-height: 70vh;
}

.page-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

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

.category-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s;
}

.category-btn:hover,
.category-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-item {
    display: flex;
    gap: 2rem;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.post-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.post-thumbnail {
    flex: 0 0 300px;
    height: 200px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-info {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Single Post */
.post-single {
    padding: 2rem 0 3rem;
    background-color: #fff;
}

.post-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 0 20px;
}

.post-single .post-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0 1.5rem;
    color: var(--secondary-color);
    line-height: 1.3;
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-category {
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.post-featured-image {
    max-width: 100%;
    width: 100%;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.post-content-area {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 20px;
    font-size: 1.1rem;
    line-height: 1.9;
    color: #333;
}

.post-content-area h1,
.post-content-area h2 {
    margin: 2.5rem 0 1.5rem;
    color: var(--secondary-color);
    font-weight: 700;
    line-height: 1.4;
}

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

.post-content-area h2 {
    font-size: 1.7rem;
    color: var(--secondary-color);
}

.post-content-area h3 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

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

.post-content-area img {
    border-radius: 12px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto;
}

.post-content-area ul,
.post-content-area ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content-area li {
    margin-bottom: 0.8rem;
}

.post-content-area blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background-color: var(--light-bg);
    font-style: italic;
    color: #555;
}

.post-content-area a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

.post-content-area a:hover {
    color: var(--secondary-color);
}

.related-posts {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.related-posts h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    transition: all 0.3s;
}

.page-link:hover,
.page-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

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

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

.btn-block {
    display: block;
    width: 100%;
}

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

.no-posts {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Hide nav menu by default on mobile */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: #fff;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        text-align: left;
        transition: 0.3s;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        padding: 80px 20px 20px;
        z-index: 1000;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .nav-menu a {
        display: block;
        width: 100%;
        padding: 1rem;
        border-radius: 8px;
    }

    /* Overlay when menu is open */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

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

    .post-item {
        flex-direction: column;
    }

    .post-thumbnail {
        flex: none;
        width: 100%;
    }

    .post-single .post-title {
        font-size: 2rem;
    }

    .category-filter {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .post-single .post-title {
        font-size: 1.8rem;
    }

    .post-featured-image {
        margin: 1.5rem 0;
    }

    .post-featured-image img {
        max-height: 400px;
    }

    .post-content-area {
        font-size: 1rem;
        padding: 0 15px;
    }

    .post-meta {
        flex-direction: column;
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 2rem 0;
    }

    section {
        padding: 2rem 0;
    }

    .post-single .post-title {
        font-size: 1.5rem;
    }

    .post-featured-image img {
        max-height: 300px;
    }

    .post-content-area {
        margin: 2rem auto;
    }

    .post-content-area h1 {
        font-size: 1.5rem;
    }

    .post-content-area h2 {
        font-size: 1.3rem;
    }
}
