// Base
@import "base/_variables.scss";
@import "base/_mixins.scss";


/* Editor Styles
-------------------------------------------------------*/
.wp-block,
.edit-post-visual-editor .block-editor-block-list__block .wp-block[data-align=full],
.edit-post-visual-editor .block-editor-block-list__block .wp-block[data-align=wide] {
	max-width: 734px;
}

.everse-left-sidebar,
.everse-right-sidebar {
	.edit-post-visual-editor .block-editor-block-list__block .wp-block[data-align=full],
	.edit-post-visual-editor .block-editor-block-list__layout.is-root-container > .wp-block[data-align=full] {
		margin-left: auto;
		margin-right: auto;
	}

	.wp-block,
	.edit-post-visual-editor .block-editor-block-list__block .wp-block[data-align=full],
	.edit-post-visual-editor .block-editor-block-list__block .wp-block[data-align=wide] {
		max-width: 734px;
	}
}

// Fullwidth layout / Wide Images
.everse-fullwidth {
	.wp-block {
		max-width: 1100px;
	}

	.edit-post-visual-editor .wp-block[data-align=wide] {
		max-width: 1340px;
	}

	.edit-post-visual-editor .wp-block[data-align=full] {
		max-width: none;
	}
}


// Alignment
@include bp-sm-up {
	.wp-block[data-align=left] .block-editor-block-list__block ,
	.wp-block[data-align=right] .block-editor-block-list__block {
		max-width: 40%;
	}
}

@include bp-sm-down {
	.wp-block[data-align=left] .block-editor-block-list__block {
		float: none;
		margin-right: 0;
	}

	.wp-block[data-align=right] .block-editor-block-list__block {
		float: none;
		margin-left: 0;
	}

	.wp-block-gallery.alignleft,
	.wp-block-gallery.alignright {
		max-width: 100%;
	}
}


/* Typography
-------------------------------------------------------*/
.edit-post-visual-editor a,
.editor-rich-text__tinymce a {
	color: $post-link-color;
}

.editor-rich-text__tinymce a {
	text-decoration: none;
}

.editor-styles-wrapper.edit-post-visual-editor {
	font-family: $body-font;
	font-size: 1.125rem;
	color: $text-color;
}

.edit-post-visual-editor p,
.edit-post-visual-editor,
.blocks-rich-text__tinymce.mce-content-body {
	font-size: inherit;
}


/* Headings
-------------------------------------------------------*/
.edit-post-visual-editor .editor-post-title__block .editor-post-title__input,
.edit-post-visual-editor h1.wp-block[data-type="core/heading"],
.edit-post-visual-editor h2.wp-block[data-type="core/heading"],
.edit-post-visual-editor h3.wp-block[data-type="core/heading"],
.edit-post-visual-editor h4.wp-block[data-type="core/heading"],
.edit-post-visual-editor h5.wp-block[data-type="core/heading"],
.edit-post-visual-editor h6.wp-block[data-type="core/heading"] {
	font-family: $heading-font;
	color: $heading-color;
	font-weight: 700;
}

.editor-post-title__block .editor-post-title__input {
	font-size: 2.25rem;
	
	@include bp-lg-up {
		font-size: 2.625rem;
	}
}

.edit-post-visual-editor h1.wp-block[data-type="core/heading"] { font-size: $h1-size; }
.edit-post-visual-editor h2.wp-block[data-type="core/heading"] { font-size: $h2-size; }
.edit-post-visual-editor h3.wp-block[data-type="core/heading"] { font-size: $h3-size; }
.edit-post-visual-editor h4.wp-block[data-type="core/heading"] { font-size: $h4-size; }
.edit-post-visual-editor h5.wp-block[data-type="core/heading"] { font-size: $h5-size; }
.edit-post-visual-editor h6.wp-block[data-type="core/heading"] { font-size: $h6-size; }

@include bp-sm-down {
  .edit-post-visual-editor h1.wp-block[data-type="core/heading"] { font-size: $h1-size--sm-down !important; }
  .edit-post-visual-editor h2.wp-block[data-type="core/heading"] { font-size: $h2-size--sm-down !important; }
  .edit-post-visual-editor h3.wp-block[data-type="core/heading"] { font-size: $h3-size--sm-down !important; }
  .edit-post-visual-editor h4.wp-block[data-type="core/heading"] { font-size: $h4-size--sm-down !important; }
}


/* Lists
-------------------------------------------------------*/
dd, li {
	margin-bottom: 0;
}

.edit-post-visual-editor .wp-block[data-type="core/list"] ol,
.edit-post-visual-editor .wp-block[data-type="core/list"] ul {
	margin-left: 0;
	padding-left: 1.2em;
}


