/* Category Archive Filter Styles - Multi-Select Version */
/* FIXED: Roten Hintergrund Problem durch spezifischere Selektoren */

/* Screen Reader Only - für Barrierefreiheit */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Container - minimal styling */
.caf-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Navigation - linksbündig wie Cards */
.caf-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0 0 0;
    padding: 0;
    justify-content: flex-start; /* ← GEÄNDERT: links statt center */
    align-items: center;
}

/* Filter Buttons - VERSTÄRKT gegen Theme-Konflikte */
/* NORMALE BUTTONS: Weißer Hintergrund, blaue Umrandung, blauer Text */
.caf-container .caf-navigation .caf-tab {
    background: #ffffff !important;        /* ← WEISS für normale Buttons */
    background-color: #ffffff !important; /* ← WEISS für normale Buttons */
    border: 2px solid #5095CB !important; /* ← BLAUE Umrandung */
    border-radius: 5px !important;
    color: #5095CB !important;            /* ← BLAUER Text */
    cursor: pointer !important;
    font-family: 'Titillium Web', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0.5rem 1rem !important;
    position: relative !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    user-select: none !important;
    overflow: hidden !important;
    box-shadow: none !important;
    outline: none !important;
    /* Explizit KEIN roter Hintergrund */
    background-image: none !important;
    filter: none !important;
}

/* Button hover state - VERSTÄRKT */
.caf-container .caf-navigation .caf-tab:hover {
    background: #f0f8ff !important;
    background-color: #f0f8ff !important;
    border-color: #2d5aa0 !important;
    color: #2d5aa0 !important;
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
}

/* Button focus state for accessibility - VERSTÄRKT */
.caf-container .caf-navigation .caf-tab:focus {
    outline: 3px solid #5095CB !important;
    outline-offset: 2px !important;
    z-index: 10 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    filter: none !important;
}

/* Active/Selected button state with X - VERSTÄRKT */
/* AKTIVE BUTTONS: Blauer Hintergrund - NIEMALS ROT! */
.caf-container .caf-navigation .caf-tab.caf-tab-active,
.caf-container .caf-navigation button.caf-tab.caf-tab-active,
.caf-navigation .caf-tab.caf-tab-active,
button.caf-tab.caf-tab-active {
    background: #5095CB !important;       /* ← BLAU, niemals rot */
    background-color: #5095CB !important; /* ← BLAU, niemals rot */
    border-color: #5095CB !important;     /* ← BLAUE Umrandung */
    color: #ffffff !important;            /* ← WEISSER Text */
    box-shadow: 0 4px 12px rgba(80, 149, 203, 0.3) !important;
    background-image: none !important;    /* ← Verhindert rote Background-Images */
    filter: none !important;              /* ← Verhindert rote Filter */
    -webkit-filter: none !important;      /* ← Verhindert rote Webkit-Filter */
}

.caf-container .caf-navigation .caf-tab.caf-tab-active:hover,
.caf-container .caf-navigation button.caf-tab.caf-tab-active:hover,
.caf-navigation .caf-tab.caf-tab-active:hover,
button.caf-tab.caf-tab-active:hover {
    background: #2d5aa0 !important;       /* ← DUNKELBLAU beim Hover, niemals rot */
    background-color: #2d5aa0 !important; /* ← DUNKELBLAU beim Hover, niemals rot */
    border-color: #2d5aa0 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(80, 149, 203, 0.4) !important;
    background-image: none !important;    /* ← Verhindert rote Background-Images */
    filter: none !important;              /* ← Verhindert rote Filter */
    -webkit-filter: none !important;      /* ← Verhindert rote Webkit-Filter */
}

/* X-Symbol für aktive Tabs */
.caf-container .caf-navigation .caf-tab .caf-tab-close {
    margin-right: 0.5rem !important;
    font-weight: bold !important;
    font-size: 1.2em !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease !important;
    color: inherit !important;
}

.caf-container .caf-navigation .caf-tab.caf-tab-active:hover .caf-tab-close {
    opacity: 1 !important;
}

/* Button pressed/clicked state - VERSTÄRKT */
.caf-container .caf-navigation .caf-tab:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(80, 149, 203, 0.2) !important;
    background-image: none !important;
    filter: none !important;
}

/* Tab Text */
.caf-container .caf-navigation .caf-tab .caf-tab-text {
    display: inline-block !important;
    color: inherit !important;
}

/* Multi-Select Indicator */
.caf-navigation::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 0; /* ← GEÄNDERT: links statt centered */
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

/* Enhanced Button States for Multi-Select - VERSTÄRKT */
.caf-container .caf-navigation .caf-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.caf-container .caf-navigation .caf-tab:hover::before {
    left: 100%;
}

