@use "@wordpress/base-styles/mixins" as *;
@use "../utils/theme-variables" as *;

.textarea {
	width: 100%;
	display: block;
	background: $components-color-background;
	color: $components-color-foreground;
	/* stylelint-disable-next-line logical-css/require-logical-keywords -- Preserve `resize: vertical`; `block` is not equivalent in vertical writing modes. */
	resize: vertical;

	@include input-control;

	// Vertical padding is to match the standard 40px control height when rows=1,
	// in conjunction with the 20px line-height.
	// "Standard" metrics are 10px 12px, but subtracts 1px each to account for the border width.
	line-height: 20px;
	padding: 9px 11px;

	// Matching the 20px line-height + the 9px top and bottom padding.
	min-height: 38px;

	&:disabled {
		border-color: var(--wpds-color-stroke-interactive-neutral-disabled);
		color: var(--wpds-color-foreground-interactive-neutral-disabled);
		// Core's `form.css` sets its own background on disabled textareas.
		background: $components-color-background;
	}

	&::placeholder {
		color: var(--wpds-color-foreground-interactive-neutral-weak);
	}

	&:disabled::placeholder {
		color: var(--wpds-color-foreground-interactive-neutral-disabled);
	}
}
