@use "@wordpress/base-styles/variables" as *;

.wp-block-pullquote {
	text-align: center; // Default text-alignment where the `textAlign` attribute value isn't specified.
	overflow-wrap: break-word; // Break long strings of text without spaces so they don't overflow the block.
	box-sizing: border-box;
	margin: 0 0 1em 0;
	padding: 4em 0;

	p,
	blockquote {
		color: inherit;
	}

	blockquote {
		margin: 0;
	}

	p {
		margin-top: 0;

		&:last-child {
			margin-bottom: 0;
		}
	}

	&.alignleft,
	&.alignright {
		max-width: $content-width * 0.5;
	}

	cite,
	footer {
		position: relative;
	}
	.has-text-color a {
		color: inherit;
	}
}

// Ensure that we are reasonably specific to override theme defaults.
.wp-block-pullquote.has-text-align-left blockquote {
	text-align: left;
}

// Ensure that we are reasonably specific to override theme defaults.
.wp-block-pullquote.has-text-align-right blockquote {
	text-align: right;
}
// Ensure that we are reasonably specific to override theme defaults.
.wp-block-pullquote.has-text-align-center blockquote {
	text-align: center;
}

// .is-style-solid-color is deprecated.
// This selector has not been scoped with `:root :where`, as global styles
// does, to keep its specificity as it was at the time of deprecation.
.wp-block-pullquote.is-style-solid-color {
	border: none;
	blockquote {
		margin-left: auto;
		margin-right: auto;
		max-width: 60%;

		p {
			margin-top: 0;
			margin-bottom: 0;
			font-size: 2em;
		}

		cite {
			text-transform: none;
			font-style: normal;
		}
	}
}

.wp-block-pullquote :where(cite) {
	color: inherit;
	display: block;
}
