/**
 * MSA Gallery — Archive Styles
 *
 * Nutzt ausschließlich Theme-CSS-Variablen. Kein Inline-CSS.
 *
 * @package MSA_Gallery
 * @since   1.6.0
 */

/* ==========================================================================
   Archiv-Wrapper
   ========================================================================== */

.msa-gallery-archive {
    max-width: var(--msa-divider-max, 1200px);
    margin: 0 auto;
    padding: 4rem var(--msa-divider-side, 1rem) 2rem;
}

/* ==========================================================================
   Hero-Header
   ========================================================================== */

.msa-gallery-archive-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.msa-gallery-archive-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--msa-ink, #0f172a);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.msa-gallery-archive-subtitle {
    font-size: 1.1rem;
    color: var(--msa-ink-2, #334155);
    margin: 0;
}

/* ==========================================================================
   Filter-Chips
   ========================================================================== */

.msa-gallery-filters {
    margin-bottom: 2.5rem;
}

.msa-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.msa-filter-row:last-child {
    margin-bottom: 0;
}

.msa-filter-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--msa-ink-2, #334155);
    min-width: 60px;
}

.msa-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.9rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--msa-ink-2, #334155);
    background: var(--msa-surface, #f5f0ff);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.msa-filter-chip:hover {
    border-color: var(--msa-accent, #a020f0);
    color: var(--msa-accent, #a020f0);
    background: var(--msa-surface, #f5f0ff);
    text-decoration: none;
}

.msa-filter-chip.is-active {
    background: var(--msa-accent, #a020f0);
    border-color: var(--msa-accent, #a020f0);
    color: #fff;
}

.msa-filter-chip.is-all {
    border-color: var(--msa-primary, #ff9933);
    color: var(--msa-primary, #ff9933);
}

.msa-filter-chip.is-all.is-active,
.msa-filter-chip.is-all:hover {
    background: var(--msa-primary, #ff9933);
    border-color: var(--msa-primary, #ff9933);
    color: #fff;
}

.msa-filter-chip-count {
    font-size: 0.75rem;
    opacity: 0.75;
}

/* ==========================================================================
   Archiv-Grid
   ========================================================================== */

.msa-gallery-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .msa-gallery-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .msa-gallery-archive-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Galerie-Karte
   ========================================================================== */

.msa-gallery-card {
    background: #fff;
    border: var(--msa-card-border, 2px solid var(--msa-primary, #ff9933));
    border-radius: var(--msa-card-radius, 16px);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.msa-gallery-card:hover {
    border-color: var(--msa-accent, #a020f0);
    box-shadow: 0 8px 24px rgba(160, 32, 240, 0.12);
}

.msa-gallery-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Bildbereich */
.msa-gallery-card-images {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--msa-surface, #f5f0ff);
    flex-shrink: 0;
}

.msa-gallery-card-images > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.msa-gallery-card:hover .msa-gallery-card-images > img {
    transform: scale(1.04);
}

/* 4-Bilder-Preview-Grid */
.msa-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 100%;
    gap: 2px;
}

.msa-preview-cell {
    overflow: hidden;
}

.msa-preview-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.msa-gallery-card:hover .msa-preview-cell img {
    transform: scale(1.04);
}

/* Overlay mit Bildanzahl */
.msa-gallery-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 0.75rem 0.6rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
}

.msa-photo-count {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Video-Badge */
.msa-video-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Sichtbarkeits-Badge */
.msa-visibility-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Placeholder wenn keine Bilder */
.msa-gallery-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3rem;
    background: var(--msa-surface, #f5f0ff);
    color: var(--msa-accent, #a020f0);
    opacity: 0.4;
}

/* Karten-Inhalt */
.msa-gallery-card-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.msa-gallery-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--msa-ink, #0f172a);
    line-height: 1.3;
}

/* Badges: Typ + Saison */
.msa-gallery-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.msa-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.msa-badge-type {
    background: var(--msa-surface, #f5f0ff);
    color: var(--msa-accent, #a020f0);
    border: 1px solid var(--msa-accent, #a020f0);
}

.msa-badge-season {
    background: #fff5e6;
    color: var(--msa-primary, #ff9933);
    border: 1px solid var(--msa-primary, #ff9933);
}

/* Bericht-Link */
.msa-card-report-link {
    margin-top: auto;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--msa-accent, #a020f0);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.msa-card-report-link:hover {
    color: var(--msa-primary, #ff9933);
    text-decoration: underline;
}

/* ==========================================================================
   Keine Ergebnisse
   ========================================================================== */

.msa-gallery-no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--msa-surface, #f5f0ff);
    border-radius: var(--msa-card-radius, 16px);
    grid-column: 1 / -1;
}

.msa-gallery-no-results h2 {
    color: var(--msa-ink, #0f172a);
    margin-bottom: 0.5rem;
}

.msa-gallery-no-results p {
    color: var(--msa-ink-2, #334155);
}

.msa-gallery-no-results a {
    color: var(--msa-primary, #ff9933);
    font-weight: 600;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.msa-gallery-pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.msa-gallery-pagination a,
.msa-gallery-pagination span {
    padding: 0.45rem 0.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: var(--msa-ink-2, #334155);
    font-weight: 500;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.msa-gallery-pagination a:hover {
    border-color: var(--msa-accent, #a020f0);
    color: var(--msa-accent, #a020f0);
}

.msa-gallery-pagination .current {
    background: var(--msa-accent, #a020f0);
    border-color: var(--msa-accent, #a020f0);
    color: #fff;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .msa-gallery-archive-header {
        margin-bottom: 1.5rem;
    }

    .msa-filter-label {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .msa-gallery-filters {
        margin-bottom: 1.5rem;
    }
}
