@use "variables";

// sass-lint:disable class-name-format no-qualifying-elements id-name-format

.post-type-ctct_forms {

	img {
		max-width: 100%;
	}

	.misc-pub-section {

		&.misc-pub-visibility,
		&.misc-pub-curtime {
			display: none;
		}
	}
}

#poststuff {
  p.cmb2-metabox-description,
  span.cmb2-metabox-description {
	color: inherit;
  }
}

body.post-type-ctct_lists .misc-pub-post-status {
	display: none;
}

body.post-type-ctct_forms #titlediv #title {
	height: 2.7em;
}

.ctct-admin-title-details {
	display: block;
	font-size: 0.6rem;
	line-height: 2;
}

#cmb2-metabox-ctct_1_optin_metabox {

	.cmb2-id--ctct-opt-in-instructions,
	.cmb2-id--ctct-opt-in {
		display: none;
	}
}

#ctct_0_list_metabox,
#ctct_1_custom_form_css_metabox,
#ctct_1_custom_input_css_metabox {

	.cmb-row {
		padding-bottom: 0;
	}
}

#ctct_0_list_metabox {
  .cmb-row {
	padding-top: 0;
  }
}

#cmb2-metabox-ctct_2_fields_metabox {

	.cmb2-id--ctct-title {
		padding: 0.8rem 0 1rem;
	}
}

#ctct_1_custom_form_css_metabox {

	.cmb2-id-form-title-title {
		padding: 0.8rem 0 1rem;
	}
}

#ctct_0_description_metabox {
	.cmb2-id--ctct-description-visibility {
		padding: 0;

		.cmb-td {
			padding: 1em 0;
		}
	}

	.cmb2-id--ctct-description-visibility,
	.cmb2-id--ctct-description-visibility .cmb-td {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}
}

#ctct_0_description_metabox,
#ctct_1_optin_metabox,
#ctct_2_fields_metabox {

	#custom_fields_group_repeat {

		.cmb-field-list .cmb-row:not(:last-of-type) {
			border-bottom: none;
			padding-bottom: 0.1em;
		}

		.required {
			padding-bottom: 0.1em;
			padding-top: 0.1em;
		}
	}

	#default_fields_group_repeat {

		.cmb-field-list {

			> .cmb-row {
				padding-top: 0.5em;

				&:not(:last-of-type)  {
					border-bottom: 1px solid variables.$color-light-gray;
					padding-bottom: 0.1rem;
				}
			}
		}
	}

	.ctct-warning {
		display: none;
		color: variables.$color-red;
		vertical-align: top;
	}
	.ctct-warning.ctct-warning-no-unqiue {
		display: inline;
	}

	.cmb-repeat-group-wrap {
		padding: 0;

		.cmb-repeatable-grouping {
			margin: 0 0 1.5rem 0;

			.cmb-row {
				margin: 0 0 0 0.3rem;
			}
		}

		.cmb-repeat-group-field {
			padding-top: 0.2em;
		}
	}

	.postbox-container .cmb-remove-field-row {
		padding-bottom: 0.8em;
		padding-top: 0.8em;
	}

	button {

		&.cmb-remove-group-row {
			display: none;
		}
	}

	.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row {
		top: 0.3rem;
	}

	h3.cmb-group-title.cmbhandle-title {
		padding-left: 1em;
	}
}

#ctct_1_optin_metabox {

	.cmb-row {
		border-bottom: none;
		padding: 0.5rem 0;
	}

	.cmb2-id--ctct-list {
		padding-bottom: 0.5em;
	}

	.cmb-th {
		width: 25%;
	}

	.cmb-th + .cmb-td {
		width: 70%;
	}
}

#ctct_1_optin_metabox,
#ctct_2_fields_metabox {
  .cmb2-metabox-title {
	font-size: 18px;
  }
}

#ctct_option_metabox_settings {

	span.cmb2-metabox-description {
		color: variables.$color-cmb-description-text;
	}
}

#cmb2-metabox-email_settings,
#cmb2-metabox-ctct_2_generated_metabox,
#cmb2-metabox-ctct_1_custom_input_css_metabox {

	.cmb-row {
		padding-bottom: 0 !important;
	}
}

#side-sortables {

	#ctct_1_custom_form_css_metabox {

		.cmb-row {
			padding: 0.5rem 0 0 0;
		}

		.cmb-th {
			padding-bottom: 0;
		}

		.cmb-type-title {
			border-bottom: none;
		}

		.cmb2-id--ctct-form-title-font-size,
		.cmb2-id--ctct-form-description-font-size {
			border-bottom: none;
			margin-bottom: 0;
		}

	}

	#ctct_1_custom_input_css_metabox {

		.cmb2-id-form-padding-title {
			border-bottom: 0;
			padding-bottom: 0;
		}

		.cmb2-id--ctct-input-margin-top,
		.cmb2-id--ctct-input-margin-right {
			margin-bottom: 0;
			margin-top: 0;
			padding-bottom: 0;
			padding-top: 0;
		}

		.cmb2-id--ctct-form-label-placement {
			margin-bottom: 0;
			padding-bottom: 0;
		}

		.cmb-type-text-small {
			border-bottom: none;
			float: left;
			width: 50%;

			.cmb-th {
				padding-bottom: 0;
			}
		}
		.cmb2-id--ctct-form-padding-top,
		.cmb2-id--ctct-form-padding-left,
		.cmb2-id--ctct-form-padding-bottom,
		.cmb2-id--ctct-form-padding-right {
			padding-top: 0;
		}
	}

	.cmb2-id--ctct-generated-shortcode {

		> .cmb-th label {
			font-weight: normal;
			font-style: italic;
		}
	}
}

.cmb2-id--ctct-list {

	.cmb2-list {
	  background: variables.$color-white linear-gradient(variables.$color-white 33%, transparent) linear-gradient(transparent, variables.$color-white 66%) radial-gradient(farthest-side at 50% 0, variables.$color-black-translucent, transparent) radial-gradient(farthest-side at 50% 100%, variables.$color-black-translucent, transparent) no-repeat local, local, scroll, scroll 0 100% 0 100%;
	  background-size: 100% 30px, 100% 30px, 100% 10px, 100% 10px;
		max-height: 10rem;
		overflow-y: auto;
	}
}

//--------------------------------------------------------------
// TinyMCE Tweaks
//--------------------------------------------------------------

.ui-dialog .cmb-type-checkbox {

	&.cmb2-id--ctct-show-title {

		.cmb-th {
			width: 90px;
		}
	}
}


[class*="version-7"] {
  .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-down-alt2,
  .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-up-alt2 {
	margin-top: .4em;
  }
}
