/*
 * Digi Ziva: Elementor and all-device compatibility layer.
 * Keeps Elementor's own responsive controls in charge while preventing
 * common flex/grid overflow issues inside the theme and Elementor canvas.
 */

/* Global safety for theme layouts and Elementor widgets. */
html,
body {
	max-width: 100%;
	overflow-x: clip;
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

.dz-main,
.dz-main > *,
.elementor,
.elementor-section,
.elementor-container,
.elementor-column,
.elementor-widget-wrap,
.e-con,
.e-con-inner,
.elementor-widget {
	min-width: 0;
	box-sizing: border-box;
}

.elementor img,
.elementor-widget-image img,
.elementor-widget-image a img {
	max-width: 100%;
	height: auto;
}

.elementor-widget-text-editor,
.elementor-widget-heading,
.elementor-widget-button,
.elementor-widget-icon-list,
.elementor-widget-image,
.elementor-widget-form {
	min-width: 0;
	max-width: 100%;
}

.elementor-widget-text-editor table,
.dz-entry__content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.elementor-widget-text-editor pre,
.dz-entry__content pre {
	max-width: 100%;
	overflow-x: auto;
}

.elementor-button,
.elementor-button-wrapper,
.elementor-widget-button {
	max-width: 100%;
}

.elementor-button {
	white-space: normal;
	text-align: center;
}

/* Keep Elementor's boxed sections within the same visual site width. */
.elementor-section.elementor-section-boxed > .elementor-container {
	width: calc(100% - 48px);
	max-width: 1240px;
}

/* Theme typography and controls remain consistent in Elementor-built pages. */
.elementor-page .elementor-widget-heading .elementor-heading-title {
	font-family: var(--dz-font-head, 'Plus Jakarta Sans', Arial, sans-serif);
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.elementor-page .elementor-widget-text-editor,
.elementor-page .elementor-widget-text-editor p,
.elementor-page .elementor-icon-list-text {
	font-family: var(--dz-font-body, Inter, Arial, sans-serif);
	line-height: 1.7;
	overflow-wrap: anywhere;
}

.elementor-page .elementor-widget-button .elementor-button {
	border-radius: 12px;
	font-weight: 600;
	max-width: 100%;
}

/* Tablet and small laptop layouts. */
@media (max-width: 1024px) {
	.elementor-section.elementor-section-boxed > .elementor-container {
		width: calc(100% - 40px);
	}

	.elementor-page .dz-container,
	.elementor-page .e-con-inner {
		max-width: 100%;
	}

	.dz-hero__inner,
	.dz-about,
	.dz-split,
	.dz-intro,
	.dz-audit,
	.dz-land-hero__grid,
	.dz-about__grid {
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.dz-grid--3,
	.dz-grid--4,
	.dz-blog-grid,
	.dz-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile phones. */
@media (max-width: 767px) {
	.elementor-section.elementor-section-boxed > .elementor-container {
		width: calc(100% - 32px);
	}

	.elementor-column,
	.elementor-widget-wrap,
	.e-con,
	.e-con-inner {
		min-width: 0;
	}

	.elementor-widget-heading .elementor-heading-title {
		max-width: 100%;
		word-break: normal;
		font-size: clamp(1.65rem, 7vw, 2.35rem);
	}

	.elementor-widget-button .elementor-button {
		max-width: 100%;
		white-space: normal;
		padding: 12px 18px;
	}

	.dz-grid--2,
	.dz-grid--3,
	.dz-grid--4,
	.dz-blog-grid,
	.dz-gallery,
	.dz-form__grid,
	.dz-info-grid,
	.dz-pricing,
	.dz-process,
	.dz-footer__top {
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.dz-container {
		padding-right: 16px;
		padding-left: 16px;
	}

	.dz-section {
		padding-top: clamp(48px, 12vw, 68px);
		padding-bottom: clamp(48px, 12vw, 68px);
	}

	.dz-hero h1,
	.dz-page-hero__title {
		font-size: clamp(2rem, 9vw, 2.7rem);
		line-height: 1.12;
		word-break: normal;
	}

	.dz-btn-row {
		flex-wrap: wrap;
	}

	.dz-btn-row .dz-btn {
		max-width: 100%;
	}

	.dz-project,
	.dz-shot,
	.dz-card,
	.dz-price,
	.dz-testi {
		min-width: 0;
	}
}

/* Reduced motion remains respected for users who request it. */
@media (prefers-reduced-motion: reduce) {
	.elementor-page *,
	.elementor-page *::before,
	.elementor-page *::after {
		scroll-behavior: auto !important;
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}


/* Elementor editor preview / first-edit support. */
.dz-elementor-main {
	width: 100%;
	min-width: 0;
	max-width: 100%;
}
.dz-elementor-page .dz-elementor-main > .elementor {
	width: 100%;
	max-width: 100%;
}
.dz-elementor-page .elementor-widget-container {
	min-width: 0;
}
.dz-elementor-page .elementor-section,
.dz-elementor-page .e-con {
	max-width: 100%;
}
.dz-elementor-page .elementor-widget:not(:last-child) {
	margin-bottom: 0;
}
@media (max-width: 767px) {
	.dz-elementor-page .elementor-section.elementor-section-boxed > .elementor-container {
		width: calc(100% - 28px);
	}
	.dz-elementor-page .e-con {
		--width: 100%;
	}
}
