/**
 * @file
 * Item designs component.
 *
 * The ready-made item templates' looks: Card, Image beside text and
 * Compact, each styled through the classes its blocks carry (the Classic
 * design has none and no rules). The blocks hold no style options, so the
 * shape of an image comes from here, never from an inline style. Each design
 * reads the design tokens, falling back to a theme.json custom value, then
 * to its default. Rules that space a design's own blocks use two classes,
 * so they win over the theme's flow layout margins.
 *
 * Contents:
 * 1. Card
 * 2. Image beside text
 * 3. Compact
 * 4. Media queries
 */

/* 1. Card
   ========================================================================== */

.viewspress-card {
	block-size: 100%;
	overflow: hidden;
	border: var(--viewspress-border-width, var(--wp--custom--viewspress--border-width, 1px)) solid var(--viewspress-border-color, var(--wp--custom--viewspress--border-color, color-mix(in srgb, currentcolor 15%, transparent)));
	border-radius: var(--viewspress-radius, var(--wp--custom--viewspress--radius, 0));
	background: var(--viewspress-surface, var(--wp--custom--viewspress--surface, transparent));
}

.viewspress-card .viewspress-card__image {
	margin: 0;
}

.viewspress-card__image img {
	display: block;
	inline-size: 100%;
	block-size: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.viewspress-card .viewspress-card__body {
	margin: 0;
	padding: var(--viewspress-card-padding, var(--wp--custom--viewspress--card-padding, 1em));
}

.viewspress-card .viewspress-card__body > * {
	margin-block: 0 0.5em;
}

.viewspress-card .viewspress-card__body > :last-child {
	margin-block-end: 0;
}

.viewspress-card__meta {
	font-size: 0.875em;
}

.viewspress-card__title {
	font-size: 1.25em;
	line-height: 1.3;
}

/* End of 1. Card */

/* 2. Image beside text
   ========================================================================== */

/* Stacked on small screens; side by side from 600px (Media queries), the
   image at the inline start, so it moves to the right in a right-to-left
   language. */
.viewspress-beside {
	display: flex;
	flex-direction: column;
	gap: var(--viewspress-card-padding, var(--wp--custom--viewspress--card-padding, 1em));
}

.viewspress-beside > * {
	min-inline-size: 0;
}

.viewspress-beside .viewspress-beside__image,
.viewspress-beside .viewspress-beside__body {
	margin: 0;
}

.viewspress-beside__image img {
	display: block;
	inline-size: 100%;
	block-size: auto;
	aspect-ratio: 4 / 3;
	border-radius: var(--viewspress-radius, var(--wp--custom--viewspress--radius, 0));
	object-fit: cover;
}

.viewspress-beside .viewspress-beside__body > * {
	margin-block: 0 0.5em;
}

.viewspress-beside .viewspress-beside__body > :last-child {
	margin-block-end: 0;
}

.viewspress-beside__title {
	font-size: 1.25em;
	line-height: 1.3;
}

.viewspress-beside__meta {
	font-size: 0.875em;
}

/* End of 2. Image beside text */

/* 3. Compact
   ========================================================================== */

.viewspress-compact .viewspress-compact__title {
	margin-block: 0;
	font-size: 1.125em;
	line-height: 1.3;
}

.viewspress-compact .viewspress-compact__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 0.75em;
	margin-block: 0.25em 0;
	font-size: 0.875em;
}

.viewspress-compact .viewspress-compact__meta > * {
	margin: 0;
}

/* End of 3. Compact */

/* 4. Media queries
   ========================================================================== */

@media (min-width: 600px) {
	.viewspress-beside {
		flex-direction: row;
		align-items: flex-start;
	}

	.viewspress-beside .viewspress-beside__image {
		flex: 0 0 40%;
	}

	.viewspress-beside .viewspress-beside__body {
		flex: 1 1 0;
	}
}

/* End of 4. Media queries */
