/* Article Mobile Fixes and Improvements */

/* Hero Section - Fixed positioning and mobile view */
.article-hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: flex-end; /* Posunuto dolů */
    margin-top: 90px;
    overflow: hidden;
    padding-bottom: var(--spacing-xxl);
}

.article-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.7) 60%,
        rgba(0, 0, 0, 0.9) 100%
    );
    z-index: 0;
}

.article-hero-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 900px;
    width: 100%;
}

.article-breadcrumb {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.95;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.article-breadcrumb a {
    color: white;
    text-decoration: none;
    transition: var(--transition-fast);
}

.article-breadcrumb a:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.article-category,
.article-date,
.article-reading-time {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.article-hero h1 {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    line-height: 1.2;
    margin-bottom: var(--spacing-lg);
    font-weight: var(--font-weight-extrabold);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.article-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    line-height: 1.6;
    margin-bottom: var(--spacing-xl);
    opacity: 0.95;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Warning Box - Fixed text visibility */
.warning-box {
    background: #fff8e1; /* Světlejší žlutá */
    border: 2px solid #ffb300;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.warning-box h4 {
    color: #e65100; /* Tmavší oranžová pro lepší kontrast */
    margin-bottom: var(--spacing-md);
}

.warning-box p,
.warning-box ul,
.warning-box li {
    color: #424242; /* Tmavě šedá místo hnědé */
}

/* Related Articles - Fixed layout */
.related-articles {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.related-article {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.related-article:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.related-article img {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.related-article-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-article h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0 0 var(--spacing-xs) 0;
}

.related-article.coming-soon {
    opacity: 0.7;
}

.coming-soon-badge {
    display: inline-block;
    background: var(--text-muted);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    margin-top: 0.25rem;
    font-weight: var(--font-weight-medium);
}

/* Article Images - Fixed size */
.article-image {
    margin: var(--spacing-xl) 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    max-height: 500px;
}

.article-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

/* Material Cards Images - Fixed size */
.material-card img,
.blog-card-image img {
    max-height: 200px;
    object-fit: cover;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    /* Hero fixes */
    .article-hero {
        min-height: 60vh;
        align-items: flex-end;
        padding-bottom: var(--spacing-lg);
    }
    
    .article-hero-content {
        padding: 0 var(--spacing-md);
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .article-author {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .article-share {
        width: 100%;
        justify-content: flex-start;
    }
    
    /* Container fixes - Better alignment */
    .container-article {
        padding: 0 var(--spacing-md);
    }
    
    .article-main {
        padding: 0;
    }
    
    /* Section content alignment */
    .article-section {
        margin-bottom: var(--spacing-xl);
    }
    
    .article-section h2 {
        font-size: 1.6rem;
        text-align: left;
        padding-left: 0;
    }
    
    .article-section h3 {
        font-size: 1.3rem;
        text-align: left;
    }
    
    .article-section p,
    .article-section ul,
    .article-section ol {
        text-align: left;
        padding-left: 0;
        margin-left: 0;
    }
    
    /* Table fixes */
    .comparison-table,
    .price-table {
        font-size: 0.8rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .comparison-table table,
    .price-table table {
        min-width: 500px;
    }
    
    .comparison-table th,
    .comparison-table td,
    .price-table th,
    .price-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Grid fixes */
    .recommendations,
    .material-grid,
    .roi-cards,
    .maintenance-schedule {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* CTA buttons */
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-button {
        width: 100%;
        text-align: center;
    }
    
    /* Sidebar on mobile */
    .article-sidebar {
        grid-template-columns: 1fr;
        margin-top: var(--spacing-xl);
    }
    
    .sidebar-card {
        margin-bottom: var(--spacing-md);
    }
    
    /* Related articles on mobile */
    .related-article {
        grid-template-columns: 80px 1fr;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
    
    .related-article img {
        width: 80px;
        height: 60px;
    }
    
    .related-article h4 {
        font-size: 0.85rem;
    }
    
    /* Images on mobile */
    .article-image {
        margin: var(--spacing-lg) 0;
        max-height: 300px;
    }
    
    .article-image img {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .article-hero {
        min-height: 55vh;
    }
    
    .article-hero h1 {
        font-size: 1.5rem;
    }
    
    .article-subtitle {
        font-size: 0.95rem;
    }
    
    .container-article {
        padding: 0 1rem;
    }
    
    .article-section h2 {
        font-size: 1.4rem;
    }
    
    .article-section h3 {
        font-size: 1.2rem;
    }
    
    .article-section p {
        font-size: 1rem;
    }
    
    /* Author section */
    .author-avatar {
        width: 50px;
        height: 50px;
    }
    
    .author-name {
        font-size: 1rem;
    }
    
    .author-title {
        font-size: 0.8rem;
    }
    
    /* Share buttons */
    .share-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* Related articles extra small */
    .related-article {
        grid-template-columns: 70px 1fr;
    }
    
    .related-article img {
        width: 70px;
        height: 55px;
    }
    
    .related-article h4 {
        font-size: 0.8rem;
    }
    
    .coming-soon-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Boxes and cards padding */
    .article-highlight,
    .info-box,
    .tip-box,
    .warning-box,
    .cta-box,
    .final-cta {
        padding: var(--spacing-md);
    }
    
    .material-card,
    .roi-card,
    .recommendation-card {
        padding: var(--spacing-md);
    }
    
    /* Decision tree */
    .decision-step {
        padding: var(--spacing-md);
    }
    
    /* Tables very small screens */
    .comparison-table table,
    .price-table table {
        min-width: 400px;
    }
}

/* Landscape mobile fix */
@media (max-width: 900px) and (orientation: landscape) {
    .article-hero {
        min-height: 100vh;
    }
}

/* Fix for text alignment issues */
.article-section * {
    text-align: left;
}

.article-section .cta-box *,
.article-section .final-cta *,
.article-highlight * {
    text-align: center;
}

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Fix sidebar sticky on mobile */
@media (max-width: 1200px) {
    .article-sidebar {
        position: static;
        top: auto;
    }
}

/* Better scrolling on mobile tables */
.comparison-table,
.price-table {
    position: relative;
}

.comparison-table::after,
.price-table::after {
    content: '← Potáhněte pro více →';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

@media (min-width: 769px) {
    .comparison-table::after,
    .price-table::after {
        display: none;
    }
}