/**
 * Single Post Mobile Optimierungen
 * Spezielle CSS-Regeln für bessere mobile Darstellung von Einzelbeiträgen
 */

/* ===== SINGLE POST HEADER BILDER MOBILE OPTIMIERUNG ===== */

/* Grundlegende Responsive-Verbesserungen für Single Header */
.single-header {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    z-index: 1;
    isolation: isolate;
}

.single-header-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: transform 0.3s ease;
}

/* Improved responsive behavior with better mobile image handling */
@media (max-width: 480px) {
    .single-header {
    height: 160px !important;
    max-height: 160px !important;
    }
    
    .single-header-image {
    height: 160px !important;
    max-height: 160px !important;
        object-fit: cover !important;
        object-position: center center !important;
        /* Bessere Bildschärfe auf kleinen Bildschirmen */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    /* Content Wrapper Anpassungen für sehr kleine Bildschirme */
    .content-wrapper {
        padding-top: 5px !important;
    }
    
    .blog-section {
        padding-top: 15px !important;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .single-header {
    height: 220px !important;
    max-height: 220px !important;
    }
    
    .single-header-image {
    height: 220px !important;
    max-height: 220px !important;
        object-fit: cover !important;
        object-position: center center !important;
    }
}

@media (min-width: 769px) {
    .single-header {
        height: 300px !important;
        max-height: 300px !important;
    }
    
    .single-header-image {
        height: 300px !important;
        max-height: 300px !important;
        object-fit: cover !important;
        object-position: center center !important;
    }
}

/* ===== CONTENT BEREICH MOBILE OPTIMIERUNGEN ===== */

/* Post Content mobile optimizations */
@media (max-width: 768px) {
    .post-content img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px;
        margin: 10px 0;
    }
    
    .post-content figure {
        margin: 15px 0 !important;
        text-align: center;
    }
    
    .post-content figcaption {
        font-size: 13px !important;
        color: var(--text-grau-hell) !important;
        margin-top: 8px;
        font-style: italic;
    }
    
    /* Bessere Abstände für Absätze */
    .post-content p {
        margin-bottom: 16px !important;
        line-height: 1.6 !important;
    }
    
    /* Listen optimieren */
    .post-content ul,
    .post-content ol {
        margin: 15px 0 !important;
        padding-left: 20px !important;
    }
    
    .post-content li {
        margin-bottom: 8px !important;
        line-height: 1.5 !important;
    }
}

/* ===== SEHR KLEINE BILDSCHIRME (UNTER 480PX) ===== */

@media (max-width: 480px) {
    /* Noch kompaktere Darstellung für sehr kleine Bildschirme */
    .post-content p {
        margin-bottom: 14px !important;
        font-size: 15px !important;
        line-height: 1.7 !important;
    }
    
    .post-content h2,
    .post-content h3,
    .post-content h4 {
        margin-top: 20px !important;
        margin-bottom: 12px !important;
        line-height: 1.3 !important;
    }
    
    .post-content h2 {
        font-size: 1.5rem !important;
    }
    
    .post-content h3 {
        font-size: 1.3rem !important;
    }
    
    .post-content h4 {
        font-size: 1.1rem !important;
    }
    
    /* Bilder in Content kompakter */
    .post-content img {
        margin: 8px 0 !important;
        border-radius: 6px;
    }
    
    .post-content figure {
        margin: 12px 0 !important;
    }
    
    .post-content figcaption {
        font-size: 12px !important;
        margin-top: 6px;
    }
}

/* ===== TABLET OPTIMIERUNGEN (768PX - 992PX) ===== */

@media (min-width: 769px) and (max-width: 992px) {
    .single-header {
    height: 260px !important;
    max-height: 260px !important;
    }
    
    .single-header-image {
    height: 260px !important;
    max-height: 260px !important;
    }
    
    .post-content {
        font-size: 17px !important;
        line-height: 1.6 !important;
    }
    
    .post-title {
        font-size: 2.2rem !important;
    }
}

/* ===== PERFORMANCE OPTIMIERUNGEN ===== */

/* Reduce repaints and improve scrolling performance */
.single-header-image {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Entfernt: Lazyload-Opacity-Handling – Bilder sollen sofort sichtbar sein */

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* Bessere Fokus-Indikatoren für mobile Navigation */
@media (max-width: 768px) {
    .nav-previous a:focus,
    .nav-next a:focus {
        outline: 2px solid var(--fuechse-rot) !important;
        outline-offset: 2px;
        border-radius: 4px;
    }
    
    /* Touch-friendly button sizing */
    .tag-link {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        padding: 8px 16px !important;
        margin: 0 8px 8px 0 !important;
    }
}

/* Dark mode support für Bildkontrast */
@media (prefers-color-scheme: dark) {
    .single-header-image {
        filter: brightness(0.9);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .single-header-image {
        transition: none;
    }
    
    .tag-link {
        transition: none !important;
    }
    
    .post-content img {
        transition: none;
    }
}
