/*
 * Client story card (inc/cards/story-card.php), registered as the
 * "eteria-story-card" style for eteria/stories and eteria/article.
 *
 * A white card with a hairline frame and the rounded corner of the blog
 * tile's picture (Figma "Blog tile" 4971:6149), the same meta line, title
 * size and "Czytaj →" cue as the blog tile, the advisor's photo and name
 * over the reading time. A cover set by hand sits on top in the tile's
 * 17:10 frame.
 */

.e-story-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border-cream);
	border-bottom-right-radius: 20px;
	transition: border-color 0.2s ease;
}

.e-story-card:hover {
	border-color: var(--wp--preset--color--text-primary);
}

.e-story-card__media {
	aspect-ratio: 17 / 10;
	overflow: hidden;
	background-color: var(--wp--preset--color--parchment);
}

.e-story-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.e-story-card:hover .e-story-card__img {
	transform: scale(1.03);
}

.e-story-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 16px;
	align-items: flex-start;
	padding: clamp(1.5rem, 1.0246rem + 2.0286vw, 2.5rem);
}

.e-story-card__body > * {
	margin: 0;
}

.e-story-card__meta {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 500;
	line-height: 14px;
	letter-spacing: 0.1455em;
	color: var(--wp--preset--color--text-muted);
	text-transform: uppercase;
}

/* The advisor: a round photo as in the offers' «Twój konsultant» box, the
 * name over the reading time. */
.e-story-card__byline {
	display: flex;
	gap: 12px;
	align-items: center;
}

.e-story-card__avatar {
	flex: none;
	width: 44px;
	height: 44px;
	overflow: hidden;
	background-color: var(--wp--preset--color--parchment);
	border-radius: 50%;
}

/* The team photos are 827 × 1221 portraits with the head in the top third,
 * centred: 1.8 times the circle's width, centred, 8 % of the height cut off
 * on top, the circle shows the head and shoulders (8–45 % of the height). */
.e-story-card__avatar img {
	display: block;
	width: 180%;
	max-width: none;
	height: auto;
	margin: -21% 0 0 -40%;
}

.e-story-card__byline-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.e-story-card__byline-text > * {
	margin: 0;
}

.e-story-card__agent {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	line-height: 1.3;
	color: var(--wp--preset--color--text-primary);
}

.e-story-card__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--h-4);
	font-weight: 500;
	line-height: 1.185;
	letter-spacing: 0;
	text-wrap: balance;
}

.e-story-card__link {
	color: var(--wp--preset--color--text-primary);
	text-decoration: none;
	transition: color 0.2s ease;
}

/* The title link covers the whole card. */
.e-story-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.e-story-card__link:hover,
.e-story-card:hover .e-story-card__link {
	color: var(--wp--preset--color--burgundy);
}

.e-story-card__link:focus-visible {
	outline: none;
}

.e-story-card__link:focus-visible::after {
	outline: 2px solid var(--wp--preset--color--burgundy);
	outline-offset: 3px;
}

.e-story-card__teaser {
	flex: 1 1 auto;
	font-size: var(--wp--preset--font-size--body);
	font-weight: 300;
	line-height: 1.6;
	color: var(--wp--preset--color--text-subtle);
}

/* "Czytaj historię →" (btn-tertiary): only a cue, the card is the link. */
.e-story-card__more {
	display: inline-flex;
	gap: 10px;
	align-items: center;
	margin-top: 8px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 21px;
	letter-spacing: 0.1385em;
	color: var(--wp--preset--color--burgundy);
	text-transform: uppercase;
}

.e-story-card__more::after {
	content: "";
	width: 1rem;
	height: 1rem;
	background-color: currentcolor;
	mask: url(../icons/arrow-right.svg) center / contain no-repeat;
	transition: transform 0.2s ease;
}

.e-story-card:hover .e-story-card__more::after {
	transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {

	.e-story-card,
	.e-story-card__img,
	.e-story-card__link,
	.e-story-card__more::after {
		transition: none;
	}

	.e-story-card:hover .e-story-card__img {
		transform: none;
	}
}
