/* Latest Post Popup Styles */
#latest-post-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: none; /* Startet versteckt */
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

#latest-post-popup-overlay.show {
    display: flex; /* Wird via JavaScript angezeigt */
}

/* Body-Klasse wenn Popup offen ist */
body.popup-open {
    overflow: hidden !important;
    padding-right: 15px; /* Verhindert Layout-Shift beim Entfernen der Scrollbar */
}

#latest-post-popup {
    background: #ffffff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease-out;
}

#popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#popup-close:hover {
    color: #333;
    background-color: #f0f0f0;
}

.popup-content {
    padding: 30px;
    padding-top: 50px;
}

.popup-image {
    margin-bottom: 20px;
    width: 100%;
    height: 200px; /* Feste Höhe für konsistente Darstellung */
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Bild füllt Container aus, behält Proportionen */
    object-position: center; /* Zentriert das Bild im Container */
    display: block;
}

.popup-text h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 24px;
    line-height: 1.4;
}

.popup-text h3 a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease;
}

.popup-text h3 a:hover {
    color: #0073aa;
}

.popup-text p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 16px;
}

.popup-read-more {
    display: inline-block;
    background-color: #b7baa3;
    color: #ffffff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

.popup-read-more:hover {
    background-color: #565755;
    color: #ffffff;
}

/* Animation States */
#latest-post-popup-overlay.show {
    display: flex !important;
}

#latest-post-popup-overlay.show #latest-post-popup {
    transform: scale(1);
    opacity: 1;
}

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Alte slideIn Animation entfernt - wird jetzt via CSS transitions gemacht */

/* Responsive Design */
@media (max-width: 768px) {
    #latest-post-popup {
        width: 95%;
        margin: 20px;
    }
    
    .popup-content {
        padding: 20px;
        padding-top: 40px;
    }
    
    .popup-image {
        height: 150px; /* Kleinere Höhe auf Tablets */
    }
    
    .popup-text h3 {
        font-size: 20px;
    }
    
    .popup-text p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        padding: 15px;
        padding-top: 35px;
    }
    
    .popup-image {
        height: 120px; /* Noch kleinere Höhe auf Smartphones */
    }
    
    .popup-text h3 {
        font-size: 18px;
    }
}