/*
 * Post card (template-parts/components/post-card.php). From the preview
 * docs/preview/new_home7_2.png: photo on the left at full card height, title,
 * short excerpt and „Czytaj” on the right. Phones: photo on top.
 */

.hf-post-card
{
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	width: 100%;
	overflow: hidden;
	border: 1px solid var(--hf-color-card-border);
	border-radius: var(--hf-radius-m);
	background: var(--hf-color-surface);
	transition: box-shadow var(--hf-transition);
}

.hf-post-card:hover
{
	box-shadow: 0 10px 28px color-mix(in srgb, var(--hf-color-heading) 10%, transparent);
}

/* The stretched title link draws the focus ring around the whole card. */
.hf-post-card:focus-within
{
	outline: 3px solid var(--hf-color-focus);
	outline-offset: 3px;
}

/* The photo fills its column at whatever height the text needs. */
.hf-post-card__media
{
	position: relative;
	min-height: clamp(11rem, 8rem + 5vw, 15rem);
	background: var(--hf-color-band);
}

.hf-post-card__image
{
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hf-post-card__body
{
	display: flex;
	flex-direction: column;
	padding: clamp(1rem, 0.6rem + 1vw, 1.75rem);
}

.hf-post-card__title
{
	margin: 0 0 var(--hf-space-s);
	font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.75rem);
	text-wrap: balance;
}

.hf-post-card__link
{
	color: inherit;
	text-decoration: none;
}

.hf-post-card__link::after
{
	position: absolute;
	inset: 0;
	content: "";
}

.hf-post-card__link:focus-visible
{
	outline: none;
}

.hf-post-card__text
{
	margin: 0 0 var(--hf-space-m);
	font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.125rem);
	line-height: 1.5;
}

.hf-post-card__more
{
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 0.6em;
	margin-top: auto;
	color: var(--hf-color-eyebrow);
}

.hf-post-card__more-text
{
	text-decoration: underline;
	text-decoration-color: var(--hf-color-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.35em;
}

.hf-post-card__more-icon
{
	width: 1.1em;
	height: 1.1em;
	transition: transform var(--hf-transition);
}

.hf-post-card:hover .hf-post-card__more-icon
{
	transform: translateX(3px);
}

@media (max-width: 40em)
{
	.hf-post-card
	{
		grid-template-columns: minmax(0, 1fr);
	}

	.hf-post-card__media
	{
		min-height: 0;
		aspect-ratio: 3 / 2;
	}
}

/*
 * Stacked card (Inspiracje list, docs/preview/inspiracje.png at 1440): the
 * photo on top (1.7 : 1), then the category, the title, one line of
 * excerpt and „Czytaj artykuł”, all a little larger than in the card
 * beside its photo.
 */
.hf-post-card--stacked
{
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: auto 1fr;
}

.hf-post-card--stacked .hf-post-card__media
{
	min-height: 0;
	aspect-ratio: 1.7 / 1;
}

.hf-post-card--stacked .hf-post-card__body
{
	padding: clamp(1.25rem, 0.9rem + 1vw, 2rem);
}

.hf-post-card__eyebrow
{
	margin-bottom: var(--hf-space-xs);
}

.hf-post-card--stacked .hf-post-card__title
{
	margin-bottom: var(--hf-space-xs);
	font-size: var(--hf-text-card-title-l);
}

.hf-post-card--stacked .hf-post-card__text
{
	font-size: var(--hf-text-control);
}

.hf-post-card--stacked .hf-post-card__more
{
	color: var(--hf-color-heading);
	font-size: var(--hf-text-control);
}
