.rst-content p {
    max-width: 80ch; /* Limit text to 40 characters per line */
    overflow: auto ; /* Prevent overflow */
    text-overflow: ellipsis;  
    word-wrap: normal; /* Ensure long words wrap properly */
    word-break: break-word; /* Ensure words are not split unless necessary */
    hyphens: None; /* Optional: Enable hyphenation */
}

.rst-content table td {
    white-space: normal; /* Allow wrapping inside table cells */
    word-wrap: break-word; /* Ensure long words break */
    overflow-wrap: break-word; /* Compatibility for word breaking */
}

/* Ensure math equations wrap naturally */
.rst-content .math {
    white-space: normal !important; /* Allow wrapping */
    overflow-wrap: break-word; /* Break long equations at any point */
    overflow-x: auto; /* Add horizontal scrolling for very wide equations */
}

/* Limit block math equations to fit within the content area */
.rst-content .math.display {
    max-width: 85%; /* Adjust as needed */
    margin: 0 auto; /* Center the block equations */
    white-space: normal !important; /* Enable line wrapping */
}

/* Style inline equations for better wrapping */
.rst-content .math.inline {
    white-space: normal !important;
    overflow-wrap: break-word;
}