.caf-container .caf-navigation .caf-tab.caf-tab-active::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* ZUSÄTZLICHE SCHUTZREGELN gegen Theme-Konflikte */
.caf-container .caf-navigation .caf-tab,
.caf-container .caf-navigation button.caf-tab,
button.caf-tab,
.caf-tab {
    /* Überschreibe mögliche Theme-Button-Styles */
    background-image: none !important;
    background-size: auto !important;
    background-position: initial !important;
    background-repeat: no-repeat !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
}

/* SPEZIFISCHE REGEL: Verhindere rote aktive Buttons */
.caf-container .caf-navigation .caf-tab.caf-tab-active,
.caf-container .caf-navigation button.caf-tab.caf-tab-active,
button.caf-tab.caf-tab-active,
.caf-tab.caf-tab-active {
    /* NIEMALS rot - immer blau für aktive Buttons */
    background: #5095CB !important;
    background-color: #5095CB !important;
    color: #ffffff !important;
    border-color: #5095CB !important;
    /* Überschreibe alle möglichen roten Styles */
    background-image: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* Wenn ein Theme versucht, normale Buttons rot zu machen */
.caf-container .caf-navigation .caf-tab:not(.caf-tab-active) {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #5095CB !important;
    border-color: #5095CB !important;
}

/* Responsive Design for Navigation */
@media (min-width: 480px) {
    .caf-navigation {
        gap: 1rem;
    }
    
    .caf-container .caf-navigation .caf-tab {
        font-size: 16px !important; /* ← Konsistent klein */
        padding: 0.5rem 1rem !important; /* ← Konsistent klein */
        border-radius: 5px !important; /* ← Konsistent */
    }
}

@media (min-width: 768px) {
    .caf-navigation {
        justify-content: flex-start; /* ← WICHTIG: auch auf größeren Screens links */
        margin: 2.5rem 0 0 0;
        position: relative;
    }
    
    .caf-navigation::before {
        top: -2.5rem;
        font-size: 1rem;
        left: 0; /* ← Links ausgerichtet */
    }
}

@media (min-width: 1024px) {
    .caf-navigation {
        gap: 1.25rem;
    }
    
    .caf-container .caf-navigation .caf-tab {
        font-size: 16px !important; /* ← Bleibt klein auch auf Desktop */
        padding: 0.5rem 1rem !important; /* ← Bleibt klein auch auf Desktop */
        border-radius: 5px !important; /* ← Konsistent */
    }
}

/* Mobile specific optimizations */
@media (max-width: 479px) {
    .caf-navigation {
        justify-content: flex-start; /* ← Auch mobile linksbündig */
        margin: 1.5rem 0 0 0;
    }
    
    .caf-navigation::before {
        display: none; /* Hide hint on very small screens */
    }
    
    .caf-container .caf-navigation .caf-tab {
        font-size: 14px !important; /* ← Noch kleiner auf sehr kleinen Screens */
        padding: 0.4rem 0.8rem !important;
        min-height: 36px !important;
        border-radius: 4px !important; /* ← Noch weniger Rundung auf Mobile */
    }
}

/* Loading indicator */
.caf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
    color: #64748b;
}

.caf-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #5095CB;
    border-radius: 50%;
    animation: caf-spin 1s linear infinite;
}

@keyframes caf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.caf-loading-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Content area - minimal styling to let theme handle it */
.caf-content {
    min-height: 200px;
}

/* ===== CARD LAYOUT STYLES ===== */

/* ===== CARD LAYOUT STYLES - MINIMALISTISCH ===== */

/* Posts Grid Container */
.caf-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0 2rem 0;
    padding: 0;
}

/* Desktop: 3 Spalten */
@media (min-width: 1024px) {
    .caf-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

/* Tablet: 2 Spalten */
@media (min-width: 768px) and (max-width: 1023px) {
    .caf-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Mobile: 1 Spalte */
@media (max-width: 767px) {
    .caf-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem 0 1.5rem 0;
    }
}

/* Individual Post Card */
.caf-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Image Container - einheitliche Höhe beibehalten */
.caf-card-image {
    position: relative;
    width: 100%;
    height: 200px; /* Feste Höhe für einheitliche Cards */
    overflow: hidden;
    border-radius: 4px;
    background-color: #f8f9fa; /* Hintergrund für Leerräume */
}

.caf-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.caf-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: contain; /* ← Zeigt ganzes Bild, kein Abschneiden */
    object-position: center center; /* Bild zentriert */
    transition: transform 0.3s ease;
}

/* Hover-Effekt */
.caf-card-image:hover .caf-thumbnail {
    transform: scale(1.02); /* Weniger Skalierung bei contain */
}

