/* =====================================================
 * Blog page cards ([sab_blog_posts], inc/blog-posts.php)
 *
 * The newest post large (photo beside the text), the rest two across (each
 * a photo beside its title and byline), as the MaxiBlocks Blog page had them.
 * Phones: everything stacks, photo on top.
 * ===================================================== */

.sab-blog-card {
	display: grid;
	align-items: center;
}

.sab-blog-card--lead {
	grid-template-columns: minmax(0, 567fr) minmax(0, 535fr);   /* photo 567px at 1440px, as before (gap 68px) */
	column-gap: calc(var(--sab-gap) * 2);
}

.sab-blog-posts__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: calc(var(--sab-gap) * 2) var(--sab-gap);
	margin-top: calc(var(--sab-gap) * 2.5);
}

.sab-blog-posts__grid .sab-blog-card {
	grid-template-columns: minmax(0, 297fr) minmax(0, 237fr);   /* photo 297px at 1440px, as before (gap 34px) */
	column-gap: var(--sab-gap);
}

/* Photos: rounded, cropped to fill their box. */
.sab-blog-card__photo {
	display: block;
	overflow: hidden;
	border-radius: var(--sab-photo-radius);
}

.sab-blog-card__photo img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	aspect-ratio: 567 / 548;
}

.sab-blog-posts__grid .sab-blog-card__photo img {
	aspect-ratio: 1;
}

/* Titles: Roboto bold in the dark colour, as before (the Customizer sets
   h1–h3 to "feedstore" with !important). */
.sab-blog-card__title {
	margin: 0 0 12px;
	font-family: Roboto, sans-serif !important;
	font-weight: 700 !important;
	font-size: 30px;
	line-height: 1.3;
}

.sab-blog-posts__grid .sab-blog-card__title {
	font-size: 20px;
	line-height: 1.5;
}

/* ".entry-content": Astra underlines links in page text. */
.entry-content .sab-blog-card .sab-blog-card__title a {
	color: var(--sab-dark);
	text-decoration: none;
}

.sab-blog-card__title a:hover,
.sab-blog-card__title a:focus {
	color: var(--sab-slate);
}

/* Byline as on a post (style.css): name in slate, date in grey. */
.sab-blog-card .sab-post-byline {
	margin: 0;
	color: var(--sab-muted);
}

.entry-content .sab-blog-card .sab-post-byline a {
	color: var(--sab-slate);
	text-decoration: none;
}

/* Small cards: name and date on two lines, no dot (it would end a line). */
.sab-blog-posts__grid .sab-post-byline {
	flex-direction: column;
	align-items: flex-start;
}

.sab-blog-posts__grid .sab-post-byline [aria-hidden="true"] {
	display: none;
}

.sab-blog-card .sab-post-byline a:hover,
.sab-blog-card .sab-post-byline a:focus {
	color: var(--sab-dark);
}

.sab-blog-card__excerpt {
	margin: 20px 0 0;
	font-size: 14px;
	line-height: 1.3;
	color: var(--sab-dark);
}

.sab-blog-card .wp-block-button {
	margin-top: 30px;
}

/* Tablets: titles a step smaller, as before. */
@media (max-width: 1024px) {
	.sab-blog-card__title {
		font-size: 26px;
	}

	.sab-blog-posts__grid .sab-blog-card__title {
		font-size: 18px;
	}
}

/* Phones: one column, photo above the text. */
@media (max-width: 767px) {
	.sab-blog-card--lead,
	.sab-blog-posts__grid,
	.sab-blog-posts__grid .sab-blog-card {
		grid-template-columns: minmax(0, 1fr);
	}

	.sab-blog-card {
		row-gap: 20px;
	}

	.sab-blog-card__photo img {
		aspect-ratio: 351 / 300;
	}

	.sab-blog-posts__grid .sab-blog-card__photo img {
		aspect-ratio: 351 / 200;
	}

	.sab-blog-card__title {
		font-size: 24px;
	}

	.sab-blog-posts__grid {
		gap: calc(var(--sab-gap) * 1.5);
		margin-top: calc(var(--sab-gap) * 1.5);
	}
}
