/*!
Newspack Nelson Editor Styles
*/

/** === Includes === */

@use "variables-style/variables-style";
@use "../../newspack-theme/sass/style-editor-base";
@use "../../newspack-theme/sass/mixins/utilities";
@use "../../newspack-theme/sass/variables-site/structure";

// Elements

h1,
h2,
h3,
h4,
.editor-post-title__block .editor-post-title__input {
	font-weight: 800;
}

blockquote {
	font-family: var(--newspack-theme-font-heading);
}

// Accent Headers

.accent-header,
.article-section-title {
	color: var(--newspack-theme-color-text-light);
	font-family: var(--newspack-theme-font-heading);
	font-size: var(--newspack-theme-font-size-xs);
	font-weight: bold;
}

.article-section-title {
	margin-bottom: structure.$size__spacing-unit;
	@include utilities.media( tablet ) {
		margin-bottom: #{1.5 * structure.$size__spacing-unit};
	}
}

.is-grid .article-section-title {
	margin-bottom: calc(20px - var(--wpnbha-col-gap, 32px));
	@include utilities.media( tablet ) {
		margin-bottom: calc(30px - var(--wpnbha-col-gap, 32px));
	}
}

.entry-meta .byline a,
.wpnbha .entry-meta .byline a {
	color: var(--newspack-theme-color-text-light);
}

// Blocks

.wp-block-newspack-blocks-homepage-articles {
	article .entry-meta {
		font-size: calc(0.7 * var(--newspack-theme-font-size-base));
	}

	&.type-scale1,
	&.type-scale2,
	&.type-scale3,
	&.type-scale4 {
		article .entry-meta {
			font-size: calc(0.6 * var(--newspack-theme-font-size-base));
		}
	}
}

//! Newspack Article Carousel
.wp-block-newspack-blocks-carousel {
	.entry-meta .byline a {
		color: inherit;
	}
}

.has-drop-cap:not(:focus)::first-letter {
	color: var(--newspack-theme-color-secondary-against-white);
	font-family: var(--newspack-theme-font-heading);
	font-weight: 800;
}

.wp-block-group.is-style-border {
	border-color: currentcolor;
}

.wp-block-pullquote {
	border-width: 16px 0 4px;
	font-weight: bold;

	blockquote {
		margin: #{2 * structure.$size__spacing-unit} 0;
	}

	&.is-style-solid-color blockquote p,
	blockquote p {
		font-size: var(--newspack-theme-font-size-lg);

		@include utilities.media( tablet ) {
			font-size: var(--newspack-theme-font-size-xl);
		}
	}

	p {
		font-style: normal;
	}

	em {
		font-style: italic;
	}

	.wp-block-pullquote__citation {
		font-weight: bold;
		letter-spacing: 0.05em;
		opacity: 0.9;
		text-transform: uppercase;
	}
}

[data-align="left"] .wp-block-pullquote,
[data-align="right"] .wp-block-pullquote {
	border-width: 0;
	position: relative;

	blockquote {
		margin-top: #{1.5 * structure.$size__spacing-unit};
		margin-bottom: #{1.5 * structure.$size__spacing-unit};
	}

	@include utilities.media( tablet ) {
		&.is-style-solid-color blockquote p,
		blockquote p {
			font-size: var(--newspack-theme-font-size-lg);
		}
	}

	&::before {
		border-color: inherit;
		border-width: 10px 0 0;
		border-style: solid;
		content: "";
		display: block;
		width: 75%;
	}

	&.is-style-solid-color::before,
	&[style*="border-width"]::before {
		display: none;
	}
}

.wp-block-separator {
	&:not(.is-style-dots) {
		border-top: 2px solid var(--newspack-theme-color-text-main);

		&.has-background {
			border-top-color: currentcolor;
		}
	}

	&:not(.is-style-dots):not(.is-style-wide) {
		border-top: 5px solid var(--newspack-theme-color-text-main);

		&.has-background {
			border-top-color: currentcolor;
		}
	}

	&.is-style-dots::before {
		color: var(--newspack-theme-color-text-main);
	}
}
