:root {
    --primary-font: 'Open Sans', sans-serif;
    --heading-font: 'Montserrat', sans-serif;
    --border-radius: 8px;
    --bg-color: #FDFDFD;
    --text-color-primary: #333333;
    --text-color-secondary: #555555;
    --accent-color: #7E9978;
    --accent-color-hover: #6D8468;
    --nav-link-active-color: var(--accent-color);
    --border-color: #EAEAEA;
    --card-bg-color: #FFFFFF;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --code-bg-color: #f0f0f0;
    --pre-bg-color: #2d2d2d;
    --pre-text-color: #f8f8f2;
    --blockquote-bg-color: #f9f9f9;
    --blockquote-border-color: var(--accent-color);
    --theme-icon-color: var(--text-color-secondary);
    --theme-icon-hover-color: var(--accent-color);
    --loading-text-color: var(--text-color-secondary);
    --focus-outline-color: transparent;
    --badge-text-color: #333333;
}

body.dark-theme {
    --bg-color: #1A1A1A;
    --text-color-primary: #E0E0E0;
    --text-color-secondary: #AAAAAA;
    --accent-color: #f7bcc2;
    --accent-color-hover: #f49ba5;
    --nav-link-active-color: var(--accent-color);
    --border-color: #333333;
    --card-bg-color: #242424;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --code-bg-color: #3a3a3a;
    --pre-bg-color: #1e1e1e;
    --pre-text-color: #d4d4d4;
    --blockquote-bg-color: #2c2c2c;
    --blockquote-border-color: var(--accent-color);
    --theme-icon-color: var(--text-color-secondary);
    --theme-icon-hover-color: var(--accent-color);
    --loading-text-color: var(--text-color-secondary);
    --focus-outline-color: transparent;
    --badge-text-color: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--primary-font);
    line-height: 1.7;
    background-color: var(--bg-color);
    color: var(--text-color-primary);
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background-color: var(--accent-color);
    color: var(--badge-text-color);
    padding: 10px 15px;
    z-index: 9999;
    text-decoration: none;
    font-weight: bold;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 10px;
    outline: 2px solid var(--focus-outline-color);
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    transition: border-color 0.3s ease;
}

header .site-title a {
    font-family: var(--heading-font);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

header .site-title a:hover,
header .site-title a:focus-visible {
    color: var(--accent-color);
    outline: 2px solid var(--focus-outline-color);
}

header nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

header nav .nav-link {
    font-family: var(--heading-font);
    text-decoration: none;
    color: var(--text-color-secondary);
    margin-left: 25px;
    font-weight: 400;
    transition: color 0.3s ease, border-color 0.3s ease;
    font-size: 1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

header nav .nav-link:hover,
header nav .nav-link:focus-visible {
    color: var(--accent-color);
    outline: 2px solid var(--focus-outline-color);
}
header nav .nav-link:focus-visible {
    border-bottom-color: var(--accent-color);
}

header nav .nav-link.active {
    color: var(--nav-link-active-color);
    border-bottom-color: var(--nav-link-active-color);
    font-weight: 700;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 25px;
}

#search-input {
    padding: 8px 28px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--card-bg-color);
    color: var(--text-color-primary);
    font-family: var(--primary-font);
    font-size: 0.9rem;
    min-width: 180px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

#search-input:focus {
    border-color: var(--accent-color);
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 1px;
}

.search-clear-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    line-height: 1;
}
.search-clear-button:hover,
.search-clear-button:focus-visible {
    color: var(--text-color-primary);
    outline: 2px solid var(--focus-outline-color);
}

.theme-toggle-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-icon-color);
    border-radius: var(--border-radius);
}

.theme-toggle-button:hover {
    color: var(--theme-icon-hover-color);
}
.theme-toggle-button:focus-visible {
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 2px;
    color: var(--theme-icon-hover-color);
}

.theme-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    transition: color 0.3s ease;
}

body:not(.dark-theme) #theme-toggle #sun-icon { display: none; }
body:not(.dark-theme) #theme-toggle #moon-icon { display: inline-block; }
body.dark-theme #theme-toggle #moon-icon { display: none; }
body.dark-theme #theme-toggle #sun-icon { display: inline-block; }

.main-content-area {
    display: flex;
    gap: 30px;
}

#app-content {
    flex: 3;
    min-width: 0;
}
#app-content:focus {
    outline: none;
}

.featured-posts-section,
.regular-posts-section {
    margin-bottom: 40px;
}

