.rpi-message {
	--rpi-message-accent: #527f00;
	--rpi-message-background: #f4f9ec;
	display: grid;
	grid-template-columns: 2rem minmax(0, 1fr);
	gap: 0.75rem;
	align-items: start;
	margin: 1.5rem 0;
	padding: 1rem 1.125rem;
	color: #17212b;
	background: var(--rpi-message-background);
	border: 1px solid #cbdac4;
	border-left: 4px solid var(--rpi-message-accent);
	border-radius: 8px;
	box-shadow: 0 4px 14px rgba(23, 33, 43, 0.08);
}

/*
 * Some legacy posts wrap the shortcode in one or more emphasis elements.
 * HTML5 parsing can reconstruct those elements inside the aside, making the
 * wrapper the only grid item and squeezing the message into the icon column.
 */
.rpi-message > em,
.rpi-message > em > em,
.rpi-message > em > em > em {
	display: contents;
}

.rpi-message__icon {
	display: grid;
	grid-column: 1;
	width: 2rem;
	height: 2rem;
	place-items: center;
	color: #ffffff;
	background: var(--rpi-message-accent);
	border-radius: 50%;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1;
}

.rpi-message__label {
	display: block;
	margin: 0 0 0.25rem;
	color: #17212b;
	font-size: 0.95rem;
	font-weight: 800;
}

.rpi-message__body {
	grid-column: 2;
	min-width: 0;
	width: 100%;
	color: #33414d;
	overflow-wrap: anywhere;
	word-break: normal;
}

.rpi-message__body > :first-child {
	margin-top: 0;
}

.rpi-message__body > :last-child {
	margin-bottom: 0;
}

.rpi-message__body a {
	color: #365d00;
	text-decoration: underline;
	text-underline-offset: 0.14em;
}

.rpi-message--important {
	--rpi-message-accent: #9c1744;
	--rpi-message-background: #fff1f5;
}

.rpi-message--warning {
	--rpi-message-accent: #8a5a00;
	--rpi-message-background: #fff8e7;
}

.rpi-message--error {
	--rpi-message-accent: #a51f1f;
	--rpi-message-background: #fff3f3;
}

@media (max-width: 575px) {
	.rpi-message {
		grid-template-columns: 1.75rem minmax(0, 1fr);
		gap: 0.625rem;
		padding: 0.875rem;
	}

	.rpi-message__icon {
		width: 1.75rem;
		height: 1.75rem;
	}
}

@media print {
	.rpi-message {
		box-shadow: none;
		break-inside: avoid;
	}
}
