/* Blog Styles - im Stil der Landing Page */

/* Blog Header - Weißer Hintergrund */
body .header {
    background: var(--bg-white) !important;
    border-bottom: 1px solid rgba(123, 77, 222, 0.08);
    box-shadow: 0 2px 10px rgba(123, 77, 222, 0.1);
}

body .header.scrolled {
    background: var(--bg-white) !important;
}

/* Blog Hero Section */
.blog-hero {
    padding: 8rem 0 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    margin-top: 0;
}

.blog-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.blog-hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Posts Section */
.blog-posts-section {
    padding: 4rem 0;
    background: var(--bg-light);
}

/* Layout für Seite 1: 1 großer Lila-Beitrag links, 2 rechts untereinander */
.blog-page-one-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: stretch;
    margin-top: 2rem;
    margin-bottom: 3rem;
    min-height: 600px; /* Mindesthöhe für optimalen Platz */
}

.blog-right-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    /* expose the vertical gap as a CSS variable so children can compensate for it */
    --right-col-gap: 1.25rem;
}

.blog-right-column .blog-card {
    /* Let each card take exactly half of the available height minus half the gap,
       so both together + the gap equal the left feature height */
    flex: 0 0 auto;
    height: calc((100% - var(--right-col-gap)) / 2);
    max-height: none;
    min-height: 0;
}

/* Layout für Seite 2+: 2 Beiträge nebeneinander */
.blog-page-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

/* Altes Layout (für Magazin auf Landing-Page) */
.blog-magazine-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: stretch;
    margin-top: 2rem;
}

.blog-feature-card {
    position: relative;
    border-radius: 26px;
    overflow: hidden;
    background: rgba(103, 72, 191, 0.95);
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow:
        0 32px 60px rgba(15, 23, 42, 0.32),
        0 16px 30px rgba(15, 23, 42, 0.18),
        0 4px 12px rgba(17, 24, 39, 0.32);
}

.blog-feature-card a {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-feature-media {
    position: relative;
    width: 100%;
    min-height: 240px;
    background-size: cover;
    background-position: center;
}

.blog-feature-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0), rgba(17, 24, 39, 0.75));
}

.blog-feature-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: clamp(1.8rem, 3vw, 2.5rem);
    flex-grow: 1;
}

.blog-feature-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

.blog-feature-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-feature-meta i {
    font-size: 0.9rem;
}

.blog-feature-body h2 {
    margin: 0;
    font-size: clamp(1.9rem, 2.6vw, 2.4rem);
    line-height: 1.2;
}

.blog-feature-body p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.65;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 12;
    line-clamp: 12;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-feature-tags span {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.blog-feature-more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    margin-top: auto;
}

.blog-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.blog-card {
    background: var(--bg-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    display: flex;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(44, 62, 80, 0.16);
}

.blog-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.blog-card-image {
    position: relative;
    padding-top: 40%;
    background-size: cover;
    background-position: center;
}

.blog-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0), rgba(17, 24, 39, 0.12));
}

.blog-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.15rem 1.3rem 1.35rem;
    flex-grow: 1;
}

.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.blog-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.blog-card-meta i {
    font-size: 0.85rem;
}

.blog-card-body h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.blog-card-body p {
    margin: 0;
    color: var(--text-light);
    line-height: 1.6;
    flex-grow: 1;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.blog-card-tags span {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(123, 75, 222, 0.12);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.blog-card-more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    margin-top: auto;
}

/* Blog Empty State */
.blog-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.blog-empty i {
    font-size: 4rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.blog-empty h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.blog-pagination-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-pagination-list li {
    display: flex;
    align-items: center;
}

.blog-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(123, 77, 222, 0.2);
}

.blog-pagination-link:hover:not(.blog-pagination-link--disabled):not(.blog-pagination-link--active) {
    background: rgba(123, 77, 222, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.blog-pagination-link--active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    cursor: default;
}

.blog-pagination-link--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.blog-pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Blog Post Detail */
.blog-post-detail {
    padding: 2.5rem 0 3.5rem;
    background: var(--bg-white);
}

.blog-post-header {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: gap 0.3s ease;
}

.blog-back-link:hover {
    gap: 0.75rem;
}

.blog-post-detail .blog-post-meta {
    margin-bottom: 1.5rem;
}

.blog-post-detail .blog-post-title {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.blog-post-tags .blog-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(123, 75, 222, 0.12);
    color: #7B4BDE;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.blog-post-tags .blog-tag:hover {
    background: rgba(123, 75, 222, 0.2);
    transform: translateY(-1px);
}

.blog-post-featured-image {
    max-width: 800px;
    margin: 0 auto 2rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(123, 77, 222, 0.12);
}

.blog-post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-post-detail .blog-post-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-dark);
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    word-spacing: 0.05em;
}

.blog-post-detail .blog-post-content h1,
.blog-post-detail .blog-post-content h2,
.blog-post-detail .blog-post-content h3 {
    margin-bottom: 0.375rem;
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
}

.blog-post-detail .blog-post-content h1 {
    font-size: 2rem;
    margin-top: 1rem;
}

.blog-post-detail .blog-post-content h1:first-child {
    margin-top: 0;
}

.blog-post-detail .blog-post-content h2 {
    font-size: 1.75rem;
    margin-top: 0.875rem;
}

.blog-post-detail .blog-post-content h3 {
    font-size: 1.5rem;
    margin-top: 0.75rem;
}

.blog-post-detail .blog-post-content p {
    margin-bottom: 1.25rem;
    margin-top: 0;
    text-align: justify;
    text-justify: inter-word;
}

