@import "../main/global-colors";
@import "../main/variables";

main,
body &,
body & p {
	color: var(--nv-text-color);
	font-size: var(--bodyfontsize);
	line-height: var(--bodylineheight);
	letter-spacing: var(--bodyletterspacing);
	font-family: var(--bodyfontfamily);
	text-transform: var(--bodytexttransform);
	font-weight: var(--bodyfontweight);
}

.wp-block {
	// Group colors
	&.has-text-color .wp-block {
		color: inherit;
	}

	&.wp-block-group.has-background {
		padding: 0;
	}

	&.components-placeholder {
		color: initial;
	}

	&[data-align="left"] .wp-block-pullquote {
		max-width: 420px;
		text-align: left;
	}

	&[data-align="right"] .wp-block-pullquote {
		max-width: 420px;
		text-align: right;
	}
}

p {
	margin-top: 0;
	margin-bottom: $spacing-lg;
	font-family: var(--bodyfontfamily);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-bottom: $spacing-lg;
	margin-top: 0;

	&.wp-block,
	& {
		font-family: var(--headingsfontfamily, var(--bodyfontfamily));
		color: var(--headingcolor, inherit);
	}
}

$headings: [h1,h2,h3,h4,h5,h6];

@each $heading in $headings {
	#{$heading} {

		&.wp-block,
		& {
			font-size: var(--#{$heading}fontsize);
			font-weight: var(--#{$heading}fontweight);
			line-height: var(--#{$heading}lineheight);
			letter-spacing: var(--#{$heading}letterspacing);
			text-transform: var(--#{$heading}texttransform);
		}
	}
}

.editor-post-title__block .editor-post-title__input {
	color: var(--nv-text-color);
	font-size: var(--h1fontsize);
	font-weight: var(--h1fontweight);
	line-height: var(--h1lineheight);
	letter-spacing: var(--h1letterspacing);
	text-transform: var(--h1texttransform);
}

// Lists
ul,
ol {
	padding-left: $spacing-md;
	margin: $spacing-lg 0;

	li {
		margin-top: $spacing-xs;
	}
}

// === Quotes === //
.wp-block-quote {
	margin-top: $spacing-xl;
	margin-bottom: $spacing-xl;
	border: solid var(--nv-text-color);
	border-width: 0 0 0 4px;
	padding: 0 0 0 $spacing-md;


	p {
		margin-bottom: $spacing-xs;
		font-size: $text-lg;
		font-style: italic;
	}

	.wp-block-quote__citation {
		font-style: normal;
		font-size: $text-sm !important;
		font-weight: 600;
	}

	&.has-text-align-center {
		border: 0;
		padding: 0;
	}

	&.has-text-align-right {
		border-width: 0 4px 0 0;
		padding: 0 $spacing-md 0 0;
	}

	&.is-style-plain {
		border: 0;
		padding: 0;
	}
}

// === Pull Quotes === //
.wp-block-pullquote {
	margin-top: $spacing-lg;
	margin-bottom: $spacing-lg;
	border: solid var(--nv-text-color);
	border-width: 4px 0;
	padding: $spacing-lg $spacing-md;

	p {
		font-size: $text-xl !important;
	}

	blockquote {
		padding: 0;
		border: 0;
	}

	cite {
		font-style: normal;
		font-size: $text-sm !important;
		font-weight: 600;
	}

	&.is-style-solid-color {
		border: 0;
		background: var(--nv-light-bg);
	}
}

// === Verse === //
.wp-block-verse {
	font-size: $text-lg;
	background: inherit;
}

// === Tables === //
th,
td {
	border: 0;

	// Allow align inside editor but make sure cells are left-aligned default
	&:not([class*="has-text-align"]) {
		text-align: inherit;
	}
}

.wp-block-table figcaption {
	font-size: $text-sm;
}

@import "../main/tables";

// === Preformatted === //
.wp-block-preformatted {
	font-family: Courier, monospace;
}

pre:not(.CodeMirror-line) {
	display: block;
	padding: $spacing-lg;
	background: var(--nv-light-bg);
	margin: $spacing-md 0;
	white-space: pre-wrap;
	font-size: $text-sm;
	font-family: Courier, monospace;

	code {
		border: 0;
		background: transparent;
	}
}


// === Links === //
a:not(.wp-block-button__link) {
	color: var(--nv-primary-accent);

	&:hover {
		color: var(--nv-secondary-accent);
		text-decoration: none;
	}
}

// === Code === //
.wp-block-code {
	border: 0;
	border-radius: 0;
}

.tag-cloud-link {
	text-decoration: none;
}
