/**
 * Aftercare — list + hover/focus expand (Figma 544:2939).
 *
 * @package Love_Beauty_Skin
 */

.aftercare {
	--aftercare-bg: #f4e3e2;
	--aftercare-eyebrow: #d9a9a9;
	--aftercare-text: #636363;
	--aftercare-panel-bg: #fff;
	--aftercare-rule: rgba(99, 99, 99, 0.35);
	/* List title: same weight always; darker = “active” (avoids faux-bold blur from text-shadow). */
	--aftercare-item-title-strong: #3a3a3a;
	/* Same height for white panel + image column (Figma ~630px) */
	--aftercare-column-height: 39.375rem;

	background-color: var(--aftercare-bg);
	padding: clamp(1.75rem, 4vw, 2.125rem) clamp(1.25rem, 6vw, 5.75rem) clamp(2.5rem, 5vw, 3.75rem);
}

.aftercare__inner {
	max-width: var(--lbs-container-max);
	margin-inline: auto;
}

.aftercare__header {
	text-align: center;
	max-width: 36rem;
	margin-inline: auto;
	margin-bottom: clamp(1.5rem, 3vw, 1.9375rem);
}

.aftercare__eyebrow {
	margin: 0 0 0.5rem;
	font-family: var(--lbs-font-body);
	font-weight: 300;
	font-size: clamp(1.25rem, 2.5vw, 1.75rem);
	line-height: 1.1;
	color: var(--aftercare-eyebrow);
}

.aftercare__title {
	margin: 0;
	font-family: var(--lbs-font-display);
	font-weight: 300;
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	line-height: 1.2;
	letter-spacing: 0.035em;
	color: var(--aftercare-text);
}

.aftercare__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(1rem, 2.5vw, 1.25rem);
	align-items: stretch;
}

@media (min-width: 960px) {
	/* start: left column can grow on hover without stretching the image column */
	.aftercare__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 1.25rem;
		align-items: start;
	}
}

.aftercare__panel {
	background: var(--aftercare-panel-bg);
	padding: 1.125rem 1.5625rem 2rem 1.5625rem;
	min-height: clamp(20rem, 50vh, 39.375rem);
	display: flex;
	flex-direction: column;
}

@media (min-width: 960px) {
	.aftercare__panel {
		padding: 1.125rem 3.5625rem 3rem 1.5625rem;
		height: var(--aftercare-column-height);
		min-height: var(--aftercare-column-height);
		max-height: var(--aftercare-column-height);
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		/* Avoid horizontal shift when scrollbar appears; reduces perceived “jump” */
		scrollbar-gutter: stable;
		overflow-anchor: none;
	}
}

/* Grow to fill the panel so empty space below the last row is still inside the <ul>.
   Otherwise hovering that gap hits only the panel padding — list :hover drops and accordions jump. */
.aftercare__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	gap: 0;
}

.aftercare__item {
	position: relative;
	margin: 0;
	padding: 0.625rem 0 0.75rem;
	border-bottom: 1px solid var(--aftercare-rule);
	outline: none;
	transition: background-color 0.2s ease;
}

.aftercare__item:last-child {
	border-bottom: none;
}

.aftercare__item:focus-visible {
	box-shadow: inset 0 0 0 2px var(--lbs-color-accent-pink);
}

.aftercare__item-title {
	margin: 0;
	font-family: var(--lbs-font-body);
	font-size: clamp(1.125rem, 2vw, 1.375rem);
	line-height: 1.4;
	font-weight: 300;
	color: var(--aftercare-text);
	transition: color 0.15s ease;
}

.aftercare__item-body {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.4s ease;
}

.aftercare__item-body-inner {
	min-height: 0;
	overflow: hidden;
	padding-top: 0.5rem;
	font-family: var(--lbs-font-body);
	font-size: clamp(1rem, 1.8vw, 1.25rem);
	font-weight: 300;
	line-height: 1.4;
	color: var(--aftercare-text);
}

.aftercare__item-body-inner p {
	margin: 0 0 0.75rem;
}

.aftercare__item-body-inner p:last-child {
	margin-bottom: 0;
}

/* Emphasis = darker colour only (no weight / shadow — those blur or shift on hover). */
.aftercare__item:hover .aftercare__item-title,
.aftercare__item:focus-within .aftercare__item-title,
.aftercare__item:focus-visible .aftercare__item-title {
	color: var(--aftercare-item-title-strong);
}

.aftercare__item:hover .aftercare__item-body,
.aftercare__item:focus-within .aftercare__item-body {
	grid-template-rows: 1fr;
}

.aftercare__item--title-only:hover .aftercare__item-title,
.aftercare__item--title-only:focus-within .aftercare__item-title,
.aftercare__item--title-only:focus-visible .aftercare__item-title {
	color: var(--aftercare-item-title-strong);
}

/* First row starts open; collapses when another row is hovered or focused */
.aftercare__item--default-open .aftercare__item-body {
	grid-template-rows: 1fr;
}

.aftercare__item--default-open .aftercare__item-title {
	color: var(--aftercare-item-title-strong);
}

.aftercare__list:is(:hover, :focus-within) .aftercare__item--default-open:not(:hover):not(:focus-within) .aftercare__item-body {
	grid-template-rows: 0fr;
}

.aftercare__list:is(:hover, :focus-within) .aftercare__item--default-open:not(:hover):not(:focus-within) .aftercare__item-title {
	color: var(--aftercare-text);
}

.aftercare__item--default-open.aftercare__item--title-only .aftercare__item-title {
	color: var(--aftercare-item-title-strong);
}

.aftercare__list:is(:hover, :focus-within) .aftercare__item--default-open.aftercare__item--title-only:not(:hover):not(:focus-within) .aftercare__item-title {
	color: var(--aftercare-text);
}

.aftercare__figure {
	margin: 0;
	min-height: clamp(16rem, 40vh, 39.375rem);
	position: relative;
	overflow: hidden;
	align-self: start;
	/* Figma: photo fills the column; no white matte (letterboxing was from contain + panel white) */
	background-color: transparent;
}

.aftercare__img {
	width: 100%;
	height: 100%;
	min-height: clamp(16rem, 40vh, 39.375rem);
	object-fit: cover;
	object-position: center center;
}

@media (min-width: 960px) {
	/* Same fixed height as .aftercare__panel; image does not resize when accordion opens */
	.aftercare__figure {
		height: var(--aftercare-column-height);
		min-height: var(--aftercare-column-height);
		max-height: var(--aftercare-column-height);
		flex-shrink: 0;
	}

	.aftercare__img {
		height: var(--aftercare-column-height);
		min-height: var(--aftercare-column-height);
		max-height: var(--aftercare-column-height);
	}
}

@media (max-width: 959px) {
	.aftercare__figure {
		order: -1;
	}
}