/* Reduziere Abstand zwischen Überschrift und direkt folgendem Absatz auf fast Null */
.blog-post-detail .blog-post-content h1 + p,
.blog-post-detail .blog-post-content h2 + p,
.blog-post-detail .blog-post-content h3 + p,
.blog-post-detail .blog-post-content h1 + ul,
.blog-post-detail .blog-post-content h2 + ul,
.blog-post-detail .blog-post-content h3 + ul,
.blog-post-detail .blog-post-content h1 + ol,
.blog-post-detail .blog-post-content h2 + ol,
.blog-post-detail .blog-post-content h3 + ol,
.blog-post-detail .blog-post-content h1 + blockquote,
.blog-post-detail .blog-post-content h2 + blockquote,
.blog-post-detail .blog-post-content h3 + blockquote {
    margin-top: 0;
}

/* Abstand zwischen Überschriften, die direkt aufeinander folgen */
.blog-post-detail .blog-post-content h1 + h2,
.blog-post-detail .blog-post-content h1 + h3,
.blog-post-detail .blog-post-content h2 + h3 {
    margin-top: 0.75rem;
}

.blog-post-detail .blog-post-content h2 + h1,
.blog-post-detail .blog-post-content h3 + h1,
.blog-post-detail .blog-post-content h3 + h2 {
    margin-top: 1rem;
}

/* Reduziere Abstand zwischen Listen und direkt folgendem Absatz */
.blog-post-detail .blog-post-content ul + p,
.blog-post-detail .blog-post-content ol + p {
    margin-top: 0.75rem;
}

.blog-post-detail .blog-post-content ul,
.blog-post-detail .blog-post-content ol {
    margin-bottom: 1rem;
    margin-top: 0;
    margin-left: 0;
    padding-left: 2rem;
    list-style-position: outside;
    text-align: left;
    line-height: 1.5; /* Reduzierter Zeilenabstand für Listen */
}

.blog-post-detail .blog-post-content li {
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
    padding-left: 0;
    margin-left: 0;
    line-height: 1.5; /* 1.5-facher Zeilenabstand */
    text-align: left;
}

/* Stelle sicher, dass Text nach Listen wieder normal ausgerichtet ist */
/* Direkt nachfolgende Elemente */
.blog-post-detail .blog-post-content ul + *,
.blog-post-detail .blog-post-content ol + * {
    margin-left: 0 !important;
    padding-left: 0 !important;
    text-indent: 0 !important;
}

/* Alle nachfolgenden Geschwister-Elemente */
.blog-post-detail .blog-post-content ul ~ p,
.blog-post-detail .blog-post-content ol ~ p,
.blog-post-detail .blog-post-content ul ~ h1,
.blog-post-detail .blog-post-content ul ~ h2,
.blog-post-detail .blog-post-content ul ~ h3,
.blog-post-detail .blog-post-content ul ~ h4,
.blog-post-detail .blog-post-content ul ~ h5,
.blog-post-detail .blog-post-content ul ~ h6,
.blog-post-detail .blog-post-content ol ~ h1,
.blog-post-detail .blog-post-content ol ~ h2,
.blog-post-detail .blog-post-content ol ~ h3,
.blog-post-detail .blog-post-content ol ~ h4,
.blog-post-detail .blog-post-content ol ~ h5,
.blog-post-detail .blog-post-content ol ~ h6,
.blog-post-detail .blog-post-content ul ~ div,
.blog-post-detail .blog-post-content ol ~ div,
.blog-post-detail .blog-post-content ul ~ blockquote,
.blog-post-detail .blog-post-content ol ~ blockquote {
    margin-left: 0 !important;
    padding-left: 0 !important;
    text-indent: 0 !important;
}

/* Wichtig: Stelle sicher, dass Listen-Elemente selbst keine Einrückung auf nachfolgende Elemente übertragen */
.blog-post-detail .blog-post-content ul,
.blog-post-detail .blog-post-content ol {
    box-sizing: border-box;
}

/* Stelle sicher, dass alle p-Elemente standardmäßig keine Einrückung haben */
.blog-post-detail .blog-post-content p {
    margin-left: 0;
    padding-left: 0;
    text-indent: 0;
    orphans: 3;
    widows: 3;
}

.blog-post-detail .blog-post-content a {
    color: var(--primary);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.blog-post-detail .blog-post-content a:hover {
    color: var(--primary-dark);
}

.blog-post-detail .blog-post-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary);
    text-align: left;
}

.blog-post-detail .blog-post-content pre {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    margin-top: 0;
    border: 1px solid var(--border);
    text-align: left;
}

.blog-post-detail .blog-post-content pre code {
    background: none;
    padding: 0;
    color: var(--text-dark);
}

/* Nav Active State */
.nav-menu a.active {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Blockquote für Blog-Posts */
.blog-post-detail .blog-post-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--primary);
    background: var(--bg-light);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    text-align: left;
}

/* Bilder innerhalb des Contents */
.blog-post-detail .blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    display: block;
}

/* Tabellen */
.blog-post-detail .blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    text-align: left;
}

.blog-post-detail .blog-post-content table th,
.blog-post-detail .blog-post-content table td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.blog-post-detail .blog-post-content table th {
    background: var(--bg-light);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-page-one-layout {
        grid-template-columns: 1fr;
    }
    
    .blog-page-grid-layout {
        grid-template-columns: 1fr;
    }

    .blog-magazine-layout {
        grid-template-columns: 1fr;
    }

    .blog-card-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-hero-subtitle {
        font-size: 1.1rem;
    }
    
    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-post-detail .blog-post-title {
        font-size: 1.75rem;
    }
    
    .blog-post-detail .blog-post-content {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .blog-hero {
        padding: 3rem 0 2rem;
    }
    
    .blog-posts-section {
        padding: 3rem 0;
    }
    
    .blog-post-content {
        padding: 1.25rem;
    }
    
    .blog-post-meta {
        font-size: 0.85rem;
    }
}


