/**
 * WISE - compatibility CSS for pages converted from WPBakery to blocks.
 * Reproduces the parts of WPBakery's front-end CSS (js_composer.min.css) the design relied on,
 * and neutralizes WordPress block defaults that would change the layout.
 */

/* ---- Rows / columns: theme gutters come from .vc_row/.vc_column_container padding, not from block gap */
.wp-block-columns.vc_row {
	gap: 0;
	margin-top: 0;
	margin-bottom: 0;
	align-items: stretch;
}
.wp-block-columns.vc_row > .wp-block-column { min-width: 0; }
.wp-block-group.container > .wp-block-columns.vc_row { margin-left: calc(0px - var(--gap-size)) !important; margin-right: calc(0px - var(--gap-size)) !important; }
.wp-block-group.container,
section.wp-block-group.vc_section { margin-top: 0; margin-bottom: 0; }

/* WPBakery spacing between content elements - zero specificity (:where) so theme modifiers
   like --reset-marg and the per-element .vc_custom_* spacing still win, exactly as before. */
:where(.wpb_content_element, .wp-block-image.vc_single_image, .wp-block-buttons.vc_btn3-container, .wp-block-gallery.vc_gallery) { margin-top: 0; margin-bottom: 35px; }
/* Same selectors/specificity as WPBakery's js_composer.min.css */
.wpb_text_column :last-child,
.wpb_text_column p:last-child { margin-bottom: 0; }
.wpb_content_element .wpb_wrapper > :last-child { margin-bottom: 0; }
/* WordPress "flow" layout adds margins between blocks - WPBakery didn't */
:where(.vc_section, .wp-block-group.container, .wpb_column, .vc_column-inner, .wpb_wrapper).is-layout-flow > *,
:where(.vc_column-inner > .wpb_wrapper) > * { margin-block-start: 0; }

/* Offsets (WPBakery grid, desktop) */
@media (min-width: 768px) {
	.wp-block-column.vc_col-sm-offset-1 { margin-left: 8.3333% !important; }
	.wp-block-column.vc_col-sm-offset-2 { margin-left: 16.6667% !important; }
}
@media (max-width: 781px) {
	/* Inner rows with vc_col-xs-4 stay 3 per row on phones (e.g. ISO certificates) */
	.wp-block-columns.vc_inner:has(> .vc_col-xs-4) { flex-wrap: nowrap !important; }
	.wp-block-columns.vc_inner > .wp-block-column.vc_col-xs-4 { flex-basis: 33.3333% !important; }
}

/* ---- Text: theme rule ".wpb_wrapper > p + p" now applies to direct children */
.tabel table { width: 100%; }
.tabel table, .tabel table * { border-color: #e5e5e5; }

/* ---- Images */
.wp-block-image.vc_single_image img { height: auto; }
.wp-block-image.vc_single_image.aligncenter { text-align: center; }

/* ---- Buttons converted from vc_btn: keep the theme look, drop the block-library pill style */
.wp-block-buttons.vc_btn3-container .wp-block-button__link {
	border-radius: 5px;
	font-size: 14px;
	line-height: 1.4;
	padding: 14px 20px;
	text-decoration: none;
	background-color: #f7f7f7;
	color: #5f5f5f;
	border: 1px solid transparent;
	transition: all .2s ease-in-out;
}
.wp-block-buttons.vc_btn3-container .wp-block-button__link:hover { background-color: #e0e0e0; color: #5f5f5f; }
.wp-block-buttons.vc_btn3-container .wp-block-button__link i { margin-right: .5em; }
.wp-block-buttons.vc_btn3-container.text-white .wp-block-button__link { background-color: #ed0000; color: #fff; }
.wp-block-buttons.btn-red .wp-block-button__link { text-align: left; }

/* ---- Separator (vc_separator was a thin grey line) */
hr.wp-block-separator.vc_separator {
	border: 0;
	border-top: 1px solid #ebebeb;
	opacity: 1;
	width: 100%;
	margin: 0 0 35px;
	height: 0;
}

/* ---- Embeds */
.wp-block-embed.is-type-video { margin: 0 0 35px; }

/* WPBakery: last element in a column has no bottom margin; image alignment via text-align */
.wpb_column > .vc_column-inner > .wpb_wrapper > :last-child { margin-bottom: 0; }
.wp-block-image.vc_align_left { text-align: left; }
.wp-block-image.vc_align_center { text-align: center; }
.wp-block-image.vc_align_right { text-align: right; }
.wp-block-image.wpb_single_image img { display: inline-block; max-width: 100%; height: auto; }

/* WPBakery: rows/columns with a background get top padding (same selectors as js_composer) */
.vc_row-has-fill > .vc_column_container > .vc_column-inner,
.vc_col-has-fill > .vc_column-inner { padding-top: 35px; }

/* vc_btn sizes + icon on the left, absolutely positioned like vc_btn3-icon-left */
.vc_btn3-container.vc_btn3-size-sm .wp-block-button__link { font-size: 12px; padding: 11px 16px; }
.vc_btn3-container.vc_btn3-size-md .wp-block-button__link { font-size: 14px; padding: 14px 20px; }
.vc_btn3-container.vc_btn3-size-lg .wp-block-button__link { font-size: 18px; padding: 18px 25px; }
.vc_btn3-container.vc_btn3-icon-left .wp-block-button__link { position: relative; padding-left: 48px; }
.vc_btn3-container.vc_btn3-icon-left .wp-block-button__link i {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	margin: 0;
	line-height: 1;
}
.vc_btn3-container.btn-red.vc_btn3-icon-left .wp-block-button__link i { left: 1rem; }

/* WPBakery/Bootstrap grid could wrap (e.g. a 1/1 title column followed by two 1/2 columns in the same row) */
@media (min-width: 782px) {
	.wp-block-columns.vc_row:has(> .col-sm-12 + .wp-block-column) { flex-wrap: wrap !important; }
	.wp-block-columns.vc_row:has(> .col-sm-12 + .wp-block-column) > .wp-block-column.col-sm-12 { flex-basis: 100% !important; flex-grow: 0; }
}
