/// @group o-overlay
/// @link http://registry.origami.ft.com/components/o-overlay

@import '@financial-times/o-private-foundation/main';
@import '@financial-times/o-brand/main';
@import 'src/scss/variables';
@import 'src/scss/brand';
@import 'src/scss/close';
@import 'src/scss/compact';
@import 'src/scss/full-screen';
@import 'src/scss/mixins';
@import 'src/scss/shaded';

/// Outputs all available features and styles for overlays.
///
/// @param {Map} $opts ['variants': ('compact', 'full-screen', 'heading-shaded')] - Overlay options including variants to output styles for.
/// @output The output includes the `.o-overlay` class definition as well as class definitions for every variant.
/// @example scss - All overlay styles
///   @include oOverlay();
/// @example scss - Base styles and compact variant, but with no full-screen or heading-shaded variants
///   @include oOverlay($opts: ('variants': ('compact'));
/// @access public
@mixin oOverlay(
	$opts: (
		'variants': (
			'compact',
			'full-screen',
			'heading-shaded',
		),
	)
) {
	@include oPrivateFoundation();

	$variants: map-get($opts, 'variants');

	// Include base styles
	@include _oOverlayBase();

	// Include the shaded heading variant
	@if index($variants, 'heading-shaded') {
		@include _oOverlayHeadingShaded();
	}

	// Include the compact variant
	@if index($variants, 'compact') {
		@include _oOverlayCompact();
	}

	// Include the full-screen variant
	@if index($variants, 'full-screen') {
		@include _oOverlayFullScreen();
	}
}

// If silent mode is disabled, output all of the default overlay styles.
@if ($o-overlay-is-silent == false) {
	@include oOverlay();

	// Set module to silent again
	$o-overlay-is-silent: true !global;
}
