@import "../../../css/less/general.less";

@import "module-style.less";


.editor-styles-wrapper {
	.gutenberg_styles();
	
	.wp-block .mce-content-body {
		line-height:inherit;
	}
	
	.editor-block-list__layout {
		> .editor-block-list__block {
			&[data-type="core/cover"],
			&[data-type="core/gallery"] {
				> .editor-block-list__block-edit {
					margin-top:0;
					margin-bottom:0;
				}
				
				.editor-block-list__block[data-type="core/paragraph"] {
					padding:0;
				}
			}
			
			&[data-type="core/paragraph"] {
				> .editor-block-list__block-edit {
					margin-top:0;
				}
			}
			
			&[data-type="core/image"][data-align="left"],
			&[data-type="core/image"][data-align="right"] {
				> .editor-block-list__block-edit {
					margin-top:0;
					margin-bottom:20px;
				}
			}
		}
		
		.wp-block-button {
			margin:0;
		}
	}
	
	.wp-block {
		max-width:@cont_width_def;
		
		&[data-align="full"] {
			body:not(.enable_sidebar) & {
				margin:0 auto;
				
				> .editor-block-list__block-edit {
					margin-left:-28px;
					margin-right:-28px;
				}
			}
		}
		
		&[data-type="core/separator"] {
			margin:44px auto;
			.cl;

			hr.wp-block-separator {
				margin-top: 0;
				margin-bottom: 0;
			}
		}
		
		&[data-type="core/columns"] {
			padding-top:1px;
			padding-bottom:1px;
		}
		
		@media @monitor_large {
			max-width:@cont_width_large;
		}
		
		@media @monitor_tablet {
			max-width:@cont_width_full;
		}
	}
	
	@media @monitor_tablet_600 {
		padding-left:@blocks_hor_pad - 14px;
		padding-right:@blocks_hor_pad - 14px;
	}
	
	.enable_sidebar & {
		.wp-block {
			max-width:@cont_width_def * (@content_width / 100);
			
			&[data-align="full"] {
				margin-left:auto;
				margin-right:auto;
				
				> .editor-block-list__block-edit {
					margin-left:-28px;
					margin-right:-28px;
					
					@media @monitor_tablet_600 {
						margin-left:0;
						margin-right:0;
					}
					
					&:before {
						left:-14px;
						right:-14px;
					}
				}
			}
			
			@media @monitor_large {
				max-width:@cont_width_large * (@content_width / 100);
			}
			
			@media @monitor_tablet {
				max-width:@cont_width_full;
			}
		}
	}
	
	
	/** === Change margin for gutenberg block === */
	.editor-block-list__layout {
		.editor-default-block-appender > .editor-default-block-appender__content,
		> .editor-block-list__block > .editor-block-list__block-edit,
		> .editor-block-list__layout > .editor-block-list__block > .editor-block-list__block-edit {
			margin-top:@line_height_pad;
			margin-bottom:@line_height_pad;
			
			&:before {
				top:-8px;
				bottom:-8px;
			}
		}
		
		.block-library-classic__toolbar {
			transform:translateY(-8px);
			
			@media @monitor_tablet_600 {
				padding:0;
			}
		}
		
		.editor-block-list__block {
			.editor-block-contextual-toolbar {
				transform:translateY(-46px);
				
				@media @monitor_tablet_600 {
					transform:none;
				}
			}
			
			&[data-type="core/freeform"] {
				.editor-block-contextual-toolbar {
					transform:translateY(-7px);
					
					@media @monitor_tablet_600 {
						transform:none;
					}
				}
			}
			
			&[data-align=left],
			&[data-align=right] {
				.editor-block-contextual-toolbar {
					transform:translateY(-9px);
				}
			}
		}
	}
	
	.wp-block-columns {
		> .editor-inner-blocks {
			> .editor-block-list__layout {
				> [data-type="core/column"] {
					> .editor-block-list__block-edit {
						&:before {
							top:-8px;
							bottom:-8px;
						}
					}
				}
			}
		}
	}
	
	.wp-block-columns {
		> .editor-inner-blocks {
			> .editor-block-list__layout {
				> [data-type="core/column"] {
					> .editor-block-list__block-edit {
						> div {
							> .editor-inner-blocks {
								margin-top:-20px;
								margin-bottom:-20px;
							}
						}
					}
				}
			}
		}
	}

	.block-editor-block-list__block[data-type="core/button"] {
		display: block;
	}

	.block-editor-block-list__block[data-type="core/buttons"] {
		.block-editor-block-list__block[data-type="core/button"] {
			margin-top: 0;
			margin-bottom: 0;
		}
	}

	.wp-block-search .wp-block-search__button {
		pointer-events: none;
	}

	.wp-block-code .block-editor-plain-text {
		background-color: inherit;
		color: inherit;
		font-family: inherit;
		font-size: inherit;
		line-height: inherit;
		font-weight: inherit;
		font-style: inherit;
		letter-spacing: inherit;
		display: block;
	}
}

