/* ==========================================================================
   Monatsberichte Archive Module
   Colors match _variables.scss:
     $colorGreenLight: #ddebf7   $colorGreen: #1e4f77
     $colorGreenMedium: #6C928F  $colorGreenDark: #1e4f77
     $colorGreenDarkest: #0A383B $colorGreyE: #EFEFEF
     $colorGrey8: #888888        $colorBlack: #000000
     $colorWhite: #FFFFFF
   ========================================================================== */

/* --- Section --- */
section.monatsberichte-archive {
    padding: 60px 0;
}

/* --- Decade Bar --- */
.mb-decade-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.mb-decade-btn {
    padding: 10px 20px;
    background-color: #ddebf7;
    border: 2px solid transparent;
    font-family: inherit;
    font-size: 15px;
    line-height: 19px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mb-decade-btn:hover {
    background-color: #1e4f77;
}

.mb-decade-btn.active {
    background-color: #1e4f77;
    color: #ffffff;
    border-color: #1e4f77;
}

/* --- Year Grid --- */
.mb-year-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.mb-year-btn {
    width: calc(10% - 8px);
    min-width: 70px;
    padding: 15px 10px;
    background-color: #EFEFEF;
    border: 2px solid transparent;
    font-family: inherit;
    font-size: 18px;
    line-height: 24px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mb-year-btn:hover {
    background-color: #1e4f77;
}

.mb-year-btn.active {
    background-color: #1e4f77;
    color: #ffffff;
    border-color: #1e4f77;
}

/* --- Issue Grid --- */
.mb-issue-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    min-height: 100px;
    transition: opacity 0.2s ease;
}

.mb-issue-grid.mb-loading {
    pointer-events: none;
}

/* dim the current content while a new year loads (spinner stays crisp) */
.mb-issue-grid.mb-loading > * {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

/* loading spinner – shown only while .mb-loading is active */
.mb-issue-grid.mb-loading::after {
    content: "";
    position: absolute;
    top: 30px;
    left: 50%;
    width: 36px;
    height: 36px;
    margin-left: -18px;
    border: 3px solid rgba(30, 79, 119, 0.2);
    border-top-color: #1e4f77;
    border-radius: 50%;
    animation: mb-spin 0.8s linear infinite;
}

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

/* --- Issue Card --- */
.mb-issue-card {
    width: calc(33.333% - 7px);
    background-color: #ddebf7;
    padding: 30px;
    box-sizing: border-box;
}

.mb-issue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mb-issue-month {
    font-size: 13px;
    line-height: 17px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6C928F;
}

.mb-issue-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #1e4f77;
    color: #ffffff;
    font-size: 16px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.mb-issue-pdf:hover {
    background-color: #0A383B;
    color: #ffffff;
    text-decoration: none;
}

.mb-issue-title {
    font-size: 18px;
    line-height: 24px;
    font-weight: 500;
    margin-bottom: 10px;
}

.mb-issue-title:last-child {
    margin-bottom: 0;
}

.mb-issue-title a {
    color: inherit;
    text-decoration: none;
}

.mb-issue-title a:hover {
    text-decoration: underline;
}

.mb-issue-subtitle {
    font-size: 15px;
    line-height: 20px;
    color: #343434;
    margin-bottom: 10px;
}

/* --- Article Toggle --- */
.mb-issue-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #1e4f77;
}

.mb-article-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 15px;
    line-height: 19px;
    font-weight: 500;
    color: #1e4f77;
    cursor: pointer;
    transition: color 0.2s ease;
}

.mb-article-toggle:hover {
    color: #0A383B;
}

.mb-article-toggle .icomoon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

/* toggle icon visibility */
.mb-article-toggle .mb-toggle-icon-close {
    display: none;
}

.mb-article-toggle .mb-toggle-icon-open {
    display: inline;
}

.mb-article-toggle[aria-expanded="true"] .mb-toggle-icon-close {
    display: inline;
}

.mb-article-toggle[aria-expanded="true"] .mb-toggle-icon-open {
    display: none;
}

/* --- Articles List --- */
.mb-issue-articles {
    padding-top: 15px;
}

.mb-article-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mb-article-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.mb-article-title {
    font-size: 16px;
    line-height: 22px;
    font-weight: 500;
    margin-bottom: 6px;
}

.mb-article-title a {
    color: inherit;
    text-decoration: none;
}

.mb-article-title a:hover {
    text-decoration: underline;
}

.mb-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    line-height: 18px;
    color: #888888;
}

.mb-article-meta ul.authors {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 14px;
    line-height: 18px;
}


.mb-article-pages {
    white-space: nowrap;
}

.mb-article-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1e4f77;
    font-size: 14px;
}

.mb-article-pdf:hover {
    color: #0A383B;
    text-decoration: none;
}

/* --- No Issues State --- */
.mb-no-issues {
    width: 100%;
    padding: 60px 30px;
    text-align: center;
    color: #888888;
    background-color: #EFEFEF;
}

/* ==========================================================================
   Responsive: LG (max-width: 1599px)
   ========================================================================== */
@media (max-width: 1599px) {
    .mb-issue-card {
        padding: 25px;
    }
}

/* ==========================================================================
   Responsive: MD (max-width: 1279px)
   ========================================================================== */
@media (max-width: 1279px) {
    .mb-issue-card {
        width: calc(50% - 5px);
    }

    .mb-year-btn {
        width: calc(20% - 7px);
    }
}

/* ==========================================================================
   Responsive: SM (max-width: 1023px)
   ========================================================================== */
@media (max-width: 1023px) {
    section.monatsberichte-archive {
        padding: 30px 0;
    }

    .mb-decade-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
        margin-bottom: 20px;
    }

    .mb-decade-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 16px;
    }

    .mb-year-btn {
        width: calc(25% - 6px);
        padding: 12px 8px;
        font-size: 16px;
    }

    .mb-year-grid {
        margin-bottom: 30px;
    }

    .mb-issue-card {
        width: 100%;
    }
}

/* ==========================================================================
   Responsive: XS (max-width: 767px)
   ========================================================================== */
@media (max-width: 767px) {
    .mb-year-btn {
        width: calc(33.333% - 6px);
    }

    .mb-decade-btn {
        font-size: 14px;
        padding: 7px 12px;
    }

    .mb-issue-card {
        padding: 20px;
    }

    .mb-issue-title {
        font-size: 16px;
        line-height: 22px;
    }

    .mb-article-title {
        font-size: 15px;
        line-height: 20px;
    }
}
