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

:root {
    --primary-color: #2563eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Navigation */
.navbar {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding-top: 10px;
}

/* Flash Messages */
.flash-message {
    padding: 1rem 0;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

.flash-success {
    background: rgba(34, 197, 94, 0.1);
    border-bottom: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

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

.flash-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.flash-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.navbar .container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 24px;
    height: 64px;
    gap: 2rem;
}

.nav-brand .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.nav-brand .logo-image {
    height: 74px;
    width: 74px;
    display: block;
}

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

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 1.09375rem;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: white;
}

.nav-link.active {
    color: #f0785f;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.inline-form {
    display: inline;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.logout-btn:hover {
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 2px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    background: var(--bg-primary);
    padding: 10rem 0 4rem;
    position: relative;
    overflow: hidden;
    margin-top: -64px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    color: white;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.cta-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.section-subtitle {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Featured Posts - 40/60 Grid Layout */
.featured-posts {
    background: var(--bg-secondary);
}

.featured-grid-layout {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    height: 500px;
}

.featured-main {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
}

.featured-grid {
    flex: 0 0 50%;
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
}

.featured-grid-top {
    display: flex;
    flex-direction: column;
}

.featured-grid-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.featured-grid-item {
    display: flex;
    flex-direction: column;
}

.featured-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.featured-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.featured-card-large .featured-image {
    height: 100%;
    flex-shrink: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.featured-card-small .featured-image {
    height: 100%;
    flex-shrink: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.featured-image {
    position: relative;
    overflow: hidden;
}

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

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.featured-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.featured-placeholder i {
    font-size: 2rem;
}

.featured-card-large .featured-placeholder i {
    font-size: 3rem;
}

.featured-content {
    padding: 1.5rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    color: white;
}

.featured-card-small .featured-content {
    padding: 1rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    color: white;
}

.featured-category {
    margin-bottom: 0.75rem;
}

.category-link {
    display: inline-block;
    background: #f0785f;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: background 0.2s ease;
}


.featured-title {
    color: white;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-card-large .featured-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.featured-card-small .featured-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.featured-card-small .featured-title a {
    color: white;
}

.featured-title a {
    color: white;
    text-decoration: none;
    letter-spacing: -0.025em;
    transition: color 0.2s ease;
}

.featured-title a:hover {
    color: var(--primary-color);
}

.featured-meta {
    display: none;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: auto;
    transition: all 0.3s ease;
}

.featured-card:hover .featured-meta {
    display: flex;
}

.featured-card-small .featured-meta {
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.featured-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-author span {
    color: var(--text-muted);
}

.featured-author a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.featured-author a:hover {
    color: white;
}

.featured-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-date i {
    font-size: 0.875rem;
}

/* Recent Posts */
.recent-posts {
    background: var(--bg-primary);
}

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

.post-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.post-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-image-container {
    position: relative;
    overflow: hidden;
}

.post-categories-overlay {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-categories-overlay .category-tag {
    background: #f0785f;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}


.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    line-height: 1.3;
    letter-spacing: -0.025em;
}

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

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.9375rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.post-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.category-tag {
    background: #f0785f;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.category-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Categories */
.categories-section {
    background: var(--bg-secondary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.category-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.25rem;
}

.category-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.category-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Newsletter */
.newsletter-section {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.newsletter-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.newsletter-form button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* Footer */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.125rem;
}

.footer-logo {
    height: 48px;
    width: auto;
    margin-bottom: 1.5rem;
    display: block;
}

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

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

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
    line-height: 1.5;
}

.footer-section a:hover {
    color: var(--text-primary);
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

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

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .featured-grid-layout {
        gap: 1rem;
    }
    
    .featured-main {
        flex: 0 0 45%;
    }
    
    .featured-grid {
        flex: 0 0 55%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.125rem;
    }

    .featured-grid-layout {
        flex-direction: column;
        height: auto;
        gap: 1.5rem;
    }

    .featured-main {
        flex: 1;
        margin-bottom: 0;
    }

    .featured-grid {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .featured-grid-top {
        order: 1;
    }

    .featured-grid-bottom {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .featured-grid-item {
        width: 100%;
    }

    .featured-card-large {
        height: 300px;
    }

    .featured-card-small {
        height: 200px;
    }

    .featured-card-large .featured-image {
        position: relative;
        height: 200px;
    }

    .featured-card-small .featured-image {
        position: relative;
        height: 120px;
    }

    .featured-card-large .featured-content {
        position: relative;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
        padding: 1.5rem;
    }

    .featured-card-small .featured-content {
        position: relative;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
        padding: 1rem;
    }

    .featured-meta {
        display: flex !important;
    }

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

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero {
        padding: 6rem 0 3rem;
    }
    
    .featured-card-large {
        height: 250px;
    }

    .featured-card-small {
        height: 180px;
    }

    .featured-card-large .featured-image {
        height: 150px;
    }

    .featured-card-small .featured-image {
        height: 100px;
    }

    .featured-content,
    .post-content {
        padding: 1rem;
    }

    .featured-card-large .featured-title {
        font-size: 1.25rem;
    }

    .featured-card-small .featured-title {
        font-size: 0.9rem;
    }

    .featured-meta {
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .featured-card-small .featured-meta {
        font-size: 0.7rem;
    }
}