.featured-posts-section {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.regular-posts-section + .regular-posts-section {
    margin-top: -20px;
}

.section-title,
.search-results-heading {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    color: var(--text-color-primary);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.static-page-content {
    background-color: var(--card-bg-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.static-page-content h1 {
    font-family: var(--heading-font);
    font-size: 2rem;
    color: var(--text-color-primary);
    margin-bottom: 20px;
}
.static-page-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 15px;
}
.static-page-content a {
    color: var(--accent-color);
    text-decoration: underline;
}
.static-page-content a:hover,
.static-page-content a:focus-visible {
    color: var(--accent-color-hover);
    outline: 2px solid var(--focus-outline-color);
}
.static-page-content a:focus-visible {
    text-decoration: none;
}

.loading-message {
    padding: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--loading-text-color);
}

.sidebar {
    flex: 1;
    min-width: 280px;
}

.sidebar section {
    background-color: var(--card-bg-color);
    padding: 20px;
    margin-bottom: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.sidebar h2 {
    font-family: var(--heading-font);
    font-size: 1.3rem;
    color: var(--text-color-primary);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.sidebar h2 a {
    color: inherit;
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding-bottom: 2px; 
}

.sidebar h2 a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px; 
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease-out;
}

.sidebar h2 a:hover::after,
.sidebar h2 a:focus-visible::after {
    width: 100%;
}

.sidebar h2 a:focus-visible {
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 2px;
}


.discord-iframe-container {
    width: 100%;
    min-height: 380px;
}

.discord-iframe-container iframe {
    width: 100%;
    height: 400px;
    border-radius: var(--border-radius);
    border: none;
}

#discord-custom-info p {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.recent-posts-sidebar ul {
    list-style: none;
}

.recent-posts-sidebar ul li a {
    text-decoration: none;
    color: var(--accent-color);
    font-size: 0.95rem;
    line-height: 1.8;
    transition: color 0.2s ease-in-out;
    display: inline-block;
    padding: 2px 0;
}

.recent-posts-sidebar ul li a:hover {
    color: var(--text-color-primary);
    text-decoration: underline;
}
body.dark-theme .recent-posts-sidebar ul li a:hover {
    color: var(--text-color-primary);
}

.recent-posts-sidebar ul li a:focus-visible {
    color: var(--text-color-primary);
    text-decoration: underline;
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 2px;
}

.post-list-item {
    background-color: var(--card-bg-color);
    padding: 25px;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.post-list-item--featured {
    border-left: 4px solid var(--accent-color);
}

.featured-badge {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--badge-text-color);
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-list-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
body.dark-theme .post-list-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.post-list-item h2 a {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    color: var(--text-color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-list-item h2 a:hover,
.post-list-item h2 a:focus-visible {
    color: var(--accent-color);
    outline: 2px solid var(--focus-outline-color);
}

.post-list-item h2 a:focus-visible {
    outline-offset: 2px;
    border-radius: 2px;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
    margin: 10px 0 15px 0;
    transition: color 0.3s ease;
}

.post-snippet {
    font-size: 1rem;
    color: var(--text-color-primary);
    line-height: 1.7;
    transition: color 0.3s ease;
}

.read-more-link {
    display: inline-block;
    margin-top: 15px;
    font-family: var(--heading-font);
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-color);
    transition: color 0.3s ease;
    padding: 2px 0;
}

.read-more-link:hover,
.read-more-link:focus-visible {
    color: var(--accent-color-hover);
    outline: 2px solid var(--focus-outline-color);
}

.read-more-link:focus-visible {
    outline-offset: 2px;
    border-radius: 2px;
}

.full-post-content h1 {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    color: var(--text-color-primary);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.full-post-content .post-meta {
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.full-post-content .post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color-primary);
    transition: color 0.3s ease;
}

.full-post-content .post-body p {
    margin-bottom: 20px;
}

.full-post-content .post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}
body.dark-theme .full-post-content .post-body img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.full-post-content .post-body h1,
.full-post-content .post-body h2,
.full-post-content .post-body h3,
.full-post-content .post-body h4,
.full-post-content .post-body h5,
.full-post-content .post-body h6 {
    font-family: var(--heading-font);
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text-color-primary);
    transition: color 0.3s ease;
    line-height: 1.3;
}
.full-post-content .post-body h1 { font-size: 2rem; }
.full-post-content .post-body h2 { font-size: 1.7rem; }
.full-post-content .post-body h3 { font-size: 1.4rem; }
.full-post-content .post-body h4 { font-size: 1.2rem; }
.full-post-content .post-body h5 { font-size: 1.1rem; }
.full-post-content .post-body h6 { font-size: 1rem; }

.full-post-content .post-body a {
    color: var(--accent-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}
.full-post-content .post-body a:hover,
.full-post-content .post-body a:focus-visible {
    color: var(--accent-color-hover);
    outline: 2px solid var(--focus-outline-color);
}
.full-post-content .post-body a:focus-visible {
    text-decoration: none;
}

.full-post-content .post-body ul,
.full-post-content .post-body ol {
    margin-left: 20px;
    margin-bottom: 20px;
    padding-left: 20px;
}

.full-post-content .post-body li {
    margin-bottom: 8px;
}

.full-post-content .post-body blockquote {
    border-left: 4px solid var(--blockquote-border-color);
    margin: 25px 0;
    padding: 15px 25px;
    background-color: var(--blockquote-bg-color);
    font-style: italic;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.full-post-content .post-body blockquote p {
    margin-bottom: 0;
}

.full-post-content .post-body pre {
    background-color: var(--pre-bg-color);
    color: var(--pre-text-color);
    padding: 1em;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    margin: 20px 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
}
.full-post-content .post-body code {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--code-bg-color);
    color: var(--text-color-primary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
    transition: background-color 0.3s ease, color 0.3s ease;
}
body.dark-theme .full-post-content .post-body code {
    color: var(--text-color-primary);
}

.full-post-content .post-body pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 1em;
    color: inherit;
}

.back-to-blog-link {
    display: inline-block;
    margin-top: 30px;
    margin-bottom: 20px;
    font-family: var(--heading-font);
    text-decoration: none;
    color: var(--accent-color);
    transition: color 0.3s ease;
    font-weight: 600;
    padding: 2px 0;
}

.back-to-blog-link:hover,
.back-to-blog-link:focus-visible {
    color: var(--accent-color-hover);
    outline: 2px solid var(--focus-outline-color);
}

footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    transition: border-color 0.3s ease, color 0.3s ease;
}

@media (max-width: 992px) {
    .main-content-area {
        flex-direction: column;
    }
    #app-content {
        order: 1;
    }
    .sidebar {
        order: 2;
        min-width: 100%;
    }
    header nav .nav-link {
        margin-left: 15px;
    }
    .search-container {
        margin-left: 15px;
        flex-grow: 1;
    }
    #search-input {
        min-width: 150px;
        width: 100%;
    }
    .theme-toggle-button {
        margin-left: 10px;
    }
}

