.artek-history-image-text {
	margin: 1.5rem 0;
	max-width: min(100%, var(--artek-content-width, 1464px));
	overflow: visible;
}

.artek-history-image-text__grid {
	display: grid;
	grid-template-columns:
		minmax(0, var(--artek-history-image-text-image, 50%))
		minmax(0, var(--artek-history-image-text-text, 50%));
	column-gap: var(--artek-history-image-text-gap, 3rem);
	align-items: start;
}

.artek-history-image-text--image-right .artek-history-image-text__media {
	order: 2;
}

.artek-history-image-text--image-right .artek-history-image-text__text {
	order: 1;
}

.artek-history-image-text__media {
	min-width: 0;
	/* Breathing room so rotated Polaroid corners clear page overflow-x:clip. */
	padding: 1rem 1.5rem 1.75rem;
	box-sizing: border-box;
	overflow: visible;
	perspective: 900px;
	perspective-origin: 50% 40%;
}

.artek-history-image-text__media .artek-polaroid__card {
	width: 100%;
	max-width: 100%;
	/* Match history-images mobile: keep captions and tilt from being clipped by the card box. */
	overflow: visible;
}

.artek-history-image-text__text {
	min-width: 0;
	overflow-wrap: break-word;
	text-align: justify;
}

.artek-history-image-text__text > :first-child {
	margin-top: 0;
}

.artek-history-image-text__text > :last-child {
	margin-bottom: 0;
}

.artek-history-image-text__text p {
	margin: 0 0 1em;
}

.artek-history-image-text__text h1,
.artek-history-image-text__text h2,
.artek-history-image-text__text h3,
.artek-history-image-text__text h4,
.artek-history-image-text__text h5,
.artek-history-image-text__text h6 {
	margin: 1.25em 0 0.5em;
	line-height: 1.3;
}

.artek-history-image-text__text ul,
.artek-history-image-text__text ol {
	margin: 0 0 1em;
	padding-left: 1.5em;
}

.artek-history-image-text__text a {
	text-decoration: underline;
}

.artek-history-image-text__text img {
	display: block;
	max-width: 100%;
	height: auto;
}

.artek-history-image-text-editor-canvas .artek-history-image-text__grid {
	width: 100%;
}

.artek-history-image-text-editor__polaroid-btn {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	text-align: left;
}

.artek-history-image-text-editor__polaroid-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 4px;
}

.artek-history-image-text-editor__polaroid-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	min-height: 12rem;
	padding: 1rem;
	color: #646970;
	font-size: 0.875rem;
	line-height: 1.4;
	text-align: center;
	background: #f6f7f7;
}

.artek-history-image-text-editor__text {
	text-align: left;
}

.artek-history-image-text-editor__text-preview {
	text-align: justify;
}

.artek-history-image-text-editor__text-preview > :first-child {
	margin-top: 0;
}

.artek-history-image-text-editor__text-preview > :last-child {
	margin-bottom: 0;
}

.artek-history-image-text-editor__text textarea,
.artek-history-image-text-editor__text .mce-tinymce,
.artek-history-image-text-editor__text .wp-editor-wrap {
	width: 100% !important;
	max-width: 100%;
}

.artek-history-image-text-editor__text textarea {
	min-height: 16rem;
	box-sizing: border-box;
}

.artek-history-image-text-editor__help {
	margin: 0;
	color: #646970;
	font-size: 12px;
	line-height: 1.4;
}

.artek-history-image-text-editor__sidebar-media {
	margin-bottom: 0.25rem;
}

.artek-history-image-text-editor__sidebar-thumb {
	display: block;
	width: 100%;
	max-width: 180px;
	height: auto;
	border-radius: 4px;
}

.artek-history-image-text-editor__placeholder {
	padding: 1rem;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	text-align: center;
	color: #646970;
	background: #f6f7f7;
	font-size: 12px;
}

@media (max-width: 419px) {
	.artek-history-image-text__grid {
		grid-template-columns: minmax(0, 1fr);
		row-gap: var(--artek-history-image-text-gap, 3rem);
		column-gap: 0;
	}

	.artek-history-image-text--image-right .artek-history-image-text__media,
	.artek-history-image-text--image-right .artek-history-image-text__text {
		order: initial;
	}

	.artek-history-image-text__media,
	.artek-history-image-text__text {
		width: 100%;
	}

	.artek-history-image-text__media .artek-polaroid__card {
		--artek-polaroid-transform: rotate(0deg);

		transform-origin: center center;
	}

	.artek-history-image-text__text {
		text-align: inherit;
	}
}
