/**
 * Treatment Indications — Figma 207:10609 (1602px).
 */

.anm-treatment-indications {
	--anm-ind-ref-w: 1602;
	--anm-ind-heading-gradient: linear-gradient(-4.55deg, #dfdee8 27.93%, #aaa9ad 125.18%, #878787 226.65%);
	--anm-ind-title-gradient: linear-gradient(-1.43deg, #dfdee8 27.93%, #aaa9ad 125.18%, #878787 226.65%);
	--anm-ind-border-active: #8fd9fb;
	--anm-ind-border-default: #1a1a1a;
	--anm-ind-label-color: #a7a7a7;
	--anm-ind-btn-text: #044f71;
	--anm-ind-btn-bg-start: #8fd9fb;
	--anm-ind-btn-bg-end: #b0e4fc;

	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--anm-ind-ref-w) * 1px);
	margin-left: auto;
	margin-right: auto;
	padding-block: clamp(3rem, 6vw, 5rem);
	padding-inline: var(--anm-section-gutter);
	color: #fff;
}

.anm-treatment-indications__inner {
	width: 100%;
}

/* --- Nagłówek --- */
.anm-treatment-indications__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 2rem;
}

.anm-treatment-indications__heading {
	margin: 0;
	max-width: 40.5625rem; /* 650px */
	font-family: "Playfair Display", Georgia, serif;
	font-size: clamp(2.25rem, 4vw, 4rem); /* 64px */
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.03em;
	background: var(--anm-ind-heading-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.anm-treatment-indications__label {
	margin: 0.35rem 0 0;
	flex-shrink: 0;
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 1.125rem; /* 18px */
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: -0.04em;
	color: var(--anm-ind-label-color);
	white-space: nowrap;
}

/* --- Lista --- */
.anm-treatment-indications__list {
	display: flex;
	flex-direction: column;
	gap: 3rem; /* 48px */
	margin-top: clamp(3rem, 5vw, 9.625rem); /* ~245px @ desktop */
}

.anm-treatment-indications__item {
	border-bottom: 1px solid var(--anm-ind-border-default);
	padding-bottom: 1.5rem; /* 24px */
	transition: border-color 0.35s ease;
	cursor: pointer;
}

.anm-treatment-indications__item:focus-visible {
	outline: 2px solid var(--anm-ind-border-active);
	outline-offset: 4px;
}

.anm-treatment-indications__item.is-open {
	border-bottom-color: var(--anm-ind-border-active);
}

.anm-treatment-indications__item-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: clamp(1.5rem, 10vw, 10.5625rem); /* 169px — tylko rozwinięty */
}

.anm-treatment-indications__item:not(.is-open) .anm-treatment-indications__item-row {
	align-items: center;
	gap: 1rem;
}

.anm-treatment-indications__item-main {
	display: flex;
	flex-direction: column;
	flex: 0 1 40.4375rem; /* 647px */
	max-width: 40.4375rem;
	min-width: 0;
	min-height: 0;
}

.anm-treatment-indications__item:not(.is-open) .anm-treatment-indications__item-main {
	flex: 1 1 auto;
	max-width: none;
}

.anm-treatment-indications__item.is-open .anm-treatment-indications__item-main {
	justify-content: space-between;
	align-self: stretch;
	gap: 3rem; /* 48px — odstęp tytuł → treść */
}

.anm-treatment-indications__title {
	margin: 0;
	font-family: "Playfair Display", Georgia, serif;
	font-size: clamp(1.75rem, 2.5vw, 2.5rem); /* 40px */
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.03em;
	background: var(--anm-ind-title-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* --- Panel rozwinięty --- */
.anm-treatment-indications__panel {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transition:
		grid-template-rows 0.45s cubic-bezier(0.33, 1, 0.68, 1),
		opacity 0.35s ease;
}

.anm-treatment-indications__item.is-open .anm-treatment-indications__panel {
	grid-template-rows: 1fr;
	opacity: 1;
}

.anm-treatment-indications__panel-inner {
	overflow: hidden;
	min-height: 0;
}

.anm-treatment-indications__panel-body {
	display: flex;
	flex-direction: column;
	gap: 3rem; /* 48px — tekst → przycisk */
	align-items: flex-start;
}

.anm-treatment-indications__text {
	margin: 0;
	font-family: "IBM Plex Sans", sans-serif;
	font-size: clamp(1rem, 1.25vw, 1.25rem); /* 20px */
	font-weight: 400;
	line-height: 1.4;
	color: #fff;
	text-align: justify;
}

.anm-treatment-indications__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 12.5rem; /* 200px */
	min-height: 3.375rem;
	padding: 1.125rem 2rem;
	border-radius: 8px;
	background: linear-gradient(29.03deg, var(--anm-ind-btn-bg-start) 16.98%, var(--anm-ind-btn-bg-end) 97.78%);
	color: var(--anm-ind-btn-text);
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 1rem;
	font-weight: 500;
	line-height: normal;
	letter-spacing: -0.01em;
	text-decoration: none;
	white-space: nowrap;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.anm-treatment-indications__btn:hover,
.anm-treatment-indications__btn:focus-visible {
	opacity: 0.92;
	transform: translateY(-1px);
}

/* --- Prawa kolumna: zdjęcie + ikona --- */
.anm-treatment-indications__item-side {
	display: flex;
	flex: 1 1 auto;
	align-items: flex-start;
	justify-content: space-between;
	min-width: 0;
	gap: 1rem;
}

.anm-treatment-indications__item:not(.is-open) .anm-treatment-indications__item-side {
	flex: 0 0 auto;
	justify-content: flex-end;
}

.anm-treatment-indications__media {
	flex-shrink: 0;
	width: min(31.25rem, 100%); /* 500px */
	aspect-ratio: 1;
	border-radius: 8px;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(0.5rem);
	transition:
		opacity 0.45s cubic-bezier(0.33, 1, 0.68, 1),
		visibility 0.45s cubic-bezier(0.33, 1, 0.68, 1),
		transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Ukryte zdjęcie nie może rezerwować miejsca w zwiniętym wierszu (Figma: sam tytuł + ikona). */
.anm-treatment-indications__item:not(.is-open) .anm-treatment-indications__media {
	display: none;
	width: 0;
	height: 0;
	aspect-ratio: auto;
	opacity: 0;
	visibility: hidden;
	transform: none;
}

.anm-treatment-indications__item.is-open .anm-treatment-indications__media {
	display: block;
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.anm-treatment-indications__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px;
}

/* --- Ikona +/- --- */
.anm-treatment-indications__toggle {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: #fff;
	pointer-events: none;
}

.anm-treatment-indications__icon {
	position: relative;
	display: block;
	width: 2rem;
	height: 2rem;
	transition: transform 0.25s ease;
}

.anm-treatment-indications__icon::before,
.anm-treatment-indications__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	background-color: currentColor;
	transform: translate(-50%, -50%);
}

.anm-treatment-indications__icon::before {
	width: 1.5px;
	height: 2rem;
}

.anm-treatment-indications__icon::after {
	width: 2rem;
	height: 1.5px;
}

.anm-treatment-indications__item.is-open .anm-treatment-indications__icon {
	transform: rotate(45deg);
}

.anm-treatment-indications__empty {
	margin: 2rem 0 0;
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 1rem;
	color: var(--anm-ind-label-color);
}

/* --- Mobile: tytuł + ikona w jednym wierszu (jak FAQ) --- */
@media (max-width: 1023px) {
	.anm-treatment-indications__item-row {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"title toggle"
			"panel panel"
			"media media";
		column-gap: 1rem;
		row-gap: 0;
		align-items: start;
	}

	.anm-treatment-indications__item.is-open .anm-treatment-indications__item-row {
		row-gap: 1.5rem;
	}

	.anm-treatment-indications__item-main {
		display: contents;
	}

	.anm-treatment-indications__item.is-open .anm-treatment-indications__item-main {
		justify-content: unset;
		align-self: unset;
		gap: 0;
	}

	.anm-treatment-indications__title {
		grid-area: title;
		align-self: center;
	}

	.anm-treatment-indications__panel {
		grid-area: panel;
	}

	.anm-treatment-indications__item-side {
		display: contents;
	}

	.anm-treatment-indications__media {
		grid-area: media;
		width: 100%;
		max-width: none;
	}

	.anm-treatment-indications__toggle {
		grid-area: toggle;
		align-self: center;
		justify-self: end;
	}
}

@media (max-width: 767px) {
	.anm-treatment-indications {
		padding-block: 2.5rem;
	}

	.anm-treatment-indications__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	.anm-treatment-indications__label {
		margin-top: 0;
		order: -1;
	}

	.anm-treatment-indications__heading {
		font-size: 2.25rem;
	}

	.anm-treatment-indications__list {
		margin-top: 2.5rem;
		gap: 2.0625rem;
	}

	.anm-treatment-indications__title {
		font-size: 1.75rem;
		font-weight: 700;
	}

	.anm-treatment-indications__text {
		font-size: 1rem;
	}

	.anm-treatment-indications__item.is-open .anm-treatment-indications__item-main {
		gap: 2rem;
	}

	.anm-treatment-indications__panel-body {
		gap: 2rem;
	}

	.anm-treatment-indications__media {
		width: 100%;
		height: 26.25rem;
		aspect-ratio: auto;
	}

	.anm-treatment-indications__btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.anm-treatment-indications__panel,
	.anm-treatment-indications__item,
	.anm-treatment-indications__icon,
	.anm-treatment-indications__media {
		transition: none !important;
	}
}
