/* =========================================
   PROJECTS GRID - FREI SCHWEBEND (NATIVE 3D)
   ========================================= */

/* Hauptinhalt, direkt auf dem Hintergrund */
.projects-main-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding-bottom: 150px;
    text-align: center;
}

/* =========================================
   TITEL CONTAINER OVERRIDE
   (Nutzt .intro-card aus deinem bestehenden System)
   ========================================= */
.ya-title-wrapper {
    /* Überschreibt das Block-Verhalten der intro-card, damit sie sich eng an den Text anpasst */
    display: inline-block !important; 
    white-space: nowrap;
    margin: 0 auto 80px;
    border-radius: 99px !important; /* Pill-Form erzwingen */
    text-align: center;
}

/* =========================================
   KACHELN GRID
   ========================================= */
.ya-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: left; /* Text in den Kacheln wieder linksbündig */
}

.ya-tile {
    background: rgba(150, 150, 150, 0.15);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.35);
    transition: transform 0.5s ease, box-shadow 0.3s ease, background 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #f0f0f0;
    animation: ya-float 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.ya-tile:nth-child(odd) { animation-delay: 0.3s; }

.ya-tile:hover {
    transform: translateY(-10px);
    background: rgba(40, 40, 70, 0.6);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    animation-play-state: paused;
}

@keyframes ya-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.ya-tile-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ya-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ya-tile-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* =========================================
   STATUS BADGES & OFFLINE EFFEKTE
   ========================================= */
.ya-tile-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: black;
    color: #ffbf00;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.ya-tile-status[data-status="offline"] {
    color: #ff0019;
    border-color: rgba(220, 53, 69, 0.3);
}

@keyframes ya-pulse-offline {
    0%, 100% { box-shadow: 0 0 16px 2px rgba(255, 0, 26, 0.75); }
    70% { box-shadow: 0 0 36px 14px rgba(255, 0, 26, 0.45); }
}

.ya-tile:has(.ya-tile-status[data-status="offline"]) {
    animation: ya-pulse-offline 2s infinite;
    border-color: rgba(255, 0, 26, 0.6) !important;
    cursor: not-allowed !important;
}

.ya-tile:has(.ya-tile-status[data-status="offline"]):hover {
    transform: none;
    box-shadow: 0 14px 50px rgba(255, 0, 26, 0.38) !important;
}

.ya-tile:has(.ya-tile-status[data-status="offline"])::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 0, 26, 0.2); 
    pointer-events: none;
}

.ya-tile:has(.ya-tile-status[data-status="offline"]) .ya-tile-image {
    filter: sepia(0.25) hue-rotate(-12deg) saturate(1.8) brightness(0.7);
}

.ya-badge-new {
    color: #00e5ff !important; border-color: rgba(0, 229, 255, 0.3) !important;
}

.ya-badge-update {
    color: #e500ff !important; border-color: rgba(229, 0, 255, 0.3) !important;
}

/* =========================================
   BILDER & OVERLAYS
   ========================================= */
.ya-tile-image-container {
    position: relative;
    width: 100%;
    height: 195px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.ya-tile-image {
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity 0.3s;
}

.ya-tile-image.loaded { opacity: 1; }

.ya-tile-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
    text-align: center;
    pointer-events: none;
}

.ya-tile:has(.ya-tile-info-btn:hover) .ya-tile-image-overlay {
    opacity: 1;
}

.ya-overlay-subtitle {
    color: #fff; font-size: 1.05rem; font-weight: 600; margin-bottom: 12px;
}
.ya-overlay-date {
    color: rgba(255, 255, 255, 0.7); font-size: 0.8rem; margin-bottom: 4px;
}

.ya-tile-info-btn {
    display: flex; align-items: center; justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 34px; height: 34px;
    transition: all 0.3s ease; margin-left: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.ya-tile-info-btn:hover {
    color: #00e5ff; transform: scale(1.15);
}

/* Image Placeholder */
.ya-image-placeholder {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, #ffffff05 25%, #ffffff1b 50%, #ffffff05 75%);
    background-size: 200% 100%;
    animation: ya-loading 1.5s infinite;
}

@keyframes ya-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =========================================
   RESPONSIVES DESIGN & MOBILE OPTIMIERUNG
   ========================================= */
@media (max-width: 1600px) { 
    .ya-tiles { grid-template-columns: repeat(4, 1fr); gap: 25px; padding: 0 40px; } 
}

@media (max-width: 1200px) { 
    .ya-tiles { grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 0 20px; } 
}

@media (max-width: 900px) { 
    .ya-tiles { grid-template-columns: repeat(2, 1fr); gap: 20px; padding: 0 20px; } 
}

@media (max-width: 600px) { 
    .projects-main-container { padding-top: 100px !important; padding-bottom: 100px; }
    
    .ya-title-wrapper { padding: 15px 30px !important; margin-bottom: 40px !important; }
    .ya-title-wrapper h1 { font-size: 2.2rem !important; letter-spacing: -1px; }
    
    .ya-tiles { grid-template-columns: 1fr; gap: 20px; padding: 0 20px; } 
    
    .ya-tile-image-container { height: 170px; } 
    .ya-tile-content { padding: 15px; }
    .ya-tile-title { font-size: 1.15rem; }
}