/* ========================================================================
   Mosaik Grid Modul - Stylesheet
   ======================================================================== */

.mosaic-grid-container {
    width: 100%;
    margin: 0 auto;
}

.mosaic-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
}

.mosaic-item {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    text-decoration: none;
    background-color: #000;
}

.mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.6s ease;
}

.mosaic-item:focus {
    outline: 3px solid #ffcc00;
    outline-offset: -3px;
    z-index: 10;
}

.mosaic-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Erhöhtes padding-top von 20px auf 40px für mehr Platz über der Headline */
    padding: 40px 20px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    color: #fff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: background 0.4s ease;
}

.mosaic-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    /* Nutzt dynamische Farbe aus dem Backend */
    color: var(--headline-color, #ffffff);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.mosaic-subtitle {
    margin: 0;
    margin-top: 5px;
    font-size: 0.9rem;
    /* Nutzt dynamische Farbe aus dem Backend */
    color: var(--subtitle-color, #e0e0e0);
}

/* --- Mobile First: "Mehr erfahren" --- */
.mosaic-more {
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    /* ÄNDERUNG: Nutzt dynamische Farbe aus dem Backend */
    color: var(--link-color, #ffcc00);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    /* NEU: Sanfter Farbübergang */
}

.mosaic-more span {
    transition: transform 0.3s ease;
}

/* ========================================================================
   MEDIA QUERIES (Tablet & Desktop)
   ======================================================================== */

@media (min-width: 768px) {
    .mosaic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .mosaic-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 250px;
    }

    .mosaic-item {
        aspect-ratio: auto;
        height: 100%;
    }

    .mosaic-size-standard {
        grid-column: span 1;
        grid-row: span 1;
    }

    .mosaic-size-wide {
        grid-column: span 2;
        grid-row: span 1;
    }

    .mosaic-size-tall {
        grid-column: span 1;
        grid-row: span 2;
    }

    .mosaic-size-large {
        grid-column: span 2;
        grid-row: span 2;
    }

    /* --- DESKTOP ANIMATIONEN --- */

    .mosaic-text-wrapper {
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .mosaic-more {
        position: absolute;
        bottom: 20px;
        left: 20px;
        margin-top: 0;
        opacity: 0;
        transform: translateX(-15px);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .mosaic-item:hover img,
    .mosaic-item:focus img {
        transform: scale(1.08);
        filter: brightness(0.5);
    }

    .mosaic-item:hover .mosaic-overlay,
    .mosaic-item:focus .mosaic-overlay {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.3) 100%);
    }

    /* 1. Text slidet 25px nach oben */
    .mosaic-item:hover .mosaic-text-wrapper,
    .mosaic-item:focus .mosaic-text-wrapper {
        transform: translateY(-25px);
    }

    /* 2. "Mehr erfahren" fadet ein */
    .mosaic-item:hover .mosaic-more,
    .mosaic-item:focus .mosaic-more {
        opacity: 1;
        transform: translateX(0);
        /* NEU: Nutzt dynamische Hover-Farbe aus dem Backend */
        color: var(--link-hover-color, #ffd700);
    }

    /* 3. Pfeil schiebt sich leicht nach rechts */
    .mosaic-item:hover .mosaic-more span,
    .mosaic-item:focus .mosaic-more span {
        transform: translateX(4px);
    }
}
