/*!
 * 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.
 */

@import "./themes/spectrum-two.css";

/* windows high contrast mode */
@media (forced-colors: active) {
	.spectrum-Divider {
		--highcontrast-divider-background-color: CanvasText;
	}
}

.spectrum-Divider {
	--spectrum-divider-thickness: var(--spectrum-divider-thickness-medium);
}

.spectrum-Divider--sizeS {
	--spectrum-divider-thickness: var(--spectrum-divider-thickness-small);
}

.spectrum-Divider--sizeL {
	--spectrum-divider-thickness: var(--spectrum-divider-thickness-large);
	--spectrum-divider-background-color: var(--spectrum-gray-800);
}

/* static white variant colors */
.spectrum-Divider--staticWhite {
	/** @deprecated --mod-divider-background-color-medium-static-white, use --mod-divider-background-color instead */
	--mod-divider-background-color: var(--mod-divider-background-color-medium-static-white, var(--spectrum-divider-background-color-static-white));

	&.spectrum-Divider--sizeS {
		/** @deprecated --mod-divider-background-color-small-static-white, use --mod-divider-background-color instead */
		--mod-divider-background-color: var(--mod-divider-background-color-small-static-white, var(--spectrum-divider-background-color-static-white));
	}

	&.spectrum-Divider--sizeL {
		/** @deprecated --mod-divider-background-color-large-static-white, use --mod-divider-background-color instead */
		--mod-divider-background-color: var(--mod-divider-background-color-large-static-white, var(--spectrum-transparent-white-800));
	}
}

/* static black variant colors */
.spectrum-Divider--staticBlack {
	/** @deprecated --mod-divider-background-color-medium-static-black, use --mod-divider-background-color instead */
	--mod-divider-background-color: var(--mod-divider-background-color-medium-static-black, var(--spectrum-divider-background-color-static-black));

	&.spectrum-Divider--sizeS {
		/** @deprecated --mod-divider-background-color-small-static-black, use --mod-divider-background-color instead */
		--mod-divider-background-color: var(--mod-divider-background-color-small-static-black, var(--spectrum-divider-background-color-static-black));
	}

	&.spectrum-Divider--sizeL {
		/** @deprecated --mod-divider-background-color-large-static-black, use --mod-divider-background-color instead */
		--mod-divider-background-color: var(--mod-divider-background-color-large-static-black, var(--spectrum-transparent-black-800));
	}
}

.spectrum-Divider {
	block-size: var(--mod-divider-thickness, var(--spectrum-divider-thickness));
	inline-size: 100%;

	/* Show the overflow for hr in Edge and IE. */
	overflow: visible;

	border: none;
	border-width: var(--mod-divider-thickness, var(--spectrum-divider-thickness));
	border-radius: var(--mod-divider-thickness, var(--spectrum-divider-thickness));

	background-color: var(--highcontrast-divider-background-color, var(--mod-divider-background-color, var(--spectrum-divider-background-color)));
}

/* vertical dividers */
.spectrum-Divider--vertical {
	inline-size: var(--mod-divider-thickness, var(--spectrum-divider-thickness));
	block-size: var(--mod-divider-vertical-height, 100%);

	margin-block: var(--mod-divider-vertical-margin);
	align-self: var(--mod-divider-vertical-align);
}
