/* ============================================================
   Recovery Stories section
   Design ref: designs/Homepage Design Desktop.jpg y4480-5480,
   Mobile y6000-7100. Cream band, large story card on shadow
   (1072px inset), centred serif title, decorative grey quote
   mark (top-right desktop, between photo and text on mobile),
   photo left / quote right on desktop, Read More link.
   ============================================================ */

.stories {
	background: var(--color-cream-light);
	padding-block: var(--section-padding);
}

/* Grey band variant (Recovery Stories page) - cream cards lift off it */
.stories--grey {
	background: var(--color-light-grey);
}

/* ---- Intro ---- */

.stories__heading {
	margin-bottom: var(--space-md);
}

.stories__text {
	margin-bottom: 0;
}

/* ---- Card ---- */

.stories__card {
	position: relative;
	margin-top: var(--space-lg);
	padding: 2rem 1.75rem;
	background: var(--color-cream-light);
	border-radius: var(--radius-sm);
	box-shadow: 0 4px 18px rgb(0 31 38 / 0.08);
}

.stories__title {
	margin-bottom: var(--space-md);
	font-size: 1.625rem;
	text-align: center;
}

.stories__quote-mark {
	display: block;
	text-align: right;
	margin-bottom: var(--space-sm);
}

.stories__quote-mark img {
	display: inline-block;
	width: 64px;
	height: auto;
}

.stories__media {
	margin-bottom: var(--space-md);
}

.stories__image {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--radius-xs);
}

.stories__quote p {
	margin-bottom: 1em;
}

.stories__quote p:last-child {
	margin-bottom: 0;
}

.stories__quote {
	margin: 0 0 var(--space-md);
}

/* ---- Expand in place ----
   Stories have no pages of their own (2026-07-21), so the whole story lives in
   the card and "Read More" reveals the rest of it.

   The clamp is scoped to .has-js (set inline in header.php before first paint):
   with JavaScript off the full story is simply visible and the toggle is
   hidden, because a button that cannot expand anything is worse than no button.
   Do NOT unscope this. */

.stories__reveal {
	position: relative;
}

.has-js .stories__reveal {
	max-height: var(--story-collapsed, 11rem);
	overflow: hidden;
	transition: max-height 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Fades the last line out so it reads as "there is more", rather than
   looking like the text was cut off by accident.

   It fades to --color-cream-light because the fade sits over the CARD, and
   .stories__card is cream-light in BOTH band variants - the --grey modifier
   only recolours the band behind the cards. Matching the band instead paints
   a visible grey rectangle on the cream card. */
.has-js .stories__reveal::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 4.5rem;
	background: linear-gradient(to bottom, rgb(249 247 242 / 0), var(--color-cream-light));
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.has-js .stories__reveal.is-expanded::after {
	opacity: 0;
}

/* JS removes this once a story is short enough not to need a toggle */
.stories__toggle[hidden] {
	display: none;
}

html:not(.has-js) .stories__toggle {
	display: none;
}

.stories__full {
	margin-top: var(--space-md);
}

.stories__full p {
	margin-bottom: 1em;
}

.stories__full p:last-child {
	margin-bottom: 0;
}

/* ---- Read More link (step-cards link pattern) ---- */

.stories__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--color-teal-dark);
}

/* the toggle is a <button> wearing the link's clothes.
   min-height keeps it a 44px tap target - it is the primary control on this
   page now, and the label alone renders at only ~26px. */
button.stories__link {
	padding: 0;
	min-height: 44px;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	background: none;
	border: 0;
	cursor: pointer;
}

button.stories__link:focus-visible {
	outline: 2px solid var(--color-caramel);
	outline-offset: 3px;
}

/* Collapsed: the arrow stays pointing RIGHT, matching every other "Read More"
   link in the theme. Expanded: it rotates up to mean "close this". */
.stories__toggle .stories__arrow {
	transition: transform 0.3s ease;
}

.stories__toggle[aria-expanded="true"] .stories__arrow {
	transform: rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {
	.has-js .stories__reveal,
	.stories__toggle .stories__arrow,
	.has-js .stories__reveal::after {
		transition: none;
	}
}

.stories__link:hover,
.stories__link:focus-visible {
	color: var(--color-teal-dark);
}

.stories__link-label {
	position: relative;
}

.stories__link-label::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 1px;
	height: 1.5px;
	background: currentColor;
	opacity: 0;
	transition: opacity 0.45s ease;
}

.stories__link:hover .stories__link-label::after,
.stories__link:focus-visible .stories__link-label::after {
	opacity: 1;
}

.stories__arrow {
	transition: transform 0.3s ease, color 0.3s ease;
}

.stories__arrow svg {
	display: block;
	width: 17px;
	height: 12px;
}

.stories__link:hover .stories__arrow,
.stories__link:focus-visible .stories__arrow {
	color: var(--color-caramel-light);
	transform: translateX(3px);
}

/* ---- Button ---- */

.stories__actions {
	margin-top: var(--space-xl);
	display: flex;
	justify-content: center;
}

/* ---- Tablet and up ---- */

@media (min-width: 768px) {
	.stories__intro {
		text-align: center;
		max-width: 52rem;
		margin-inline: auto;
	}
}

/* ---- Desktop: photo left, quote right, quote mark top-right ---- */

@media (min-width: 1024px) {
	.stories__card {
		max-width: 1072px;
		margin-inline: auto;
		margin-top: var(--space-xl);
		padding: 3.5rem 3rem;
	}

	.stories__quote-mark {
		position: absolute;
		top: 2.5rem;
		right: 3rem;
	}

	.stories__body {
		display: grid;
		grid-template-columns: 320px minmax(0, 1fr);
		gap: 2.875rem;
		align-items: start;
		margin-top: var(--space-lg);
	}

	/* Text-only stories run the quote full width (no empty photo column) */
	.stories__card--no-photo .stories__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.stories__media {
		margin-bottom: 0;
	}
}
