/**
 * Expandable Text Component Styles
 * Używa istniejących klas .button z motywu
 */

.expandable-text {
	padding: 60px 0;
}

@media (max-width: 768px) {
	.expandable-text {
		padding: 40px 0;
	}
}

/* Treść zawsze widoczna */
.expandable-text__content--visible {
	margin-bottom: 0;
}

.expandable-text__content--visible p {
	margin-bottom: 1em;
	line-height: 1.6;
}

.expandable-text__content--visible p:last-child {
	margin-bottom: 0;
}

.expandable-text__content--visible h2,
.expandable-text__content--visible h3,
.expandable-text__content--visible h4 {
	margin-top: 1.5em;
	margin-bottom: 0.75em;
}

.expandable-text__content--visible ul,
.expandable-text__content--visible ol {
	margin: 1em 0;
	padding-left: 1.5em;
}

.expandable-text__content--visible a {
	color: inherit;
	text-decoration: underline;
}

.expandable-text__content--visible a:hover {
	opacity: 0.7;
}

/* Treść zwijana - domyślnie ukryta */
.expandable-text__content--hidden {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.4s ease-out, 
	            opacity 0.3s ease-out, 
	            margin-top 0.3s ease-out;
}

/* Styl dla rozwiniętej treści */
.expandable-text__content--hidden.is-expanded {
	max-height: 3000px;
	opacity: 1;
	margin-top: 1.5em;
	transition: max-height 0.5s ease-in, 
	            opacity 0.4s ease-in 0.1s,
	            margin-top 0.3s ease-in;
}

/* Dziedziczenie stylów WYSIWYG dla zwiniętej treści */
.expandable-text__content--hidden p {
	margin-bottom: 1em;
	line-height: 1.6;
}

.expandable-text__content--hidden p:last-child {
	margin-bottom: 0;
}

.expandable-text__content--hidden h2,
.expandable-text__content--hidden h3,
.expandable-text__content--hidden h4 {
	margin-top: 1.5em;
	margin-bottom: 0.75em;
}

.expandable-text__content--hidden ul,
.expandable-text__content--hidden ol {
	margin: 1em 0;
	padding-left: 1.5em;
}

.expandable-text__content--hidden a {
	color: inherit;
	text-decoration: underline;
}

.expandable-text__content--hidden a:hover {
	opacity: 0.7;
}

/* Minimalne style dla przycisku toggle - reszta z klasy .button */
.expandable-text__toggle {
	margin-top: 20px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

/* Ikona strzałki - animacja obrotu */
.expandable-text__toggle-icon {
	transition: transform 0.3s ease;
	margin-left: 4px;
}

/* Obrót ikony gdy rozwinięte - strzałka w górę */
.expandable-text__content--hidden.is-expanded ~ .expandable-text__toggle .expandable-text__toggle-icon {
	transform: rotate(-90deg);
}

/* Tekst przycisku */
.expandable-text__toggle-text {
	display: inline-block;
}
