/**
 * "Read also" band after the article, and the overview list of the posts page, archives and search.
 *
 * @package DeWittePrins\Theme
 * @since   0.1.0
 */

.read-also.read-also {
	margin-top: var(--wp--preset--spacing--80);
	padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--soft);
}

.read-also__title {
	margin-top: 0;
}

.read-also__list {
	gap: var(--wp--preset--spacing--40);
}

.read-also__card {
	height: 100%;
	box-sizing: border-box;
	border: 1px solid var(--wp--custom--color--line);
}

.read-also__card-title {
	margin-top: var(--wp--preset--spacing--10);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: 1.35;
}

.read-also__card-title a {
	text-decoration: none;
}

.read-also__card-title a:hover {
	text-decoration: underline;
}

/*
 * Overview list (posts page, archives, search): one calm column of rows, photo and text side by
 * side. The whole row is one link through the title; category links stay clickable above it.
 */
.wp-block-query.overview {
	margin-block-start: var(--wp--preset--spacing--70);
}

.overview .card-row {
	position: relative;
	display: grid;
	grid-template-columns: 15rem minmax(0, 1fr);
	gap: 2rem;
	align-items: center;
	padding-block: var(--wp--preset--spacing--50);
}

.overview .card-row:not(:has(.card-row__image)) {
	grid-template-columns: minmax(0, 1fr);
}

.overview .card-row > * {
	margin: 0;
}

.overview .card-row__image {
	position: relative;
	overflow: hidden;
	border-radius: var(--wp--preset--border-radius--small);
	background: var(--wp--preset--color--soft);
}

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

.overview .card-row__text > * {
	margin-block: 0;
}

.overview .card-row__title {
	margin-block-end: var(--wp--preset--spacing--20);
	font-size: clamp(1.0625rem, 0.9rem + 0.6vw, 1.375rem);
	font-weight: 560;
	line-height: 1.3;
}

.overview .card-row__title a {
	text-decoration: none;
}

.overview .card-row__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
}

.overview .card-row__title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.overview .card-row__title a:focus-visible {
	outline: none;
}

.overview .card-row__title a:focus-visible::after {
	outline: 3px solid var(--wp--custom--color--ring);
	outline-offset: 2px;
	border-radius: var(--wp--preset--border-radius--small);
}

.overview .card-row__excerpt {
	margin-block-end: var(--wp--preset--spacing--20);
}

.overview .card-row__excerpt .wp-block-post-excerpt__excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.overview .card-row__excerpt .wp-block-post-excerpt__more-text {
	display: none;
}

/* Meta: kind, category and reading time on one line, separated by a dot. */
.overview .card-row__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 0.875rem;
	color: var(--wp--preset--color--muted);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.overview .card-row__meta > * {
	margin: 0;
	font-size: inherit;
}

.overview .card-row__meta > :not(:last-child)::after {
	content: "·";
	content: "·" / ""; /* Silent for screen readers where the browser knows the alt syntax. */
	margin-inline-start: 0.875rem;
}

.overview .card-row__meta a {
	position: relative;
	z-index: 1;
	color: inherit;
}

/* The kind only helps where the list mixes kinds: in search results. */
body:not(.search) .overview .card-row__kind,
.overview .card-row__kind:empty {
	display: none;
}

.overview .card-row__kind {
	color: var(--wp--preset--color--kicker);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Video and audio get a round play mark on their picture. */
.overview :is(.format-video, .format-audio) .card-row__image::after {
	content: "";
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	inline-size: 3rem;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--wp--preset--color--plane) no-repeat 55% 50% / 1.25rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27%23F5F1EA%27%3E%3Cpath d=%27M7 4.5v15l12-7.5z%27/%3E%3C/svg%3E");
	transform: translate(-50%, -50%);
}

/* The newest item on the first page: wider, with a large photo above the text. Not in search results,
 * where the first item is the best match, not the newest. */
body:not(.paged, .search) .overview .overview-list > li:first-child .card-row {
	display: block;
	padding-block: 0 var(--wp--preset--spacing--50);
}

body:not(.paged, .search) .overview .overview-list > li:first-child .card-row__image img {
	aspect-ratio: auto;
	block-size: clamp(13.75rem, 8rem + 22vw, 29.375rem);
}

body:not(.paged, .search) .overview .overview-list > li:first-child .card-row__image {
	margin-block-end: var(--wp--preset--spacing--60);
	border-radius: var(--wp--preset--border-radius--large);
}

body:not(.paged, .search) .overview .overview-list > li:first-child .card-row__title {
	max-inline-size: 51.25rem;
	margin-block-end: var(--wp--preset--spacing--40);
	font-size: clamp(1.6875rem, 1.2rem + 1.8vw, 2.625rem);
	font-weight: 360;
	line-height: 1.15;
}

body:not(.paged, .search) .overview .overview-list > li:first-child .card-row__excerpt {
	max-inline-size: 42.5rem;
	font-size: var(--wp--preset--font-size--large);
}

@media (min-width: 70rem) {
	body:not(.paged, .search) .overview .overview-list > li:first-child {
		margin-inline: calc((var(--wp--custom--layout--list) - var(--wp--style--global--wide-size)) / 2);
		margin-block-end: var(--wp--preset--spacing--60);
	}
}

@media (max-width: 47.99rem) {
	/* The photo never takes more than a third, so a large text setting keeps room for the words. */
	.overview .card-row {
		grid-template-columns: min(6rem, 33%) minmax(0, 1fr);
		gap: 0.875rem;
		align-items: start;
		padding-block: 0.875rem;
	}

	.overview .card-row__text {
		overflow-wrap: break-word;
	}

	.overview .card-row__image img {
		aspect-ratio: 1;
	}

	.overview .card-row__excerpt {
		font-size: var(--wp--preset--font-size--small);
	}

	.overview :is(.format-video, .format-audio) .card-row__image::after {
		inline-size: 2.375rem;
		background-size: 1rem;
	}
}

/* Back to the start of the list, above the list on a page further on. */
.overview .overview-start {
	margin-block: 0 var(--wp--preset--spacing--40);
	font-weight: 600;
}

.overview .overview-start a::before {
	content: "\2190\00a0" / "";
}
