/**
 * Editor-only fixes for block canvas previews (iframed editor).
 * calc(50% - 50vw) misaligns inside the block editor canvas and clips content on the left.
 */

.editor-styles-wrapper :is(.vk-fullwidth, .vk-image-quote-slider, .vk-image-gallery-row, .vk-parallax, .vk-partial-gallery),
.block-editor-writing-flow :is(.vk-fullwidth, .vk-image-quote-slider, .vk-image-gallery-row, .vk-parallax, .vk-partial-gallery),
.acf-block-preview :is(.vk-fullwidth, .vk-image-quote-slider, .vk-image-gallery-row, .vk-parallax, .vk-partial-gallery) {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/*
 * Partial gallery: keep frontend left-bleed + square tiles in the canvas.
 * Only neutralize clipping; do not flatten the slider to 100% width.
 */
.editor-styles-wrapper .wp-block-acf-vk-partial-gallery,
.acf-block-preview .wp-block-acf-vk-partial-gallery,
.editor-styles-wrapper .vk-partial-gallery,
.acf-block-preview .vk-partial-gallery {
	overflow: visible;
}

.editor-styles-wrapper .vk-partial-gallery::before,
.acf-block-preview .vk-partial-gallery::before {
	left: calc(50% - 50vw);
	width: 100vw;
}

.editor-styles-wrapper .vk-partial-gallery__slider,
.acf-block-preview .vk-partial-gallery__slider {
	margin-left: calc(50% - 50vw);
	width: calc(50vw + 50%);
	overflow: hidden;
}

.editor-styles-wrapper .vk-partial-gallery__item,
.acf-block-preview .vk-partial-gallery__item {
	flex: 0 0 auto;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.editor-styles-wrapper .vk-partial-gallery__image,
.acf-block-preview .vk-partial-gallery__image {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	object-position: center !important;
}

.editor-styles-wrapper .vk-partial-gallery__title,
.acf-block-preview .vk-partial-gallery__title,
.editor-styles-wrapper .vk-partial-gallery h2.vk-partial-gallery__title,
.acf-block-preview .vk-partial-gallery h2.vk-partial-gallery__title {
	font-family: var(--wp--preset--font-family--din-light, inherit) !important;
	font-style: normal !important;
	font-weight: 300 !important;
	text-transform: uppercase !important;
	color: #a89494 !important;
}

.editor-styles-wrapper .vk-fullwidth__inner--full,
.acf-block-preview .vk-fullwidth__inner--full {
	max-width: 100%;
}

.editor-styles-wrapper :is(.wp-block-acf-vk-fullwidth-container, .wp-block-acf-vk-image-quote-slider, .wp-block-acf-vk-image-gallery-row, .wp-block-acf-vk-parallax, .wp-block-acf-vk-partial-gallery),
.acf-block-preview :is(.wp-block-acf-vk-fullwidth-container, .wp-block-acf-vk-image-quote-slider, .wp-block-acf-vk-image-gallery-row, .wp-block-acf-vk-parallax, .wp-block-acf-vk-partial-gallery),
.editor-styles-wrapper .acf-block-body {
	overflow: visible;
}

.editor-styles-wrapper .wp-block-acf-vk-fullwidth-container .block-editor-inner-blocks,
.editor-styles-wrapper .wp-block-acf-vk-fullwidth-container .block-editor-block-list__layout {
	overflow: visible;
}

/* Gallery row: keep frontend layout rules (JS sets --vk-igr-rendered-height). */
.editor-styles-wrapper .vk-image-gallery-row,
.block-editor-writing-flow .vk-image-gallery-row,
.acf-block-preview .vk-image-gallery-row {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
}

.editor-styles-wrapper .vk-image-gallery-row__item,
.block-editor-writing-flow .vk-image-gallery-row__item,
.acf-block-preview .vk-image-gallery-row__item {
	flex: 0 0 auto;
	min-width: 0;
}

.editor-styles-wrapper .vk-image-gallery-row__image,
.block-editor-writing-flow .vk-image-gallery-row__image,
.acf-block-preview .vk-image-gallery-row__image {
	display: block;
	width: auto;
	height: var(--vk-igr-rendered-height, var(--vk-igr-max-height));
	max-width: none;
	object-fit: initial;
}

/*
 * FAQ in editor: items are wrapped in .wp-block / .acf-block-preview,
 * so frontend sibling selectors (.vk-faq-item + .vk-faq-item) never match.
 */
.editor-styles-wrapper .vk-faq-container .block-editor-block-list__layout > .wp-block,
.editor-styles-wrapper .vk-faq-container .acf-inner-blocks-container > .wp-block,
.acf-block-preview .vk-faq-container .block-editor-block-list__layout > .wp-block,
.acf-block-preview .vk-faq-container .acf-inner-blocks-container > .wp-block {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	max-width: none !important;
}

.editor-styles-wrapper .vk-faq-container .block-editor-block-list__layout > .wp-block + .wp-block,
.editor-styles-wrapper .vk-faq-container .acf-inner-blocks-container > .wp-block + .wp-block,
.acf-block-preview .vk-faq-container .block-editor-block-list__layout > .wp-block + .wp-block,
.acf-block-preview .vk-faq-container .acf-inner-blocks-container > .wp-block + .wp-block {
	border-top: clamp(1px, 0.05vw + 0.5px, 1px) solid #695757;
	padding-top: clamp(16px, 1.5vw + 10px, 25px);
}

.editor-styles-wrapper .vk-faq-container .block-editor-block-list__layout > .wp-block:not(:last-child),
.editor-styles-wrapper .vk-faq-container .acf-inner-blocks-container > .wp-block:not(:last-child),
.acf-block-preview .vk-faq-container .block-editor-block-list__layout > .wp-block:not(:last-child),
.acf-block-preview .vk-faq-container .acf-inner-blocks-container > .wp-block:not(:last-child) {
	padding-bottom: clamp(16px, 1.5vw + 10px, 25px);
}

.editor-styles-wrapper .vk-faq-item__toggle,
.block-editor-writing-flow .vk-faq-item__toggle,
.acf-block-preview .vk-faq-item__toggle,
.editor-styles-wrapper .vk-faq-item button.vk-faq-item__toggle {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: clamp(12px, 1.5vw, 20px) !important;
	width: 100% !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	text-align: left !important;
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	line-height: inherit !important;
	text-decoration: none !important;
	cursor: pointer !important;
}

.editor-styles-wrapper .vk-faq-item__question,
.block-editor-writing-flow .vk-faq-item__question,
.acf-block-preview .vk-faq-item__question {
	flex: 1 1 auto !important;
	font-family: var(--wp--preset--font-family--din-light, inherit) !important;
	font-size: clamp(20px, 1.2vw + 16px, 24px) !important;
	font-weight: 300 !important;
	line-height: 1.3 !important;
	color: #806464 !important;
}

.editor-styles-wrapper .vk-faq-item__answer-inner,
.editor-styles-wrapper .vk-faq-item__answer-inner p,
.block-editor-writing-flow .vk-faq-item__answer-inner,
.block-editor-writing-flow .vk-faq-item__answer-inner p,
.acf-block-preview .vk-faq-item__answer-inner,
.acf-block-preview .vk-faq-item__answer-inner p {
	font-family: var(--wp--preset--font-family--din-light, inherit) !important;
	font-size: clamp(16px, 0.8vw + 14px, 18px) !important;
	font-weight: 300 !important;
	line-height: 1.3 !important;
	color: #000000 !important;
}

.editor-styles-wrapper .vk-faq-item__arrow,
.block-editor-writing-flow .vk-faq-item__arrow,
.acf-block-preview .vk-faq-item__arrow {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0 !important;
	width: clamp(28px, 2vw + 20px, 35px) !important;
	margin-right: clamp(10px, 1vw + 6px, 15px) !important;
	height: clamp(14px, 1vw + 12px, 18px) !important;
}

.editor-styles-wrapper .vk-faq-item__arrow img,
.acf-block-preview .vk-faq-item__arrow img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
}

.editor-styles-wrapper .wp-block-columns:has( > .wp-block-column.vk-column--extended-bg ),
.acf-block-preview .wp-block-columns:has( > .wp-block-column.vk-column--extended-bg ) {
	overflow: visible;
}

/*
 * Grid gallery: editor img defaults (height:auto / max-width:100%) break
 * absolute cover fill; reset item buttons and force square crop.
 */
.editor-styles-wrapper .vk-grid-gallery__grid,
.acf-block-preview .vk-grid-gallery__grid {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: clamp(10px, 10px, 10px) !important;
	width: 100% !important;
}

.editor-styles-wrapper .vk-grid-gallery__item,
.block-editor-writing-flow .vk-grid-gallery__item,
.acf-block-preview .vk-grid-gallery__item,
.editor-styles-wrapper .vk-grid-gallery button.vk-grid-gallery__item {
	position: relative !important;
	display: block !important;
	width: 100% !important;
	min-height: 0 !important;
	aspect-ratio: 1 / 1 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	overflow: hidden !important;
	cursor: pointer !important;
}

.editor-styles-wrapper .vk-grid-gallery__image,
.block-editor-writing-flow .vk-grid-gallery__image,
.acf-block-preview .vk-grid-gallery__image {
	position: absolute !important;
	inset: 0 !important;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	object-fit: cover !important;
	object-position: center !important;
}