/* Responsive Höhen für verschiedene Screens */
@media (max-width: 767px) {
    .caf-card-image {
        height: 180px;
        background-color: #f8f9fa;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .caf-card-image {
        height: 200px;
        background-color: #f8f9fa;
    }
}

@media (min-width: 1024px) {
    .caf-card-image {
        height: 220px;
        background-color: #f8f9fa;
    }
}

/* Card Content */
.caf-card-content {
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 1rem;
}

/* Categories mit Trennstrichen - VERSTÄRKTE VERSION */
.caf-post-card .caf-card-categories {
    display: flex !important;
    gap: 3 !important;
    flex-wrap: wrap;
    align-items: center;
}

.caf-post-card .caf-category-tag {
    color: #002E64 !important;
    font-size: 16px;
    font-weight: normal;
    position: relative;
}

/* Trennstrich zwischen Kategorien - verstärkt mit !important */
.caf-post-card .caf-category-tag + .caf-category-tag::before {
    content: " | " !important;
    color: #002E64 !important;
    margin: 0 0.5rem !important;
    font-weight: normal !important;
    display: inline !important;
}

/* Title */
.caf-card-title {
    margin: 0;
    font-size: 28px;
    font-weight: normal;
    line-height: 1.1;
    color: #002E64 !important;
} 

.caf-card-title a {
    color: inherit;
    text-decoration: none;
}
.caf-post-card .caf-card-title a,
.elementor-kit-8 .caf-card-title a {
    color: #002E64 !important;
    text-decoration: none !important;
}
/* Excerpt */
.caf-card-excerpt {
    color: #000000;
    font-size: 22px;
    line-height: 1.2;
    flex-grow: 1;
}

/* Card Meta */
.caf-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
}

/* Wrapper für Datum */
.caf-card-date-wrapper {
    order: 1;
}

.caf-card-date {
    color: #000000;
    font-size: 16px;
    font-weight: normal;
}

/* Load More Button - VERSTÄRKT mit !important */
.caf-load-more-container {
    display: flex !important;
    justify-content: center !important;
    margin: 3rem 0 2rem 0 !important;
}

.caf-load-more-btn {
    background: #5095CB !important;
    background-color: #5095CB !important;
    border: none !important;
    border-radius: 5px !important;
    color: #ffffff !important;
    cursor: pointer !important;
    font-family: 'Titillium Web', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    padding: 1rem 2.5rem !important;
    position: relative !important;
    transition: background-color 0.3s ease !important;
    min-width: 180px !important;
    box-shadow: none !important; /* Explizit keine Schatten */
    transform: none !important;  /* Explizit keine Transformationen */
    background-image: none !important;
    filter: none !important;
}

.caf-load-more-btn:hover {
    background: #2d5aa0 !important;
    background-color: #2d5aa0 !important;
    box-shadow: none !important; /* Explizit keine Schatten beim Hover */
    transform: none !important;  /* Explizit keine Transformationen beim Hover */
    background-image: none !important;
    filter: none !important;
}

.caf-load-more-btn:focus {
    outline: 2px solid #5095CB !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
    background-image: none !important;
    filter: none !important;
}

.caf-load-more-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background: #5095CB !important;
    background-color: #5095CB !important;
    box-shadow: none !important;
    background-image: none !important;
    filter: none !important;
}

/* Loading State für Load More Button */
.caf-load-more-btn.caf-loading {
    pointer-events: none;
}

.caf-load-more-btn.caf-loading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: caf-button-spin 1s linear infinite;
}

.caf-load-more-btn.caf-loading span {
    opacity: 0;
}

@keyframes caf-button-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* All Loaded State */
.caf-load-more-btn.caf-all-loaded {
    background: #10b981 !important;
    background-color: #10b981 !important;
    cursor: default;
    background-image: none !important;
    filter: none !important;
}

.caf-load-more-btn.caf-all-loaded:hover {
    background: #10b981 !important; /* Bleibt grün */
    background-color: #10b981 !important;
    background-image: none !important;
    filter: none !important;
}

/* Wrapper für Read More */
.caf-read-more-wrapper {
    order: 2;
}

.caf-read-more {
    color: #5095CB;
    font-size: 16px;
    font-weight: normal;
    text-decoration: none;
    display: inline-block;
}

/* Cards ohne Bild */
.caf-post-card:not(:has(.caf-card-image)) .caf-card-content {
    padding-top: 2rem;
}

/* Error and no posts messages */
.caf-no-posts {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 3rem 2rem;
    margin: 0;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px dashed #cbd5e1;
}

.caf-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    color: #dc2626;
    padding: 1rem;
    text-align: center;
    margin: 0;
}