.textEditor {
	width: 100%;
	padding: 1em 5em 0 5em;
}

.textEditor .card {
	margin: 1.5em 0;
	border: solid 1px #333;
	border-radius: 5px;
	/* pointer-events: none; */
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;

	display: grid;
	grid-template-columns: 5em 10fr auto;
	justify-content: start;
	align-items: center;
	gap: 1em;
	overflow: hidden;
	max-width: 500px;
}

.textEditor .card.error {
	border-color: rgb(128, 0, 0);
}

.textEditor .card .image {
	background: #eee;
	position: relative;
	overflow: hidden;
	border-radius: 5px 0 0 5px;
	/* height: -webkit-fill-available; */
	align-self: stretch;
}

.textEditor .card .image img {
	position: absolute;
	inset: 0 0 0 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.textEditor .card .image::before {
	content: "";
	height: 0;
	display: block;
	padding-top: 80%;
	width: 100%;
}

.textEditor .card h3 {
	font-size: 0.9em;
	margin: 10px 0;
}

.textEditor .card.error h3 {
	color: rgb(128, 0, 0);
}

.textEditor .card h4 {
	margin-right: 1.5em;
	font-size: .65em;
	letter-spacing: .5px;
	font-weight: 600;
	text-align: right;
	text-transform: uppercase;
	color: #2da5a9;
}

.textEditor .card.error h4 {
	color: red;
}

.textEditor .contentSelection {
	padding: 10px;
	border: solid 1px #333;
	border-radius: 5px;
}

.textEditor .quote {
	display: flex;
	justify-content: flex-end;
	width: 100%;
}

.textEditor .quote .blockquote {
	width: 50%;
	padding-left: 15px;
	border-left: solid 8px #CCC;
}

.textEditor .quote .blockquote:focus {
	outline: none !important;
}

.textEditor .image {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	gap: 5px;

	width: 100%;
	padding: 5px;
}

.textEditor .image>img {
	display: block;
	width: auto;
	max-width: 100%;
}

.textEditor .image .image-link {
	width: 100%;
	padding: 5px 5px 5px 30px;
	border-width: 1px;
	border-style: solid;
	border-color: var(--shiro-color-gray7);
	border-radius: 5px;

	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24' stroke='%23666666' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M7.69998 12.6L7.67896 12.62C6.53993 13.7048 6.52012 15.5155 7.63516 16.625V16.625C8.72293 17.7073 10.4799 17.7102 11.5712 16.6314L13.0263 15.193C14.0703 14.1609 14.2141 12.525 13.3662 11.3266L13.22 11.12'%3E%3C/path%3E%3Cpath d='M16.22 11.12L16.3564 10.9805C17.2895 10.0265 17.3478 8.5207 16.4914 7.49733V7.49733C15.5691 6.39509 13.9269 6.25143 12.8271 7.17675L11.3901 8.38588C10.0935 9.47674 9.95706 11.4241 11.0888 12.6852L11.12 12.72'%3E%3C/path%3E%3C/svg%3E");
	background-position: left center;
	background-repeat: no-repeat;
	background-size: contain;
}

.textEditor .image .image-caption {
	width: 100%;
	padding: 5px;
	border-width: 1px;
	border-style: solid;
	border-color: var(--shiro-color-gray7);
	border-radius: 5px;
	text-align: center;
}

.textEditor .contentSelection {
	background: #f0f0f0;
	color: #888;
	border: 0;
}


.textEditor .quote .blockquote {
    width: 85%;
}

/* --- */

.textEditor .card.no-image {
	grid-template-columns: 10fr auto;
}

.textEditor .card.no-image .image {
	display: none;
}

.textEditor .card.no-image h3 {
	padding-left: 1em;
}

/* --- */

.textEditor .card.loading {
	min-height: 5em;
}

/* --- */

.textEditor .ce-block.indent {
	text-indent: 1rem;
}

.textEditor .ce-popover__item[data-item-name="indent"] svg {
	scale: 0.7;
}

/* --- */

.textEditor .ce-block {
	--padding-size: calc(1rem * var(--padding, 0));
	padding-left: var(--padding-size);
}

.textEditor .ce-block a{
	color: #000;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-decoration-color: currentColor;
	transition: all .15s ease-out;
}

.textEditor .ce-block a:hover{
	color: #666;
}

.textEditor .ce-popover__item[data-item-name*="padding"] svg {
	scale: 0.9;
}

/* HYPERLINK */

button[data-tool="hyperlink"] svg {
	scale: .8;
}

/* MARKER COLOR LIST */

.textEditor .ce-inline-toolbar .marker-color-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: flex-start;
	gap: 10px;
	padding: 10px;
}

