/*
 * O2O Soft Framework - Elementor compatibility layer.
 * Loaded late and intentionally tiny.
 *
 * Primary goal: Elementor should control layout while browser default margins
 * must not create unexplained whitespace inside text widgets.
 */

/*
 * Text Editor paragraphs
 *
 * Elementor's editor HTML commonly contains direct <p> children. Browsers add
 * block-start/block-end margins to <p> by default; that is the blank space the
 * user observed at the top of a Text Editor widget. Reset every margin axis so
 * logical-property styles from Elementor/browser CSS cannot bring it back.
 */
.o2o-zero-elementor-paragraph-margin .elementor-widget-text-editor p,
.o2o-zero-elementor-paragraph-margin .elementor-widget-text-editor .elementor-widget-container > p,
.o2o-zero-elementor-paragraph-margin .elementor-widget-text-editor > .elementor-widget-container > p {
	margin: 0 !important;
	margin-top: 0 !important;
	margin-right: 0 !important;
	margin-bottom: 0 !important;
	margin-left: 0 !important;
	margin-block: 0 !important;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/* Also protect the first/last authored element from browser outer margins. */
.o2o-zero-elementor-paragraph-margin .elementor-widget-text-editor .elementor-widget-container > :first-child {
	margin-block-start: 0 !important;
	margin-top: 0 !important;
}

.o2o-zero-elementor-paragraph-margin .elementor-widget-text-editor .elementor-widget-container > :last-child {
	margin-block-end: 0 !important;
	margin-bottom: 0 !important;
}

/* Optional heading reset, disabled by default and controlled from snippets. */
.o2o-zero-elementor-heading-margin .elementor-widget-text-editor .elementor-widget-container > :is(h1,h2,h3,h4,h5,h6) {
	margin: 0 !important;
	margin-block: 0 !important;
}

/* Korean copy should break between words first, not in the middle of a word. */
.o2o-korean-word-break .elementor-widget-text-editor,
.o2o-korean-word-break .elementor-widget-theme-post-content {
	word-break: keep-all;
	overflow-wrap: break-word;
}

/*
 * Post content media.
 * Do not force width:100%. Keep the width saved by the editor/HTML and only
 * shrink when the image would overflow its parent.
 */
.o2o-preserve-content-image-size .elementor-widget-theme-post-content .elementor-widget-container img,
.o2o-preserve-content-image-size .entry-content img,
.o2o-preserve-content-image-size .post-content img,
.o2o-preserve-content-image-size .kboard-content .content-view img,
.o2o-preserve-content-image-size .kboard-document-wrap .content-view img,
.o2o-preserve-content-image-size #kboard-document .content-view img {
	max-width: 100% !important;
	height: auto !important;
	box-sizing: border-box !important;
}
