/* Container und Grid - Mobile First */
.mod-tile-cards .tile-grid {
    display: grid;
    /* Handy: 1 Spalte (Standard) */
    grid-template-columns: 1fr;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Tablet: 2 Spalten */
@media (min-width: 768px) {
    .mod-tile-cards .tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: Maximal 3 Spalten */
@media (min-width: 992px) {
    .mod-tile-cards .tile-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Kachel Grundgerüst */
.mod-tile-cards .tile-card {
    position: relative;
    aspect-ratio: 1 / 1;
    /* SP Page Builder Fallback, damit die Kachel nicht auf 0px kollabiert */
    min-height: 300px;
    min-width: 100%;
    
    overflow: hidden;
    border-radius: 4px;
    /* Mauszeiger bleibt Standard */
    cursor: default; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    /* Accessibility: Outline für Tastaturfokus */
    outline: 2px solid transparent;
    transition: outline-color 0.2s ease;
}

.mod-tile-cards .tile-card:focus-visible {
    outline-color: #0056b3;
    outline-offset: 4px;
}

/* Vorder- und Rückseite */
.mod-tile-cards .tile-front,
.mod-tile-cards .tile-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Spezifisch Vorderseite */
.mod-tile-cards .tile-front {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.mod-tile-cards .tile-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0, 163, 147, 0.8) 100%);
    z-index: 2;
}

.mod-tile-cards .tile-icon-plus {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 3;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.mod-tile-cards .tile-icon-plus svg {
    width: 24px;
    height: 24px;
}

/* Spezifisch Rückseite */
.mod-tile-cards .tile-back {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    text-align: center;
    opacity: 0;
    z-index: 4;
}

.mod-tile-cards .tile-desc p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0;
    font-weight: 500;
}

/* Typografie Titel (Geteiltes Styling) */
.mod-tile-cards .tile-title {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    text-align: center;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 900;
    z-index: 3;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.mod-tile-cards .tile-title-back {
    position: relative;
    bottom: 0;
}

/* Die Hover / Focus Mechanik */
.mod-tile-cards .tile-card:hover .tile-back,
.mod-tile-cards .tile-card:focus-visible .tile-back {
    opacity: 1;
}

.mod-tile-cards .tile-card:hover .tile-front,
.mod-tile-cards .tile-card:focus-visible .tile-front {
    opacity: 0;
    transform: scale(1.05); /* Leichter Zoom Out Effekt beim verschwinden */
}









/* Styling fuer den Urheber- / KI-Hinweis (dezent) */
.mod-tile-cards .tile-image-credit {
    position: absolute;
    bottom: 0.4rem; /* Ganz unten am Rand, unter dem Titel */
    right: 0.5rem;  /* Rechts unten in die Ecke gesetzt */
    background: transparent; /* Den schwarzen Kasten entfernen */
    color: rgba(255, 255, 255, 0.7); /* Leicht transparente weiße Schrift */
    font-size: 0.55rem; /* Sehr dezent und klein */
    z-index: 5;
    pointer-events: none;
    /* Ein starker Schatten sichert die Lesbarkeit (WCAG-Kontrast), auch wenn das Bild extrem hell ist */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9), 0px 0px 2px rgba(0, 0, 0, 0.5); 
    letter-spacing: 0.5px;
    font-weight: 400;
}

/* Hilfsklasse: Text nur fuer Screenreader sichtbar machen (bleibt unveraendert) */
.mod-tile-cards .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}









/* Barrierefreiheit: Animationen reduzieren (prefers-reduced-motion) */
@media (prefers-reduced-motion: reduce) {
    .mod-tile-cards .tile-front,
    .mod-tile-cards .tile-back,
    .mod-tile-cards .tile-card {
        transition: none !important;
    }
    
    .mod-tile-cards .tile-card:hover .tile-front,
    .mod-tile-cards .tile-card:focus-visible .tile-front {
        /* Zoom-Effekt deaktivieren */
        transform: none !important; 
    }
}