/**
 * Ultimate Content Discovery - Frontend Responsive Styles
 * 
 * Ensures images, tables, and other elements are responsive on mobile devices.
 */

/* ========================================
   RESPONSIVE IMAGES
   ======================================== */
.entry-content img,
.elementor-widget-container img,
article img,
.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Elementor specific image fixes */
.elementor-image img,
.elementor-widget-image img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   RESPONSIVE TABLES
   ======================================== */
.entry-content table,
.elementor-widget-container table,
article table,
.post-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
}

/* Make tables scrollable on mobile */
@media screen and (max-width: 768px) {
    .entry-content table,
    .elementor-widget-container table,
    article table,
    .post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .entry-content table th,
    .entry-content table td,
    .elementor-widget-container table th,
    .elementor-widget-container table td {
        white-space: nowrap;
        min-width: 120px;
    }
}

/* ========================================
   RESPONSIVE ELEMENTOR SECTIONS
   ======================================== */
@media screen and (max-width: 767px) {
    .elementor-section.elementor-section-boxed > .elementor-container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .elementor-widget-wrap {
        padding: 0 10px;
    }
}

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */
@media screen and (max-width: 480px) {
    .entry-content h1,
    .elementor-widget-container h1 {
        font-size: 1.75rem;
        word-wrap: break-word;
    }
    
    .entry-content h2,
    .elementor-widget-container h2 {
        font-size: 1.5rem;
        word-wrap: break-word;
    }
    
    .entry-content p,
    .elementor-widget-container p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* ========================================
   FIX OVERFLOW ISSUES
   ======================================== */
body,
.entry-content,
.elementor-widget-container,
article {
    overflow-x: hidden;
}

/* Prevent horizontal scroll from wide elements */
pre, code {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
}

/* ========================================
   RESPONSIVE IFRAMES & EMBEDS
   ======================================== */
.entry-content iframe,
.elementor-widget-container iframe,
.responsive-embed {
    max-width: 100%;
}

/* 16:9 Ratio Container for Videos */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   CTA BOX RESPONSIVE
   ======================================== */
@media screen and (max-width: 600px) {
    .ucd-cta-box {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .ucd-cta-headline {
        font-size: 1.25rem;
    }
    
    .ucd-cta-body {
        font-size: 0.95rem;
    }
    
    .ucd-cta-button {
        display: block;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
}
