/* ==========================================================================
   Projekt-Übersicht Element Design (matching uebersicht.html)
   ========================================================================== */

/* Outer Container */
.projekte-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--body_typography-font-family, inherit);
    color: #333333;
}

/* Optional Header */
.archive-header {
    margin-bottom: 28px;
}
.archive-main-title {
    font-family: var(--h1_typography-font-family, inherit);
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 700;
    color: #333333;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
    display: flex;
    align-items: center;
}
.archive-main-title .title-number {
    color: #e8641e;
    margin-right: 8px;
}

/* ==========================================================================
   Controls Bar (Filter & Sorting)
   ========================================================================== */
.archive-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #ece8e2;
    border-radius: 12px;
    padding: 18px 22px;
    margin-top: 2rem;
    margin-bottom: 40px;
    box-sizing: border-box;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.filter-label,
.sort-label {
    color: #8a8378;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-right: 4px;
    user-select: none;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 50px;
    border: 1px solid #ddd6cd;
    background: #ffffff;
    color: #555555;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--body_typography-font-family, inherit);
    transition: all 0.15s ease;
    outline: none;
    line-height: 1.4;
    text-decoration: none;
    box-sizing: border-box;
}

.filter-btn:hover {
    border-color: #e8641e;
    color: #e8641e;
}

.filter-btn.active {
    border-color: #e8641e;
    background: #e8641e;
    color: #ffffff;
}

.filter-btn.active svg {
    stroke: currentColor;
}

.filter-btn svg {
    vertical-align: -0.15em;
    transition: stroke 0.15s ease;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.sort-select {
    padding: 9px 38px 9px 14px;
    border: 1px solid #ddd6cd;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: var(--body_typography-font-family, inherit);
    cursor: pointer;
    transition: border-color 0.15s ease;
    outline: none;
    line-height: 1.4;
}

.sort-select:hover,
.sort-select:focus {
    border-color: #e8641e;
}

.sort-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ==========================================================================
   Category Explanation Accordion (Details)
   ========================================================================== */
.kategorien-info {
    background: #ffffff;
    border: 1px solid #ece8e2;
    border-radius: 12px;
    margin-bottom: 32px;
    font-family: var(--body_typography-font-family, inherit);
    overflow: hidden;
    transition: all 0.2s ease;
}

.kategorien-info summary {
    cursor: pointer;
    list-style: none;
    padding: 18px 26px;
    color: #8a8378;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    outline: none;
}

.kategorien-info summary::-webkit-details-marker,
.kategorien-info summary::marker {
    display: none;
}

.kategorie-summary-chevron {
    color: #8a8378;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.kategorien-info[open] .kategorie-summary-chevron {
    transform: rotate(180deg);
}

.kategorien-content {
    padding: 2px 26px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}

.kategorie-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.kategorie-badge-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50px;
    font-size: 16px;
}

.kategorie-badge-icon.idee {
    background: #fbeec2;
    color: #9a7b1a;
}

.kategorie-badge-icon.projekt {
    background: #d6f0dd;
    color: #2e7d46;
}

.kategorie-badge-icon.erfolgsgeschichte,
.kategorie-badge-icon.erfolg {
    background: #ece2f6;
    color: #6b46a8;
}

.kategorie-titel {
    font-weight: 700;
    color: #333333;
    font-size: 15px;
    margin-bottom: 2px;
}

.kategorie-desc {
    color: #666666;
    font-size: 13.5px;
    line-height: 1.5;
}

/* ==========================================================================
   Projects Grid
   ========================================================================== */
.projekte-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    transition: opacity 0.2s ease;
}

.projekte-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: #8a8378;
    font-size: 16px;
    background: #ffffff;
    border: 1px solid #ece8e2;
    border-radius: 12px;
}

/* ==========================================================================
   Project Card (Design & Spacings)
   ========================================================================== */
.beitrag-card,
.projekt-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #ece8e2;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    color: inherit;
    box-sizing: border-box;
}

.beitrag-card:hover,
.projekt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: inherit;
}

.card-image-wrap {
    position: relative;
    height: 200px;
    background: #f4efe9;
    overflow: hidden;
}

.card-image-wrap img,
.card-image-wrap .card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.beitrag-card:hover .card-image-wrap img,
.projekt-card:hover .card-image-wrap img {
    transform: scale(1.03);
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eee8e0 0%, #ded7cd 100%);
}

.card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-family: var(--body_typography-font-family, inherit);
    line-height: 1;
    text-transform: uppercase;
    z-index: 2;
}

/* Badge Categories */
.cat-idee .card-badge,
.badge-idee {
    background: #fbeec2;
    color: #9a7b1a;
}

.cat-projekt .card-badge,
.badge-projekt {
    background: #d6f0dd;
    color: #2e7d46;
}

.cat-erfolgsgeschichte .card-badge,
.cat-erfolg .card-badge,
.badge-erfolgsgeschichte {
    background: #ece2f6;
    color: #6b46a8;
}

/* Card Content */
.card-content {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    box-sizing: border-box;
}

.card-title {
    margin: 0 0 16px;
    font-family: var(--h1_typography-font-family, inherit);
    font-weight: 700;
    font-size: 22px;
    color: #333333;
    line-height: 1.2;
}

.card-excerpt {
    margin: 0 0 16px;
    color: #666666;
    font-size: 15px;
    line-height: 1.55;
    font-family: var(--body_typography-font-family, inherit);
}

/* Stats Progress (Projekte) */
.card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    font-family: var(--body_typography-font-family, inherit);
    margin-bottom: 16px;
}

.stat-col {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: #8a8378;
    font-size: 12px;
    margin-bottom: 4px;
}

.stat-val {
    font-weight: 700;
    color: #333333;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-wrap {
    height: 6px;
    border-radius: 4px;
    background: #eeeeee;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #2e7d46;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stat-percent {
    text-align: right;
    color: #8a8378;
    font-size: 12px;
    margin-top: 4px;
}

/* Card Footer */
.card-footer {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #8a8378;
    font-size: 13px;
    font-family: var(--body_typography-font-family, inherit);
}

.footer-interactions {
    display: inline-flex;
    gap: 14px;
    align-items: center;
}

.footer-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.footer-meta-item svg {
    vertical-align: -0.15em;
}

.footer-date {
    color: #8a8378;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
    .archive-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }

    .filter-group {
        justify-content: flex-start;
    }

    .sort-group {
        justify-content: space-between;
        padding-top: 12px;
        border-top: 1px solid #f0ebe4;
    }

    .sort-select-wrap {
        flex: 1;
        max-width: 200px;
    }

    .sort-select {
        width: 100%;
    }

    .kategorien-content {
        grid-template-columns: 1fr;
        padding: 2px 18px 20px;
    }

    .projekte-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
