/* Case Theme Core - layout safety fixes (v1.0.2)
 * Fixes shrink-to-fit / collapsed Elementor widgets (grids, carousels, fancy boxes)
 * after Elementor / theme updates. Replaces the old :has() grid hack, which forced
 * wrong layouts on image widgets.
 */

/* 1. Our widgets must always take the full width of their column / container */
.elementor-widget[class*="elementor-widget-ct_"],
.elementor-widget[class*="elementor-widget-ct-"],
.elementor-widget[class*="elementor-widget-cms_"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.elementor-widget[class*="elementor-widget-ct_"] > .elementor-widget-container,
.elementor-widget[class*="elementor-widget-ct-"] > .elementor-widget-container,
.elementor-widget[class*="elementor-widget-cms_"] > .elementor-widget-container {
    width: 100%;
    min-width: 0;
}

/* 2. Newer Elementor flex containers: children are width:auto by default */
.e-con > .elementor-widget[class*="elementor-widget-ct_"],
.e-con-inner > .elementor-widget[class*="elementor-widget-ct_"],
.e-con > .elementor-widget[class*="elementor-widget-ct-"],
.e-con-inner > .elementor-widget[class*="elementor-widget-ct-"] {
    width: 100%;
    flex: 0 0 100%;
}

/* 3. Column wrappers must not shrink around their content */
.elementor-column > .elementor-widget-wrap,
.elementor-column > .elementor-column-wrap > .elementor-widget-wrap {
    width: 100%;
    min-width: 0;
}

/* 4. Grid / masonry blocks keep full width, so Isotope measures correctly */
.ct-grid,
.ct-grid .ct-grid-inner {
    width: 100%;
    max-width: none;
}
.ct-grid .ct-grid-inner {
    box-sizing: border-box;
}

/* 5. Bootstrap columns inside grids can shrink below their text, never clip it */
.ct-grid .grid-item {
    min-width: 0;
}
.ct-grid .grid-item img {
    max-width: 100%;
    height: auto;
}
.ct-grid .item--title {
    overflow-wrap: break-word;
    word-break: normal;
}

/* 6. Old helper wrapper: neutral, no forced flex layout */
.elementor-widget-inner {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
