/**
 * Blog Filter & Tags CSS
 * Für: macedonschi.com/blog/
 * Minimalistisch, elegant, mobile-optimiert
 */

/* === FILTER BAR === */
.blog-filter-section {
    position: sticky;
    top: 80px; /* Unterhalb des Headers */
    background: rgba(248, 249, 250, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(13, 47, 74, 0.08);
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.blog-filter-inner {
    max-width: 1400px; 
    margin: 0 auto;
    padding: 0 3rem;
}

/* Optional: Auto-hide beim Scrollen */
.blog-filter-section.scrolled {
    transform: translateY(-100%);
}

.filter-wrapper {
    padding: 1.5rem 0;
}

.filter-container {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 0.25rem 0;
    -webkit-overflow-scrolling: touch;
}

.filter-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Edge */
}

.filter-tag {
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    border: 1px solid rgba(13, 47, 74, 0.15);
    border-radius: 2px;
    background: transparent;
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.filter-tag:hover {
    border-color: #d4a574;
    color: #0d2f4a;
    background: rgba(212, 165, 116, 0.08);
}

.filter-tag:active {
    transform: scale(0.97);
}

.filter-tag.active {
    background: #0d2f4a;
    color: #fff;
    border-color: #0d2f4a;
}

/* Farb-Varianten (optional) */
.filter-tag.active.accent-blue {
    background: #2563eb;
    border-color: #2563eb;
}

.filter-tag.active.accent-green {
    background: #059669;
    border-color: #059669;
}

/* Scroll-Hinweis für lange Listen */
.filter-container::after {
    content: '';
    flex-shrink: 0;
    width: 1px;
}

/* === INLINE TAGS (Erweiterung für bestehende blog-meta) === */
.blog-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-tag {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 2px;
    background: rgba(13, 47, 74, 0.06);
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    display: inline-block;
    line-height: 1.4;
}

.inline-tag:hover {
    background: #e8505b;
    color: #fff;
}

.inline-tag:active {
    transform: scale(0.95);
}

/* === EMPTY STATE === */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(13, 47, 74, 0.02);
    border-radius: 4px;
}

.blog-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #0d2f4a;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
}

.blog-empty p {
    color: #666;
    margin-bottom: 1.5rem;
}

.blog-empty .btn-secondary-custom {
    margin-top: 1rem;
}

.blog-empty p {
    font-size: 0.95rem;
}

/* === ANIMATION === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card {
    animation: fadeInUp 0.5s ease;
    animation-fill-mode: backwards;
}

/* Staggered Animation */
.blog-card:nth-child(1) { animation-delay: 0.05s; }
.blog-card:nth-child(2) { animation-delay: 0.1s; }
.blog-card:nth-child(3) { animation-delay: 0.15s; }
.blog-card:nth-child(4) { animation-delay: 0.2s; }
.blog-card:nth-child(5) { animation-delay: 0.25s; }
.blog-card:nth-child(6) { animation-delay: 0.3s; }

/* === RESPONSIVE === */

/* Mobile */
@media (max-width: 768px) {
    .blog-filter-section {
        top: 60px; /* Angepasst an Mobile Header */
    }

    .blog-filter-inner {
        padding: 0 1.5rem;
    }

    .filter-wrapper {
        padding: 1rem 0;
    }

    .filter-tag {
        font-size: 0.8rem;
        padding: 0.45rem 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .blog-filter-inner {
        padding: 0 1rem;
    }

    .filter-container {
        gap: 0.5rem;
    }

    .filter-tag {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .inline-tag {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
}

/* === ACCESSIBILITY === */
.filter-tag:focus-visible,
.inline-tag:focus-visible,
.load-more-btn:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .filter-tag,
    .inline-tag,
    .load-more-btn {
        animation: none;
        transition: none;
    }
    
    .blog-filter-section {
        transition: none;
    }
}

/* === PRINT === */
@media print {
    .blog-filter-section,
    .load-more {
        display: none;
    }

    .blog-card {
        break-inside: avoid;
    }
}
