// =================================================================
// Intro Paragraph Styles - Configurable
// =================================================================
//
//
// Styles in this file should only be using properties that are
// in the global array ($blocks-defaults) so they can be overwritten by
// the child theme
// Examples: color, border-color, font-family
//
// Variant styles, such as "open", or an alternate layout should be declared here
// as shown below IF that variant needs to modify one of the properties that
// can be overwritten via the array. This lets the child theme overwrite that
// as well.
//
// If you aren't using styles from the global array ($blocks-defaults) by
// using blocks-get() it doesn't belong in this file as it will be printed
// in the stylesheet multiple times (for each publication)
//

$blocks-block-editorial-introparagraph-config: ();

// use the above array if you need to override the global $blocks-defaults array
// of styles ONLY for this block IN the plugin.
// You can then override THIS array by using $blocks-block-editorial-introparagraph-theme in the child theme to
// override this array
//
// Remember, with great power comes great responsibility. This should not be used unless
// you really need it. Think carefully about why you aren't modifying the global config by adding
// a different variable.
//
// $blocks-block-editorial-introparagraph-config: (
// 		primary-color:red,
// 		secondary-color: rebeccapurple,
// );


// Use the default Blocks configuration. You can override this globally
// in a theme.

$blocks-block-editorial-introparagraph-config: map-merge( $blocks-block-editorial-introparagraph-config, $blocks-config );

// This allows themes to optionally set theme options for this
// block only. You can set all or a few options - only the options
// you set in $block-block-editorial-introparagraph-theme will override the defaults.

@if variable-exists( blocks-block-editorial-introparagraph-theme ) {
	$blocks-block-editorial-introparagraph-config: map_merge( $blocks-block-editorial-introparagraph-config, $blocks-block-editorial-introparagraph-theme );
}

// A global helper variable for the block-get mixin.

$current-map: $blocks-block-editorial-introparagraph-config;


$scope: blocks-get( 'scope' );

.#{$scope}-block-editorial-introparagraph {
	&.is-style-large {
		p,
		.wp-block-editorial-introparagraph-content {
			color: blocks-get( 'font-color-heading-small');
			font-family: blocks-get( 'font-family-secondary');
		}
	}

	&.has-paragraph-color-primary {
		p,
		.wp-block-editorial-introparagraph-content {
			color: blocks-get( 'color-primary-text');
		}
	}

	&.has-paragraph-color-secondary {
		p,
		.wp-block-editorial-introparagraph-content {
			color: blocks-get( 'color-secondary-text');
		}
	}

	&.has-paragraph-color-tertiary {
		p,
		.wp-block-editorial-introparagraph-content {
			color: blocks-get( 'color-tertiary-text');
		}
	}

	&.has-paragraph-color-quaternary {
		p,
		.wp-block-editorial-introparagraph-content {
			color: blocks-get( 'color-quaternary-text');
		}
	}

	&.has-dropcap {
		.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
		.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
		p:first-of-type:first-letter,
		svg text {
			font-family: blocks-get( 'font-family-secondary');
		}
	}

	&.has-dropcap-color-primary {
		.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
		.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
		p:first-of-type:first-letter {
			color: blocks-get( 'color-primary-text');
		}
	}

	&.has-dropcap-color-secondary {
		.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
		.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
		p:first-of-type:first-letter {
			color: blocks-get( 'color-secondary-text');
		}
	}

	&.has-dropcap-color-tertiary {
		.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
		.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
		p:first-of-type:first-letter {
			color: blocks-get( 'color-tertiary-text');
		}
	}

	&.has-dropcap-color-quaternary {
		.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
		.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
		p:first-of-type:first-letter {
			color: blocks-get( 'color-quaternary-text');
		}
	}

	&.is-style-dropcap-dimensional {
		&.has-dropcap-color-primary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-primary');
			}
		}

		&.has-dropcap-color-secondary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-secondary');
			}
		}

		&.has-dropcap-color-tertiary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-tertiary');
			}
		}

		&.has-dropcap-color-quaternary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-quaternary');
			}
		}

		.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
		.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
		p:first-of-type:first-letter {
			text-shadow:	1px 1px blocks-get( 'color-gray-e'),
							2px 2px blocks-get( 'color-gray-e'),
							3px 3px blocks-get( 'color-gray-e'),
							4px 4px blocks-get( 'color-gray-e'),
							5px 5px blocks-get( 'color-gray-e'),
							6px 6px blocks-get( 'color-gray-e'),
							7px 7px blocks-get( 'color-gray-e'),
							8px 8px blocks-get( 'color-gray-e'),
							9px 9px blocks-get( 'color-gray-e'),
							10px 10px blocks-get( 'color-gray-e');
		}
	}

	&.is-style-dropcap-boxed {
		.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
		.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
		p:first-of-type:first-letter {
			color: blocks-get( 'color-page');
			background-color: blocks-get( 'font-color-heading');
		}

		&.has-dropcap-color-primary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-page');
				background-color: blocks-get( 'color-primary');
			}
		}

		&.has-dropcap-color-secondary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-page');
				background-color: blocks-get( 'color-secondary');
			}
		}

		&.has-dropcap-color-tertiary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-page');
				background-color: blocks-get( 'color-tertiary');
			}
		}

		&.has-dropcap-color-quaternary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-page');
				background-color: blocks-get( 'color-quaternary');
			}
		}
	}

	&.is-style-dropcap-image {
		.has-dropcap-color-primary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-primary');
			}
		}

		.has-dropcap-color-secondary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-secondary');
			}
		}

		.has-dropcap-color-tertiary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-tertiary');
			}
		}

		.has-dropcap-color-quaternary {
			.wp-block-editorial-introparagraph-content .editor-rich-text:not(:focus):first-letter,
			.wp-block-editorial-introparagraph-content .rich-text:not(:focus):first-letter,
			p:first-of-type:first-letter {
				color: blocks-get( 'color-quaternary');
			}
		}
	}
}

