/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
    background-color: #f8f9fa;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: #ffffff;
    padding: 14px 0;
    border-bottom: 1px solid #e1e8ed;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* Logo | Title */
.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.site-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background-color: #ecf0f1;
    color: #2c3e50;
    display: grid;
    place-items: center;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
}

.site-logo:hover {
    background-color: #e6eef6;
    color: #2c3e50;
}

.site-title-wrap {
    min-width: 0;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52vw;
}

.site-title:hover {
    color: #3498db;
}

/* Header Actions (Theme + Mobile) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Theme Switch */
.theme-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-switch__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.theme-switch__label {
    position: relative;
    width: 46px;
    height: 26px;
    cursor: pointer;
    display: inline-block;
    border-radius: 999px;
}

.theme-switch__track {
    position: absolute;
    inset: 0;
    background: #ecf0f1;
    border: 1px solid #dfe6ea;
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 1px solid #dfe6ea;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.theme-switch__input:checked + .theme-switch__label .theme-switch__track {
    background: #2c3e50;
    border-color: #2c3e50;
}

.theme-switch__input:checked + .theme-switch__label .theme-switch__thumb {
    transform: translateX(20px);
    border-color: rgba(255,255,255,0.25);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #2c3e50;
    margin: 3px 0;
    transition: 0.3s;
}

.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);
}

/* Navigation */
.navigation {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    /* margin-left: auto;  <-- entfernt, damit nur .header-actions rechts ausrichtet */
}

.navigation a {
    color: #7f8c8d;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.navigation a:hover,
.navigation a.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* Main Content */
.main {
    min-height: 60vh;
    margin-bottom: 80px;
}

/* Content Wrapper - Grid Layout */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.content-wrapper.single-page {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

.posts-section {
    min-width: 0;
}

/* Post Styles */
.post,
.post-preview,
.static-page {
    background-color: #ffffff;
    padding: 40px;
    margin-bottom: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.post-title,
.page-title {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 15px;
    color: #2c3e50;
}

h3.post-title {
    font-size: 1.5rem;
}

.post-title a {
    color: #2c3e50;
}

.post-title a:hover {
    color: #3498db;
}

.post-meta {
    color: #95a5a6;
    font-size: 0.9rem;
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.post-category {
    background-color: #ecf0f1;
    padding: 4px 12px;
    border-radius: 4px;
    color: #7f8c8d;
}

.post-cover {
    width: 100%;
    border-radius: 6px;
    margin: 25px 0;
}

.post-content,
.post-excerpt,
.page-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #34495e;
}

.post-content h2,
.page-content h2 {
    font-size: 1.75rem;
    margin-top: 35px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.post-content h3,
.page-content h3 {
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 12px;
    color: #2c3e50;
}

.post-content h4,
.page-content h4 {
    font-size: 1.2rem;
    margin-top: 25px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.post-content p,
.page-content p {
    margin-bottom: 20px;
}

.post-content ul,
.post-content ol,
.page-content ul,
.page-content ol {
    margin-left: 25px;
    margin-bottom: 20px;
}

.post-content li,
.page-content li {
    margin-bottom: 8px;
}

.post-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 20px;
    margin: 25px 0;
    color: #7f8c8d;
    font-style: italic;
}

.post-content code {
    background-color: #ecf0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 25px 0;
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

/* Post Tags */
.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background-color: #ecf0f1;
    color: #7f8c8d;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tag:hover {
    background-color: #3498db;
    color: #ffffff;
}

/* Read More Link */
.read-more {
    display: inline-block;
    margin-top: 15px;
    color: #3498db;
    font-weight: 600;
}

.read-more:hover {
    color: #2980b9;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    padding: 30px 0;
    gap: 20px;
}

.pagination-prev,
.pagination-next {
    background-color: #ffffff;
    padding: 12px 25px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.pagination-next {
    margin-left: auto;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 180px;
    align-self: start;
}

.widget {
    background-color: #ffffff;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.widget-content {
    color: #34495e;
}

.widget-content p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Category List */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    color: #7f8c8d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.category-list a:hover {
    color: #3498db;
}

.category-list .count {
    font-size: 0.85rem;
    color: #95a5a6;
}

/* Recent Posts */
.recent-posts {
    list-style: none;
}

.recent-posts li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.recent-posts li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.recent-posts a {
    color: #2c3e50;
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
}

.recent-posts a:hover {
    color: #3498db;
}

.post-date-small {
    font-size: 0.85rem;
    color: #95a5a6;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud-item {
    background-color: #ecf0f1;
    color: #7f8c8d;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tag-cloud-item:hover {
    background-color: #3498db;
    color: #ffffff;
}

/* Footer */
.footer {
    background-color: #ffffff;
    border-top: 1px solid #e1e8ed;
    padding: 50px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.footer-section p {
    color: #7f8c8d;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #e1e8ed;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.footer-bottom p {
    margin-bottom: 5px;
}

.footer-bottom a {
    color: #7f8c8d;
}

.footer-bottom a:hover {
    color: #3498db;
}

/* Static Pages */
.last-updated {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
    color: #95a5a6;
}

/* Responsive Design */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {

  header nav { 
    display: none;
    flex-direction: column;
    width: 100%;
    flex-basis: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e1e8ed;
  }

  header nav.nav-open {
    display: flex;
  }

    .header {
        padding: 12px 0;
        margin-bottom: 24px;
    }

    .site-title {
        font-size: 1.15rem;
        max-width: 64vw;
    }

    /* Actions bleiben rechts: Switch + Hamburger */
    .header-actions {
        margin-left: auto;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .navigation {
        display: none;
        flex-direction: column;
        width: 100%;
        flex-basis: 100%; /* wichtig: erzwingt neue Zeile im flex-wrap */
        margin-left: 0;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e1e8ed;
    }

    .navigation.active {
        display: flex;
    }

    .navigation a {
        padding: 12px 0;
        border-bottom: 1px solid #ecf0f1;
    }

    .post,
    .post-preview,
    .static-page,
    .widget {
        padding: 25px;
    }

    .post-title,
    .page-title {
        font-size: 1.6rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.05rem;
        max-width: 70vw;
    }

    .post,
    .post-preview,
    .static-page {
        padding: 20px;
    }

    .pagination {
        flex-direction: column;
    }

    .pagination-next {
        margin-left: 0;
    }
}
