/*!
 * Copyright 2024 Adobe. All rights reserved.
 *
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at <http://www.apache.org/licenses/LICENSE-2.0>
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

@media (forced-colors: active) {
	.spectrum-IllustratedMessage {
		--highcontrast-illustrated-message-illustration-color: CanvasText;
		--highcontrast-illustrated-message-illustration-accent-color: Highlight;
	}
}

.spectrum-IllustratedMessage {
	/* Size & Spacing */
	--spectrum-illustrated-message-description-max-inline-size: var(--spectrum-illustrated-message-maximum-width);
	--spectrum-illustrated-message-heading-max-inline-size: var(--spectrum-illustrated-message-maximum-width);
	--spectrum-illustrated-message-title-to-heading: var(--spectrum-spacing-400);
	--spectrum-illustrated-message-heading-to-description: var(--spectrum-spacing-75);

	/* Illustration */
	--spectrum-illustrated-message-illustration-color: var(--spectrum-neutral-visual-color);
	--spectrum-illustrated-message-illustration-accent-color: var(--spectrum-accent-visual-color);

	/* Title */
	--spectrum-illustrated-message-title-font-family: var(--spectrum-sans-font-family-stack);
	--spectrum-illustrated-message-title-font-weight: var(--spectrum-heading-sans-serif-font-weight);
	--spectrum-illustrated-message-title-font-style: var(--spectrum-heading-sans-serif-font-style);
	--spectrum-illustrated-message-title-font-size: var(--spectrum-illustrated-message-title-size);
	--spectrum-illustrated-message-title-line-height: var(--spectrum-heading-line-height);
	--spectrum-illustrated-message-title-color: var(--spectrum-heading-color);

	/* Description */
	--spectrum-illustrated-message-description-font-family: var(--spectrum-sans-font-family-stack);
	--spectrum-illustrated-message-description-font-weight: var(--spectrum-body-sans-serif-font-weight);
	--spectrum-illustrated-message-description-font-style: var(--spectrum-body-sans-serif-font-style);
	--spectrum-illustrated-message-description-font-size: var(--spectrum-illustrated-message-body-size);
	--spectrum-illustrated-message-description-line-height: var(--spectrum-body-line-height);
	--spectrum-illustrated-message-description-color: var(--spectrum-body-color);

	block-size: 100%;

	display: var(--mod-illustrated-message-display, flex);
	flex-direction: column;
	align-items: center;
	justify-content: center;

	text-align: center;
	pointer-events: var(--mod-illustrated-message-pointer-events, auto);
	max-inline-size: var(--mod-illustrated-message-content-maximum-width);

	/* CJK (Chinese, Japanese, and Korean) language support */
	&:lang(ja),
	&:lang(zh),
	&:lang(ko) {
		--spectrum-illustrated-message-title-font-size: var(--spectrum-illustrated-message-cjk-title-size);
	}
}

.spectrum-IllustratedMessage-illustration {
	margin-block-end: var(--mod-illustrated-message-title-to-heading, var(--spectrum-illustrated-message-title-to-heading));
	color: var(--highcontrast-illustrated-message-illustration-color, var(--mod-illustrated-message-illustration-color, var(--spectrum-illustrated-message-illustration-color)));
	fill: currentColor;
	stroke: currentColor;
}

.spectrum-IllustratedMessage-accent {
	color: var(--highcontrast-illustrated-message-illustration-accent-color, var(--mod-illustrated-message-illustration-accent-color, var(--spectrum-illustrated-message-illustration-accent-color)));

	/* Safari 16.3 🐛🛠️: Repeated stroke/fill properties is a workaround for a currentcolor bug that was fixed in 16.4. */
	fill: currentColor;
	stroke: currentColor;
}

.spectrum-IllustratedMessage-heading {
	font-family: var(--mod-illustrated-message-title-font-family, var(--spectrum-illustrated-message-title-font-family));
	font-weight: var(--mod-illustrated-message-title-font-weight, var(--spectrum-illustrated-message-title-font-weight));
	font-style: var(--mod-illustrated-message-title-font-style, var(--spectrum-illustrated-message-title-font-style));
	font-size: var(--mod-illustrated-message-title-font-size, var(--spectrum-illustrated-message-title-font-size));
	line-height: var(--mod-illustrated-message-title-line-height, var(--spectrum-illustrated-message-title-line-height));

	color: var(--mod-illustrated-message-title-color, var(--spectrum-illustrated-message-title-color));

	max-inline-size: var(--mod-illustrated-message-heading-max-inline-size, var(--spectrum-illustrated-message-heading-max-inline-size));
	margin-block-start: 0;
	margin-block-end: var(--mod-illustrated-message-heading-to-body, 0);
}

.spectrum-IllustratedMessage-description {
	position: var(--mod-illustrated-message-description-position);
	z-index: var(--mod-illustrated-message-description-z-index);
	pointer-events: var(--mod-illustrated-message-description-pointer-events, auto);

	font-family: var(--mod-illustrated-message-description-font-family, var(--spectrum-illustrated-message-description-font-family));
	font-weight: var(--mod-illustrated-message-description-font-weight, var(--spectrum-illustrated-message-description-font-weight));
	font-style: var(--mod-illustrated-message-description-font-style, var(--spectrum-illustrated-message-description-font-style));
	font-size: var(--mod-illustrated-message-description-font-size, var(--spectrum-illustrated-message-description-font-size));
	line-height: var(--mod-illustrated-message-description-line-height, var(--spectrum-illustrated-message-description-line-height));

	color: var(--mod-illustrated-message-description-color, var(--spectrum-illustrated-message-description-color));

	max-inline-size: var(--mod-illustrated-message-description-max-inline-size, var(--spectrum-illustrated-message-description-max-inline-size));
	margin-block-start: var(--mod-illustrated-message-heading-to-description, var(--spectrum-illustrated-message-heading-to-description));
	margin-block-end: 0;
}