/* Separators
-------------------------------------------------------*/
.wp-block-separator {
	border-bottom: 1px solid $border-color;
}

.wp-block-separator.is-style-dots:before {
	font-weight: 700;
}

.wp-block-separator.is-style-dots:before {
	color: $text-color;
}


/* Tables
-------------------------------------------------------*/
.edit-post-visual-editor {
	table {
		border-spacing: 0;
	}

	td,
	th {
		border-color: $border-color;
	}

	th {
		text-align: left;
	}

	.wp-block-table__cell-content {
		padding: 10px;
	}
}


/* Cover Image
-------------------------------------------------------*/
.wp-block-cover .wp-block-cover-text {
	font-size: 2em;
}

[data-align=left] .wp-block-cover,
[data-align=left] .wp-block-cover-image,
[data-align=right] .wp-block-cover,
[data-align=right] .wp-block-cover-image {
	max-width: 100%;
}

.editor-styles-wrapper .wp-block[data-type="core/cover"][data-align="left"] .is-block-content,
.editor-styles-wrapper .wp-block[data-type="core/cover"][data-align="right"] .is-block-content {
	min-width: 40%;
	margin-bottom: 1.5em;
}


/* Captions
-------------------------------------------------------*/
.wp-block-image figcaption,
.wp-block-embed figcaption,
.wp-block-audio figcaption {
	color: $meta-color;
}


/* Blockquotes
-------------------------------------------------------*/
blockquote {
	margin: 0;
	overflow: hidden;
}

.edit-post-visual-editor {

	.wp-block-quote {
		padding: 12px 40px;
		border-left: 3px solid $primary-color;	

		&[style*="text-align: left"] {
			border-left: 3px solid $primary-color;
		}

		&[style*="text-align: center"] {
			border: 0;
		}

		&[style*="text-align: right"] {
			border-right: 3px solid $primary-color;
			border-left: 0;
		}
	}	

	.wp-block-quote p {
		font-style: italic;
		color: $heading-color;
		line-height: 1.6;
		font-size: 1.5rem;
		margin-bottom: 5px;
	}

	.wp-block-quote__citation {
		font-size: 0.875rem;
		font-style: normal;
		color: $meta-color;
	}

	// Large
	.wp-block-quote.is-large p,
	.wp-block-quote.is-style-large p {
		font-size: 2rem;
	}

	.wp-block-quote.is-style-large .wp-block-quote__citation,
	.wp-block-quote.is-large .wp-block-quote__citation {
		font-size: 1rem;
	}

}


/* Pullquotes
-------------------------------------------------------*/
.wp-block-pullquote {
	position: relative;
	border: 0;
	text-align: left;
	color: $heading-color;
	margin-top: 0;
	padding: .2em 1em .2em 2.5em;

	blockquote p {
		margin-bottom: 0;
		font-style: italic;
	}	

	&::before {
		content: '“';
		color: $primary-color;
		left: 0;
		top: 0;
		position: absolute;
		font-size: 5rem;
		line-height: 1;
	}

	.wp-block-pullquote__citation {
		text-transform: none;
		opacity: 0.7;
		font-style: normal;
		font-size: 0.875rem;
		margin-top: 1em;
	}

	blockquote:not(.has-text-color) .wp-block-pullquote__citation {
		color: $text-color;
	}
} 


/* Buttons
-------------------------------------------------------*/
.wp-block-button .wp-block-button__link {
	@include editor-button;
}

.wp-block-button__link:not(.has-background),
.wp-block-button__link:not(.has-background):active,
.wp-block-button__link:not(.has-background):focus,
.wp-block-button__link:not(.has-background):hover {
	background-color: $primary-color;
}

.wp-block-button.is-style-squared .wp-block-button__link {
	border-radius: 0;
}

.is-style-outline {
	color: $primary-color;
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background-color: transparent;
}


/* Latest Posts / Categories / Comments
-------------------------------------------------------*/
.edit-post-visual-editor .wp-block-categories ul,
.edit-post-visual-editor ul.wp-block-archives {
	padding-left: 18px;
	margin-left: 0;
}

.edit-post-visual-editor .wp-block-latest-posts {
	margin-left: 0;
	padding-left: 0;

	li {
		margin-bottom: 24px;
	}

	a {
		display: inline-block;
		line-height: 1.3;
	}
}


/* Preformatted / Verse
-------------------------------------------------------*/
.wp-block-code,
.wp-block-preformatted pre,
.wp-block-verse {
	font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 1em;
	margin-top: 0;
	margin-bottom: 1rem;
	overflow: auto;
	color: inherit;
}

.wp-block-verse pre,
pre.wp-block-verse {
	color: inherit;
	padding: 0;
}