.document-meta {
    max-width: 100%;
    overflow: hidden;
}

/* Improved meta-items layout - ensure exactly 2 per row */
.meta-items {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; 
    gap: 1rem !important;
    margin-bottom: 1rem;
    width: 100%;
}

.summary-box {
    max-width: 100%;
    margin: 1rem 0;
}

@media (min-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
}

/* Style du bouton download plus discret */
.download-button {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

/* Styles agressifs pour AdSense */
.premium-download-box {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.premium-download-text {
    font-size: 1.2rem;
    color: #000;
    margin-bottom: 1rem;
}

.premium-benefits {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
}

.premium-benefits li {
    margin: 0.5rem 0;
    color: #333;
}

.ad-container {
    position: relative;
    z-index: 10;
    margin: 2rem auto;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 800px;
}

/* Enhanced meta-items layout for proper display */
.document-filename {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    font-weight: normal;
    padding-left: 0.5rem;
}

/* Each meta-item takes equal space in the grid */
.meta-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    box-sizing: border-box;
    margin: 0 !important;
    width: 100% !important;
}

/* Reset flex properties since we're using grid now */
@media (min-width: 1200px) {
    .meta-items {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .meta-item {
        margin-right: 0;
        width: 100%;
    }
}

/* Force the grid layout on all screen sizes except mobile */
@media screen and (min-width: 768px) {
    .meta-items {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .document-info-grid {
        grid-template-columns: 1fr;
    }
    
    .meta-item {
        flex: 0 0 100%;
    }
    
    .document-preview {
        max-width: 250px;
        margin: 0 auto 1.5rem;
    }
    
    .document-header h1 {
        font-size: 1.5rem;
        line-height: 1.4;
        word-break: break-word;
    }
    
    .document-filename {
        word-break: break-all;
    }
    
    .download-button {
        width: 100%;
        text-align: center;
    }
    
    /* Related documents mobile adjustments */
    .related-documents .result-item {
        flex-direction: column;
    }
    
    .related-documents .result-thumbnail {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .related-documents .result-content {
        width: 100%;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .description-content {
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
    }
    
    .meta-items {
        grid-template-columns: 1fr !important; /* Single column on mobile */
    }
}

/* Medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .document-info-grid {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
    
    .document-header h1 {
        font-size: 1.75rem;
    }
    
    .related-documents .results-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.document-pages {
    display: inline-block;
    margin-left: 1rem;
    font-size: 0.9rem;
    color: #555;
    background: #f0f7ff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}