.textEditor .ce-inline-toolbar .marker-color-list>* {
	flex: 0;
	height: 20px;
	aspect-ratio: 1;
}

.textEditor .ce-inline-toolbar .marker-color-list>button {
	border-width: 1px;
	border-style: solid;
	border-color: black;
	border-radius: 3px;
	background-color: var(--color, transparent);
}

.textEditor .ce-inline-toolbar .marker-color-list>button[value="transparent"]::before {
	content: 'X';
}

.textEditor .ce-inline-toolbar .marker-color-list>input[type="color"] {
	aspect-ratio: 2/1;
	cursor: pointer;
}

/* Placeholder Gallery Styles */

.textEditor .gallery {
	--gallery-gap: 10px;
	--gallery-border-radius: 3px;

	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	gap: var(--gallery-gap);

	width: 100%;
	border-width: 1px;
	border-style: dotted;
	border-color: var(--shiro-color-gray8);
	border-radius: var(--gallery-border-radius);
	padding: var(--gallery-gap);
}

.textEditor .gallery>button {
	border-width: 1px;
	border-style: solid;
	border-color: var(--shiro-color-gray8);
	border-radius: var(--gallery-border-radius);
	padding: 4px 8px;
	transition: all .15s ease-out;
}

.textEditor .gallery>button:hover {
	background-color: var(--shiro-color-gray8);
	color: white;
}

.textEditor .gallery .items {
	display: flex;
	gap: 1em;
	width: 100%;
	padding-bottom: 20px;
	overflow-x: auto;
	overflow-y: hidden;
}

.textEditor .gallery .item {
	flex: 0 0 auto;
	position: relative;
	width: 150px;
	aspect-ratio: 3/4;
	border-width: 1px;
	border-style: solid;
	border-color: var(--shiro-color-gray9);
	border-radius: var(--gallery-border-radius);
	background: var(--shiro-color-gray1);
}

.textEditor .gallery .item.error {
	border-color: red;
}

.textEditor .gallery .item.error button.remove {
	color: red;
}

.textEditor .gallery .item.drag {
	position: absolute;
}

.textEditor .gallery .item .remove {
	position: absolute;
	top: 5px;
	right: 5px;

	width: 20px;
	aspect-ratio: 1;
	border-radius: 50%;

	background: white;
}

.textEditor .gallery .item .data {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	width: 100%;
	height: 100%;
}

.textEditor .gallery .item .data .loading {
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}

.textEditor .gallery .item .data .error {
	display: flex;
	flex-direction: column;
	color: red;
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center;
}

.textEditor .gallery .item .data .error .item-id {
	margin-top: 1em;
	color: #AAA;
}

.textEditor .gallery .item .image {
	position: relative;
	width: 100%;
	aspect-ratio: 4/3;
	padding: 0;
	margin: 0;
	background: gray;
	cursor: pointer;
	user-select: none;
}

.textEditor .gallery .item .image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.textEditor .gallery .item .label {
	display: -webkit-box;
	display: -moz-box;
	display: box;
	-webkit-box-orient: vertical;
	-moz-box-orient: vertical;
	box-orient: vertical;
	-webkit-line-clamp: 3;
	-moz-line-clamp: 3;
	line-clamp: 3;
	width: calc(100% - (2 * var(--gallery-gap)));
	margin: var(--gallery-gap);
	word-break: break-all;
	text-overflow: ellipsis;
	overflow: hidden;
}

.textEditor img.inline {
	display: inline-block;
	max-width: 100%;
}

.textEditor .codex-editor .ce-block .ce-block__content {
	h1, h2, h3, h4, h5, h6 {
		&.ce-header {
			display: block;
			margin: 5px 0 !important;
			padding: 0 !important;
			height: auto !important;
			min-height: auto !important;
			line-height: auto !important;
			color: #000 !important;
			font-weight: bold !important;
			text-transform: none !important;
		}
	}
	h1.ce-header {
		font-size: 2em !important;
	}
	h2.ce-header {
		color: #222 !important;
		font-size: 1.75em !important;
	}
	h3.ce-header {
		color: #444 !important;
		font-size: 1.5em !important;
	}
	h4.ce-header {
		color: #666 !important;
		font-size: 1.25em !important;
	}
	h5.ce-header {
		color: #888 !important;
		font-size: 1em !important;
	}
	h6.ce-header {
		color: #AAA !important;
		font-size: .75em !important;
	}
}

.textEditor .codex-editor__redactor {
	padding-bottom: 5em !important;
}

/* --- */

.shiro-form-field .shiro-form-value.pop-tools {
	overflow: inherit !important;
}

/* --- */

[ popover ] {
  position: static;
}

xy-color-picker {
	position: static;
	width: unset;
}