@media (max-width: 768px) {
    body { font-size: 15px; }
    header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 15px; 
    }
    header nav { 
        margin-top: 0; 
        width:100%; 
        display:flex; 
        justify-content: space-between; 
        align-items: center; 
        gap: 10px;
    }
    header nav .nav-link { 
        margin-left: 0; 
        margin-right: 10px; 
    }
    .search-container {
        margin-left: 0; 
        order: -1; 
        min-width: 150px;
        flex-basis: 60%;
    }
    .theme-toggle-button { 
        margin-left: 10px;
    }
    header .site-title a { font-size: 1.8rem; }
    .post-list-item h2 a { font-size: 1.5rem; }
    .full-post-content h1 { font-size: 2rem; }
    .static-page-content h1 { font-size: 1.8rem; }
    .section-title, .search-results-heading { font-size: 1.6rem; margin-bottom: 20px; }
    .full-post-content .post-body { font-size: 1rem; }
    .full-post-content .post-body h1 { font-size: 1.8rem; }
    .full-post-content .post-body h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 15px; }
    header .site-title a { font-size: 1.6rem; }
    header nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    header nav .nav-link { 
        font-size: 0.9rem; 
        margin-right: 0;
        margin-left: 0;
    }
    .search-container {
        width: 100%;
        margin-left: 0;
        order: 0;
    }
    #search-input {
        width: 100%;
    }
    .theme-toggle-button {
        margin-left: 0;
        margin-top: 5px;
    }
    .post-list-item { padding: 20px; }
    .post-list-item h2 a { font-size: 1.3rem; }
    .full-post-content h1 { font-size: 1.8rem; }
    .static-page-content h1 { font-size: 1.6rem; }
    .section-title, .search-results-heading { font-size: 1.4rem; }
    .full-post-content .post-body h1 { font-size: 1.6rem; }
    .full-post-content .post-body h2 { font-size: 1.4rem; }
}

.fade-in {
    animation: fadeInAnimation 0.5s ease-in-out;
}

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

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        animation: none;
    }
    .post-list-item:hover {
        transform: none;
    }
    body, header, header .site-title a, header nav .nav-link, .theme-toggle-button .theme-icon,
    .sidebar section, .sidebar h2, #discord-custom-info p, .recent-posts-sidebar ul li a,
    .post-list-item, .post-list-item h2 a, .post-meta, .post-snippet, .read-more-link,
    .full-post-content h1, .full-post-content .post-body, .full-post-content .post-body img,
    .full-post-content .post-body h1, .full-post-content .post-body h2, .full-post-content .post-body h3,
    .full-post-content .post-body h4, .full-post-content .post-body h5, .full-post-content .post-body h6,
    .full-post-content .post-body a, .full-post-content .post-body blockquote,
    .full-post-content .post-body pre, .full-post-content .post-body code,
    .back-to-blog-link, footer, .static-page-content, .skip-link, #search-input {
        transition-duration: 0.01ms !important;
    }
}
