/* ========================================
   HMF-IT - Blog CSS - Modern Redesign
   WCAG 2.1 AA konform | Mobile First
   ======================================== */

/* ========================================
   BLOG OVERVIEW PAGE
   ======================================== */

/* Blog Filter Section */
.blog-filter-section {
    padding: 0 0 3rem;
}

.blog-filter-container {
    padding: 1.25rem 2rem;
    background: var(--glass-bg-dark);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border-dark);
    border-radius: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

[data-bs-theme="light"] .blog-filter-container {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.category-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 100px;
    background: transparent;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    color: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    opacity: 0.7;
}

.category-tab:hover,
.category-tab:focus {
    opacity: 1;
    color: var(--hmf-green-light);
}

.category-tab.active {
    background: var(--gradient-primary);
    color: #fff;
    opacity: 1;
    box-shadow: 0 4px 20px rgba(106, 122, 38, 0.4);
}

.category-tab:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
}

/* Blog Section */
.blog-section {
    padding: 0 0 var(--section-padding);
}

/* ========================================
   BLOG GRID - Modern Bento Layout
   ======================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.75rem;
}

/* Blog Article Base */
.blog-article {
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

[data-bs-theme="light"] .blog-article {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.blog-article:hover,
.blog-article:focus-within {
    border-color: var(--hmf-green);
    box-shadow: 0 20px 60px rgba(106, 122, 38, 0.15);
}

@media (prefers-reduced-motion: no-preference) {
    .blog-article:hover,
    .blog-article:focus-within {
        transform: translateY(-8px);
    }
}

/* Grid Layouts */
.blog-article {
    grid-column: span 4;
}

/* Featured Article - Full Width */
.blog-article-featured {
    grid-column: span 12;
    flex-direction: row;
    min-height: 400px;
}

.blog-article-featured .article-image {
    width: 55%;
    height: 100%;
    min-height: 400px;
}

.blog-article-featured .article-content {
    width: 45%;
    padding: 3rem;
    justify-content: center;
}

.blog-article-featured .article-title {
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

.blog-article-featured .article-excerpt {
    font-size: 1.1rem;
    line-height: 1.8;
    -webkit-line-clamp: 4;
}

/* Article Image */
.article-image {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--hmf-green) 0%, var(--hmf-gray) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Photo-based article image */
.article-image-photo {
    background: var(--gradient-secondary);
}

.article-image-photo.img-fallback {
    background: var(--gradient-secondary);
}

.article-image-photo.img-fallback::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.85;
}

.article-image-photo.img-fallback img {
    display: none;
}

.article-image svg {
    color: #fff;
    opacity: 0.85;
}

@media (prefers-reduced-motion: no-preference) {
    .blog-article:hover .article-image img {
        transform: scale(1.08);
    }
}

/* Article Badge */
.article-badge {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    padding: 0.5rem 1rem;
    background: var(--hmf-red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 100px;
    box-shadow: 0 4px 12px rgba(163, 38, 56, 0.4);
}

/* Article Content */
.article-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Article Meta */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.article-category {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background: rgba(106, 122, 38, 0.12);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--hmf-green-light);
}

[data-bs-theme="light"] .article-category {
    background: rgba(106, 122, 38, 0.08);
    color: var(--hmf-green);
}

.article-date {
    font-size: 0.85rem;
    opacity: 0.5;
    font-weight: 500;
}

/* Article Title */
.article-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.875rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.article-title a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

.article-title a:hover,
.article-title a:focus {
    color: var(--hmf-green-light);
}

/* Article Excerpt */
.article-excerpt {
    font-size: 0.95rem;
    opacity: 0.75;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Article Footer */
.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border-dark);
    margin-top: auto;
}

[data-bs-theme="light"] .article-footer {
    border-color: rgba(0, 0, 0, 0.06);
}

.read-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.5;
    font-weight: 500;
}

.read-time svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--hmf-green-light);
    text-decoration: none;
    transition: all var(--transition-fast);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    background: rgba(106, 122, 38, 0.08);
}

.read-more:hover,
.read-more:focus {
    gap: 0.875rem;
    color: #fff;
    background: var(--gradient-primary);
    box-shadow: 0 4px 16px rgba(106, 122, 38, 0.3);
}

.read-more svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.read-more:hover svg {
    transform: translateX(2px);
}

/* Hidden Articles */
.blog-article.hidden {
    display: none;
}

/* No Results */
.no-results {
    grid-column: span 12;
    text-align: center;
    padding: 5rem 2rem;
    opacity: 0.6;
}

.no-results svg {
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.no-results p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 4rem;
}

.load-more-container .btn-outline-custom {
    padding: 1.25rem 2.5rem;
    font-size: 1rem;
    border-radius: 100px;
}

/* ========================================
   NEWSLETTER SECTION
   ======================================== */
