/* TinyMCE Content Container Styles - Prevents Overflow */

.article-content {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Images */
.article-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 1rem auto;
}

/* Tables - More specific styling to avoid affecting other layouts */
.article-content table {
    max-width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

/* Only add scrolling wrapper if table is actually too wide */
.article-content .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content table td,
.article-content table th {
    word-break: break-word;
    padding: 0.5rem;
}

/* Iframes and Videos */
.article-content iframe,
.article-content video,
.article-content embed,
.article-content object {
    max-width: 100% !important;
    height: auto;
}

/* Responsive iframe container (for embeds like YouTube) */
.article-content .iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.article-content .iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Pre and Code blocks */
.article-content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
}

.article-content code {
    word-break: break-all;
}

/* Blockquotes - No overflow properties that would add scrollbars */
.article-content blockquote {
    max-width: 100%;
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 4px solid #39455c;
    background: #eee;
    
}

/* Lists */
.article-content ul,
.article-content ol {
    max-width: 100%;
    padding-left: 2rem;
}

/* Figures */
.article-content figure {
    max-width: 100%;
    margin: 1rem 0;
}

.article-content figcaption {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-top: 0.5rem;
}

/* Divs and general containers - removed overflow properties */
.article-content > * {
    max-width: 100%;
}

/* Fix for nested content */
.article-content * {
    box-sizing: border-box;
}

/* Horizontal Rules */
.article-content hr {
    max-width: 100%;
    margin: 2rem 0;
}

/* Links */
.article-content a {
    word-break: break-word;
}

/* Remove any unwanted scrollbars from non-table elements */
.article-content > div,
.article-content > section,
.article-content blockquote,
.article-content figure {
    overflow: visible;
}