/*** Template: Single — Client Story (deltas on single.css) ***/

.single-story {
	overflow-x: clip;
}

/** Hero — euphoric-blue band, centred lockup, media spills below **/

.story-hero {
	--hero-media-drop: 280px;
	color: var(--white);
	margin-top: var(--text-spacing-medium);
}

.story-hero .bg-field {
	background: var(--euphoric-blue);
	background-size: 200% 200%, 220% 220%, 240% 240%, 100% 100%;
	bottom: var(--hero-media-drop);
}

@media (prefers-reduced-motion: no-preference) {

	.story-hero .bg-field {
		animation: euphoria-drift var(--euphoria-drift-duration) ease-in-out infinite;
	}

}

.story-hero.no-media {
	--hero-media-drop: 0px;
	padding-bottom: var(--module-spacing-xlarge);
}

/* No hero media — pull the facts bar up under the hero's deeper padding. */
.story-hero.no-media + .story-facts {
	margin-top: calc(-1 * var(--module-spacing-medium));
}

.story-hero .container.grid {
	margin-top: var(--text-spacing-xxlarge);
}

.story-hero .lockup {
	align-items: center;
	display: flex;
	flex-direction: column;
	grid-column: 2 / span 10;
	text-align: center;
}

.story-hero .lockup p {
	margin: 0;
}

.story-hero .lockup > * + * {
	margin-top: var(--text-spacing-small);
}

.story-hero .lockup > .cobrand + * {
	margin-top: var(--text-spacing-xlarge);
}

.story-hero .lockup > .heading-2 + .dek {
	margin-top: var(--text-spacing-xsmall);
}

/* Brand-orange .highlight would clash on the euphoric band — white over it. */
.story-hero .lockup .highlight {
	color: var(--white);
}

.story-hero .cobrand {
	align-items: center;
	display: flex;
	gap: var(--text-spacing-small);
	justify-content: center;
}

.story-hero .cobrand img,
.story-hero .cobrand svg {
	display: block;
	/*filter: brightness(0) invert(1);*/
	height: 36px;
	width: auto;
}

.story-hero .cobrand .x {
	font-size: calc(20rem / 16);
	opacity: 0.6;
}

/* The logo SVG bakes an orange (#fb5a08) circle; on the dark hero force every
   path to the white currentColor so the whole mark reads white. */
.story-hero .cobrand .phreesia svg path {
	fill: currentColor;
}

.story-hero .share {
	display: flex;
	gap: var(--text-spacing-xxsmall);
	justify-content: center;
	list-style: none;
	margin: var(--text-spacing-small) 0 0;
	padding: 0;
}

.story-hero .media {
	/* Match the archive card ratio (.card.client-story-card .media) so the hero
	   isn't the tall global 15/17 default. */
	aspect-ratio: 558 / 314;
	grid-column: 2 / span 10;
	margin-top: var(--text-spacing-large);
}

.story-hero .media :is(iframe, video) {
	border: 0;
	height: 100%;
	inset: 0;
	position: absolute;
	width: 100%;
}

/** Practice facts — lavender bar of label / value pairs **/

.story-facts {
	padding-top: var(--text-spacing-small);
}

.story-facts .facts {
	background: var(--lavender);
	display: flex;
	flex-wrap: wrap;
	gap: var(--text-spacing-xsmall) var(--text-spacing-large);
	grid-column: 2 / -2;
	margin: 0;
	padding: var(--text-spacing-medium) var(--text-spacing-large);
}

.story-facts .fact {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	gap: var(--text-spacing-xxsmall);
}

.story-facts .fact dd {
	margin: 0;
}

/** Result stats — number / label pairs split by hairline dividers **/

.story-stats {
	padding-top: var(--module-spacing-small);
}

/* Row-gap only — the columns are spaced by each stat's own padding so the hairline
   divider sits flush between them rather than floating in a gap. */
.story-stats .stats {
	column-gap: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
	row-gap: var(--text-spacing-medium);
	text-align: center;
}

/* min-width:auto (the flex default, stated) holds each stat at its content width, so
   one that no longer fits wraps to the next row instead of compressing past its text
   — min-width:0 would let them squeeze until the label clipped. */
.story-stats .stat {
	align-items: center;
	display: flex;
	flex: 1 1 180px;
	flex-direction: column;
	gap: var(--text-spacing-xxsmall);
	min-width: auto;
	padding-inline: var(--text-spacing-small);
}

.story-stats .stat + .stat {
	border-left: 1px solid color-mix(in srgb, var(--black) 15%, transparent);
}

.story-stats .number {
	color: var(--orange);
	font-weight: 400;
}

.story-stats .footnote {
	color: var(--meta-gray);
	margin-top: var(--text-spacing-medium);
	text-align: center;
}

/** Narrative body — centred reading column **/

/* Top-only spacing through the lower sections so adjacent module gaps stay 120
   (not doubled); the trailing .article-more / :last-child owns the page foot. */
.story-body {
	padding-top: var(--module-spacing-large);
}

.story-body .body {
	grid-column: 3 / span 8;
}

/***************************************************************************************************************************************************************************************/
/* MQ MAX-WIDTH 1400 - Smaller Desktop Sizes */
/***************************************************************************************************************************************************************************************/

@media only screen and (max-width: calc(1400rem / 16)) {

	.story-body .body {
		grid-column: 2 / -2;
	}

}

/***************************************************************************************************************************************************************************************/
/* MQ MAX-WIDTH 1200 - Smaller Desktop Sizes / Larger Tablet Sizes */
/***************************************************************************************************************************************************************************************/

@media only screen and (max-width: calc(1200rem / 16)) {

	.story-hero .media,
	.story-facts .facts,
	.story-body .body {
		grid-column: 1 / -1;
	}

}

/***************************************************************************************************************************************************************************************/
/* MQ MAX-WIDTH 950 - Tablet Sizes */
/***************************************************************************************************************************************************************************************/

@media only screen and (max-width: calc(950rem / 16)) {

	.story-hero {
		--hero-media-drop: var(--module-spacing-large);
	}

	.story-hero .lockup,
	.story-hero .media {
		grid-column: 1 / -1;
	}

}

/***************************************************************************************************************************************************************************************/
/* MQ MAX-WIDTH 650 - Mobile Sizes */
/***************************************************************************************************************************************************************************************/

@media only screen and (max-width: calc(650rem / 16)) {

	.story-hero {
		margin-top: var(--text-spacing-small);
	}

	.story-hero .container.grid {
		margin-top: var(--text-spacing-large);
	}

	.story-hero .lockup > .cobrand + * {
		margin-top: var(--text-spacing-large);
	}

	.story-hero .media {
		margin-top: var(--text-spacing-xsmall);
	}

	.story-facts .facts {
		padding: var(--text-spacing-small);
	}

	/* Two per row. flex-basis only bites now the container is flex — it was inert
	   against the old grid. No dividers here, so the column padding goes too. */
	.story-stats .stat {
		flex-basis: 45%;
		gap: 6px;
		padding-inline: 0;
	}

	.story-stats .stat + .stat {
		border-left: 0;
	}

}
