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

:root {
    /* Light theme colors */
    --bg-primary: #f5f7fa;
    --bg-secondary: #c3cfe2;
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --text-muted: #7f8c8d;
    --accent-primary: #3498db;
    --accent-secondary: #9b59b6;
    --surface-primary: rgba(255, 255, 255, 0.95);
    --surface-secondary: rgba(255, 255, 255, 0.9);
    --border-primary: rgba(0, 0, 0, 0.1);
    --border-secondary: rgba(0, 0, 0, 0.05);
    --shadow-primary: rgba(0, 0, 0, 0.1);
    --shadow-secondary: rgba(0, 0, 0, 0.15);
    --modal-bg: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #b0b0b0;
    --accent-primary: #64b5f6;
    --accent-secondary: #ba68c8;
    --surface-primary: rgba(45, 45, 45, 0.95);
    --surface-secondary: rgba(45, 45, 45, 0.9);
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-secondary: rgba(255, 255, 255, 0.05);
    --shadow-primary: rgba(0, 0, 0, 0.3);
    --shadow-secondary: rgba(0, 0, 0, 0.4);
    --modal-bg: rgba(0, 0, 0, 0.9);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Header */
.header {
    background: var(--surface-primary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-primary);
    padding: 2rem 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-text {
    text-align: center;
    margin-bottom: 0;
}

.site-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    line-height: 1.1;
    transition: color 0.3s ease;
    text-transform: uppercase;
}

.site-subtitle {
    font-family: 'Crimson Text', serif;
    font-size: 1.6rem;
    font-style: italic;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 0;
    letter-spacing: 0.01em;
    transition: color 0.3s ease;
}

.site-title {
    font-size: 3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--surface-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px var(--shadow-primary);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    transition: all 0.3s ease;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

/* Navigation */
.navigation {
    background: var(--surface-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-secondary);
    padding: 1rem 0;
    position: relative;
    z-index: 99;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    border: 2px solid var(--border-primary);
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

.nav-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.entries-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

/* Entry Cards */
.entry {
    background: var(--surface-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-primary);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-secondary);
}

.entry:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow-secondary);
}

.entry-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

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

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

.entry-content {
    padding: 2rem;
}

.entry-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.entry-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    transition: color 0.3s ease;
}

.entry-date {
    font-weight: 500;
}

.entry-author {
    font-style: italic;
    color: var(--accent-primary);
    transition: color 0.3s ease;
}

.entry-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    transition: color 0.3s ease;
}

.read-more-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    backdrop-filter: blur(5px);
    transition: background-color 0.3s ease;
}

.modal-content {
    background-color: var(--surface-primary);
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.modal-body {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-image {
    height: 300px;
    overflow: hidden;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-text {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    transition: color 0.3s ease;
}

#modalContent {
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

/* Footer */
.footer {
    background: var(--surface-primary);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-primary);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.footer-content p:last-child {
    margin-bottom: 0;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 0;
    }
    
    .site-title {
        font-size: 3rem;
        font-weight: 400;
        letter-spacing: 0.05em;
    }
    
    .site-subtitle {
        font-size: 1.2rem;
    }
    
    .theme-toggle {
        top: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
    }
    
    .nav-container {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .entries-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .entry-content {
        padding: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-image {
        height: 200px;
    }
    
    .modal-text {
        padding: 1.5rem;
    }
    
    .modal-text h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 2.5rem;
        font-weight: 400;
        letter-spacing: 0.05em;
    }
    
    .site-subtitle {
        font-size: 1.1rem;
    }
    
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    
    .nav-container {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .entry-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 2% auto;
    }
    
    .modal-text {
        padding: 1rem;
    }
}

/* Animation for entries */
.entry {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for multiple entries */
.entry:nth-child(1) { animation-delay: 0.1s; }
.entry:nth-child(2) { animation-delay: 0.2s; }
.entry:nth-child(3) { animation-delay: 0.3s; }