.newsletter-section {
    padding: var(--section-padding) 0;
    background: var(--glass-bg-dark);
    border-top: 1px solid var(--glass-border-dark);
}

[data-bs-theme="light"] .newsletter-section {
    background: var(--bg-light-secondary);
    border-color: var(--glass-border-light);
}

.newsletter-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 3.5rem;
    background: linear-gradient(135deg, rgba(106, 122, 38, 0.08) 0%, rgba(163, 38, 56, 0.05) 100%);
    border: 1px solid var(--glass-border-dark);
    border-radius: 32px;
    position: relative;
    overflow: hidden;
}

.newsletter-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(106, 122, 38, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

[data-bs-theme="light"] .newsletter-container {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

.newsletter-content {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.newsletter-icon {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 24px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(106, 122, 38, 0.3);
}

.newsletter-icon svg {
    width: 40px;
    height: 40px;
    color: #fff;
}

.newsletter-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.newsletter-description {
    opacity: 0.7;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

/* Newsletter Form */
.newsletter-form {
    position: relative;
    z-index: 1;
}

.newsletter-input-group {
    display: flex;
    gap: 1rem;
    background: var(--glass-bg-dark);
    border: 2px solid var(--glass-border-dark);
    border-radius: 100px;
    padding: 0.5rem;
    transition: border-color var(--transition-fast);
}

.newsletter-input-group:focus-within {
    border-color: var(--hmf-green);
}

[data-bs-theme="light"] .newsletter-input-group {
    background: var(--bg-light-secondary);
    border-color: rgba(0, 0, 0, 0.1);
}

.newsletter-input {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    font-family: var(--font-display);
    font-size: 1rem;
    color: inherit;
}

.newsletter-input:focus {
    outline: none;
}

.newsletter-input::placeholder {
    opacity: 0.4;
}

.newsletter-form .btn-primary-custom {
    padding: 1rem 2rem;
    border-radius: 100px;
    font-weight: 700;
    white-space: nowrap;
}

.newsletter-hint {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 1rem;
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.newsletter-hint a {
    color: var(--hmf-green-light);
    text-decoration: underline;
}

/* Footer Tags */
.footer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.footer-tag {
    padding: 0.5rem 1rem;
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

[data-bs-theme="light"] .footer-tag {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.footer-tag:hover,
.footer-tag:focus {
    border-color: var(--hmf-green);
    color: var(--hmf-green-light);
    background: rgba(106, 122, 38, 0.1);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1199.98px) {
    .blog-grid {
        gap: 1.5rem;
    }

    .blog-article {
        grid-column: span 6;
    }

    .blog-article-featured {
        grid-column: span 12;
    }

    .blog-article-featured .article-image {
        width: 50%;
    }

    .blog-article-featured .article-content {
        width: 50%;
        padding: 2.5rem;
    }

    .blog-article-featured .article-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 991.98px) {
    .blog-filter-container {
        border-radius: 20px;
        padding: 1rem;
    }

    .category-tab {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }

    .blog-article-featured {
        flex-direction: column;
        min-height: auto;
    }

    .blog-article-featured .article-image {
        width: 100%;
        min-height: 280px;
        height: 280px;
    }

    .blog-article-featured .article-content {
        width: 100%;
        padding: 2rem;
    }

    .blog-article-featured .article-title {
        font-size: 1.5rem;
    }

    .newsletter-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2.5rem;
    }
}

@media (max-width: 767.98px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .blog-article,
    .blog-article-featured {
        grid-column: span 1;
    }

    .article-image {
        height: 200px;
    }

    .article-content {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.2rem;
    }

    .newsletter-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .newsletter-title {
        font-size: 1.5rem;
    }

    .newsletter-input-group {
        flex-direction: column;
        border-radius: 20px;
        padding: 0.75rem;
    }

    .newsletter-input {
        text-align: center;
    }

    .newsletter-form .btn-primary-custom {
        width: 100%;
        justify-content: center;
    }

    .newsletter-hint {
        text-align: center;
        padding-left: 0;
    }
}

@media (max-width: 480px) {
    .category-tabs {
        gap: 0.375rem;
    }

    .category-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .article-content {
        padding: 1.25rem;
    }

    .article-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.875rem;
    }

    .newsletter-container {
        padding: 1.75rem;
        border-radius: 24px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .blog-article:hover .article-image img {
        transform: none;
    }

    .blog-article:hover,
    .blog-article:focus-within {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .blog-article,
    .category-tab,
    .newsletter-container,
    .newsletter-input-group {
        border-width: 2px;
    }

    .article-category {
        border: 1px solid var(--hmf-green);
    }
}

/* Print Styles */
@media print {
    .blog-filter-section,
    .newsletter-section,
    .load-more-container {
        display: none !important;
    }

    .blog-grid {
        display: block;
    }

    .blog-article {
        break-inside: avoid;
        margin-bottom: 1.5rem;
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .article-image {
        height: 150px;
    }
}

/* ========================================
   BLOG ARTICLE PAGE - Single Post
   ======================================== */

/* Page Header für Blog-Artikel (gleiche Struktur wie leistungen.html) */
.blog-article-header .breadcrumb {
    justify-content: center;
    margin-bottom: 1.5rem;
}

.blog-article-header .article-meta {
    justify-content: center;
    margin-top: 2rem;
}

/* Blog Content Section (analog zu leistung-section) */
.blog-content-section {
    padding: 2rem 0 var(--section-padding);
}

/* Legacy Support */
.blog-article-page {
    padding-top: 120px;
    padding-bottom: var(--section-padding);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    margin-right: 0.5rem;
    opacity: 0.4;
}

.breadcrumb-item a {
    color: var(--hmf-green-light);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.breadcrumb-item a:hover {
    opacity: 0.7;
}

.breadcrumb-item.active {
    opacity: 0.6;
}

/* Article Header - Single Page */
.blog-article-page .article-header {
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: center;
}

.blog-article-page .article-meta {
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
}

.blog-article-page .article-meta .read-time {
    opacity: 0.6;
}

.blog-article-page .article-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.article-lead {
    font-size: 1.25rem;
    line-height: 1.8;
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto;
}

/* Article Featured Image */
.article-featured-image {
    margin: 3rem 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Article Content - Single Page */
.blog-article-page .article-content {
    max-width: 85%;
    margin: 0 auto;
    padding: 0;
}

.blog-article-page .article-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 3rem 0 1.25rem;
    letter-spacing: -0.02em;
    color: var(--hmf-green-light);
}

.blog-article-page .article-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
}

.blog-article-page .article-content h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 2rem 0 0.875rem;
}

.blog-article-page .article-content p {
    font-size: 1.1rem;
    line-height: 1.85;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.blog-article-page .article-content ul,
.blog-article-page .article-content ol {
    margin: 1.5rem 0 2rem;
    padding-left: 1.5rem;
}

.blog-article-page .article-content li {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

.blog-article-page .article-content li::marker {
    color: var(--hmf-green-light);
}

/* Code Blocks */
.blog-article-page .article-content pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border-dark);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
}

[data-bs-theme="light"] .blog-article-page .article-content pre {
    background: var(--bg-light-secondary);
    border-color: var(--glass-border-light);
}

.blog-article-page .article-content code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

.blog-article-page .article-content p code {
    background: rgba(106, 122, 38, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9em;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, rgba(106, 122, 38, 0.1) 0%, rgba(106, 122, 38, 0.05) 100%);
    border: 1px solid rgba(106, 122, 38, 0.3);
    border-left: 4px solid var(--hmf-green);
    border-radius: 16px;
    padding: 1.75rem;
    margin: 2rem 0;
}

.info-box h4 {
    color: var(--hmf-green-light);
    margin: 0 0 0.75rem !important;
    font-size: 1.1rem !important;
}

.info-box p {
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box pre {
    margin: 1rem 0 0 !important;
    padding: 1rem !important;
    background: rgba(0, 0, 0, 0.2) !important;
}

/* CTA Box */
.cta-box {
    background: var(--gradient-primary);
    border-radius: 24px;
    padding: 2.5rem;
    margin: 3rem 0;
    text-align: center;
    box-shadow: 0 16px 48px rgba(106, 122, 38, 0.3);
}

.cta-box h3 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0 0 0.75rem !important;
}

.cta-box p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.cta-box .btn-cta {
    background: #fff;
    color: var(--hmf-green-dark);
    padding: 1rem 2rem;
    font-weight: 700;
    border-radius: 100px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.cta-box .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Article Navigation */
.article-navigation {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border-dark);
}

[data-bs-theme="light"] .article-navigation {
    border-color: var(--glass-border-light);
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--hmf-green-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 100px;
    background: rgba(106, 122, 38, 0.1);
    transition: all var(--transition-fast);
}

.nav-back:hover {
    background: var(--gradient-primary);
    color: #fff;
    gap: 1rem;
}

.nav-back svg {
    transition: transform var(--transition-fast);
}

.nav-back:hover svg {
    transform: translateX(-4px);
}

/* Responsive - Single Page */
@media (max-width: 767.98px) {
    .blog-article-page {
        padding-top: 100px;
    }

    .blog-article-page .article-header {
        text-align: left;
    }

    .blog-article-page .article-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .blog-article-page .article-title {
        font-size: 1.75rem;
    }

    .article-lead {
        font-size: 1.1rem;
    }

    .blog-article-page .article-content h2 {
        font-size: 1.5rem;
    }

    .blog-article-page .article-content h3 {
        font-size: 1.2rem;
    }

    .blog-article-page .article-content p {
        font-size: 1rem;
    }

    .info-box,
    .cta-box {
        padding: 1.5rem;
        border-radius: 16px;
    }
}
