:root {
    --bg-color: #ffffff;
    --text-color: #374151; 
    --link-color: #111827; 
    --accent-color: #6b7280; 
    --hover-color: #2563eb; 
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 768px; 
}

[data-theme="dark"] {
    --bg-color: #1f2937;
    --text-color: #d1d5db;
    --link-color: #f9fafb;
    --accent-color: #9ca3af;
    --hover-color: #60a5fa;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    margin: 0;
    padding: 0 20px;
    transition: background-color 0.0s, color 0.0s;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
}

.logo {
    font-weight: bold;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--link-color);
}
nav {
    display: flex;
    align-items: center; 
}
nav a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.95rem;
}

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

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px; 
    margin-left: 20px;
    color: var(--text-color); 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /*transition: color 0.0s ease;*/
}

#theme-toggle svg {
    width: 24px; 
    height: 24px;
    stroke-width: 1.5; 
}

#theme-toggle:hover {
    color: var(--hover-color);
}

.year-group {
    margin-bottom: 40px;
}

.year-label {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--link-color);
}

.post-item {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 1.25rem;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
}

.post-title:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--hover-color);
}

.post-meta {
    font-size: 0.875rem;
    color: var(--accent-color);
    margin-top: 5px;
}

.post-desc {
    margin-top: 8px;
    font-size: 1rem;
}

footer {
    margin-top: 40px;
    border-top: 1px solid var(--accent-color);
    padding-top: 20px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--accent-color);
}

.about-container {
    display: flex;          
    align-items: flex-start; 
    gap: 30px;              
    margin-bottom: 60px;    
}

.profile-img {
    width: 250px;          
    height: auto;           
    border-radius: 10px;   
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
}

.content-wrapper {
    flex: 1;              
}

.content-wrapper h2 {
    margin-top: 0;
}


.filter-container {
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    border: 1px solid #ccc;
    background: transparent;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color); 
    transition: all 0.2s ease;
}

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

.filter-btn.active {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}


.tags {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.tag {
    background-color: #e5e7eb; 
    color: #374151;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .tag {
    background-color: #374151;
    color: #e5e7eb;
}

mjx-container {
    overflow-x: auto;     
    overflow-y: hidden;
    font-size: 1.1rem !important; 
}

.mjx-chtml, .mjx-math, .mjx-container svg {
    color: inherit !important;
    fill: currentColor !important;
}

.post-title-large {
    margin-bottom: 5px; 
    margin-top: 0;      
    line-height: 1.2;   
}

@media (max-width: 768px) {
    
    .about-container {
        flex-direction: column-reverse; 
        align-items: center; 
        text-align: center;  
    }

    .content-wrapper, 
    .image-wrapper {
        width: 100%;
    }

    .image-wrapper {
        margin-top: 30px;
    }

    .profile-img {
        max-width: 80%; 
        height: auto;
    }
}

body.preload-transitions {
    transition: background-color 0.3s, color 0.3s;
}