/* ==========================================================================
   Blog Page Styles — SIMO GmbH
   Dark Glassmorphism Theme
   ========================================================================== */

/* ── Hero Section ── */
.blog-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 5rem 2rem;
    background: url('/assets/images/optimized/blog-hero_fallback.jpg') center/cover no-repeat var(--bg-primary);
}

/* ── Video Background ── */
.blog-video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.blog-video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video Overlay — 20% transparent #000033, UEBER dem Video */
.blog-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 51, 0.40);
    z-index: 1;
}

.blog-hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 80%;
    max-width: none;
    margin: 0 auto;
    padding: 4rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.blog-hero .hero-title {
    font-size: 3.5rem;
    font-weight: 300;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.blog-hero .gradient-text {
    font-weight: 700;
    color: var(--teal, #5EBFBF);
    -webkit-text-fill-color: var(--teal, #5EBFBF);
    background: none;
}

.blog-hero .hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.blog-hero .hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.blog-hero .stat-item {
    text-align: center;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 130px;
}

.blog-hero .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 400;
    color: white;
    margin-bottom: 0.3rem;
}

.blog-hero .stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blog-hero .stat-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.3);
    align-self: stretch;
}

/* ── Filter Section ── */
.blog-filter-section {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
    background: rgba(0, 0, 51, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-search {
    position: relative;
    flex: 0 0 280px;
}

.filter-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.filter-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.filter-search input:focus {
    border-color: var(--teal, #5EBFBF);
    background: rgba(255, 255, 255, 0.08);
}

.filter-search input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.filter-categories {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.category-chip {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.category-chip.active {
    background: rgba(94, 191, 191, 0.2);
    border-color: rgba(94, 191, 191, 0.4);
    color: var(--teal, #5EBFBF);
}

.chip-count {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: 0.25rem;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.sort-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.result-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* Active Tags */
.active-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 0 0;
}

.active-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: rgba(94, 191, 191, 0.15);
    border: 1px solid rgba(94, 191, 191, 0.3);
    border-radius: 50px;
    color: var(--teal, #5EBFBF);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.active-tag:hover {
    background: rgba(94, 191, 191, 0.25);
}

.active-tag .tag-remove {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ── Card Grid ── */
.blog-grid-section {
    padding: 3rem 0 4rem;
    background: var(--bg-primary);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

/* Blog Card */
.blog-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(183, 148, 246, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
}

.blog-card-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(94, 191, 191, 0.15);
    border: 1px solid rgba(94, 191, 191, 0.25);
    border-radius: 50px;
    color: var(--teal, #5EBFBF);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.blog-card-tag {
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blog-card-tag:hover {
    background: rgba(94, 191, 191, 0.15);
    border-color: rgba(94, 191, 191, 0.3);
    color: var(--teal, #5EBFBF);
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.blog-card-footer i {
    margin-right: 0.3rem;
}

/* No Results */
.blog-no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.blog-no-results i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.15);
    margin-bottom: 1.5rem;
}

.blog-no-results h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.blog-no-results p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ── CTA Section ── */
.blog-cta-section {
    padding: 2rem 0 5rem;
    background: var(--bg-primary);
}

/* ── Reader Panel ── */
.reader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1300;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    cursor: pointer;
}

.reader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.reader-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 900px;
    height: 100%;
    background: rgba(10, 10, 40, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1301;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reader-panel.active {
    transform: translateX(0);
}

/* Progress Bar */
.reader-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--teal, #5EBFBF), #4bbecf);
    width: 0;
    z-index: 10;
    transition: width 0.1s linear;
}

/* Reader Header */
.reader-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.reader-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.reader-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.reader-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    flex-wrap: wrap;
}

.reader-meta-category {
    padding: 0.2rem 0.6rem;
    background: rgba(94, 191, 191, 0.15);
    border-radius: 50px;
    color: var(--teal, #5EBFBF);
    font-size: 0.8rem;
}

.reader-meta-separator {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* Reader Body */
.reader-body {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    scroll-behavior: smooth;
}

.reader-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 0;
    color: rgba(255, 255, 255, 0.5);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--teal, #5EBFBF);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Reader Content Typography */
.reader-content {
    max-width: 680px;
    margin: 0 auto;
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.05rem;
}

.reader-content h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    color: white;
}

.reader-content h2 {
    font-size: 1.6rem;
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--teal, #5EBFBF);
    line-height: 1.3;
}

.reader-content h3 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
}

.reader-content p {
    margin-bottom: 1.2rem;
}

.reader-content ul,
.reader-content ol {
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

.reader-content li {
    margin-bottom: 0.5rem;
}

.reader-content strong {
    color: white;
    font-weight: 600;
}

.reader-content a {
    color: var(--teal, #5EBFBF);
    text-decoration: underline;
    text-decoration-color: rgba(94, 191, 191, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

.reader-content a:hover {
    text-decoration-color: var(--teal, #5EBFBF);
}

.reader-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--teal, #5EBFBF);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 12px 12px 0;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.reader-content code {
    padding: 0.15rem 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'IBM Plex Mono', monospace;
    color: #e0b0ff;
}

.reader-content pre {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow-x: auto;
}

.reader-content pre code {
    padding: 0;
    background: none;
    border-radius: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.reader-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.reader-content th,
.reader-content td {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.reader-content th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: white;
}

.reader-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.reader-content hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 2rem 0;
}

/* Back to Top */
.reader-back-to-top {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(94, 191, 191, 0.2);
    border: 1px solid rgba(94, 191, 191, 0.3);
    border-radius: 12px;
    color: var(--teal, #5EBFBF);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.reader-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.reader-back-to-top:hover {
    background: rgba(94, 191, 191, 0.3);
    transform: translateY(-3px);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .reader-panel {
        width: 90%;
    }

    .filter-search {
        flex: 0 0 240px;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        min-height: auto;
        padding: 3rem 1rem;
    }

    .blog-hero .hero-content {
        width: 95%;
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
    }

    .blog-hero .hero-title {
        font-size: 2.2rem;
    }

    .blog-hero .hero-subtitle {
        font-size: 1.1rem;
    }

    .blog-hero .hero-stats {
        gap: 1rem;
    }

    .blog-hero .stat-divider {
        display: none;
    }

    .blog-hero .stat-item {
        min-width: 100px;
        padding: 0.8rem 1rem;
    }

    .blog-hero .stat-value {
        font-size: 1.5rem;
    }

    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .filter-search {
        flex: 1;
    }

    .filter-categories {
        -webkit-overflow-scrolling: touch;
    }

    .filter-controls {
        justify-content: space-between;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .reader-panel {
        width: 100%;
        max-width: none;
    }

    .reader-body {
        padding: 1.5rem;
    }

    .reader-content {
        font-size: 1rem;
    }

    .reader-content h1 {
        font-size: 1.8rem;
    }

    .reader-content h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .blog-hero .hero-title {
        font-size: 1.8rem;
    }

    .blog-card {
        padding: 1.5rem;
    }

    .blog-card-title {
        font-size: 1.1rem;
    }

    .reader-header {
        padding: 0.75rem 1rem;
    }

    .reader-body {
        padding: 1rem;
    }
}
