/**
 * Expandable Text widget — frontend styles.
 *
 * Layout/behavior only; colors, typography, spacing, borders etc. are all
 * driven by Elementor style controls (see class-expandable-text-widget.php)
 * via CSS custom properties and per-instance selectors.
 */

.expandable-text-widget {
	position: relative;
}

.expandable-text-widget__content {
	position: relative;
	overflow: hidden;
	max-height: var( --expandable-text-collapsed-height, 160px );
	transition: max-height 0.35s ease;
}

.expandable-text-widget__content[data-expanded="true"] {
	max-height: none;
}

.expandable-text-widget__content > *:last-child {
	margin-bottom: 0;
}

.expandable-text-widget__gradient {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	height: var( --expandable-text-gradient-height, 60px );
	background: linear-gradient( to bottom, rgba( 255, 255, 255, 0 ), var( --expandable-text-gradient-color, #ffffff ) );
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.2s ease;
}

.expandable-text-widget--expanded .expandable-text-widget__gradient {
	opacity: 0;
}

.expandable-text-widget__gradient[hidden] {
	display: none;
}

.expandable-text-widget__toggle {
	display: block;
	margin: 12px 0 0;
	padding: 8px 20px;
	border: 1px solid currentColor;
	border-radius: 4px;
	background-color: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.expandable-text-widget__toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.expandable-text-widget__toggle[hidden] {
	display: none;
}

@media ( prefers-reduced-motion: reduce ) {
	.expandable-text-widget__content,
	.expandable-text-widget__gradient,
	.expandable-text-widget__toggle {
		transition: none !important;
	}
}
