/*
 * Homepage below the hero: one showcase piece, four equal picks, then the
 * Latest list. Cards stay on the section index pages; the homepage keeps
 * to lighter forms. Narrow screens stack everything; from 52rem the
 * showcase text sits beside its image and the picks form one row.
 */
@layer entries {
	.home-label {
		margin: 0;
		color: var(--color-accent);
		font-family: var(--font-ui);
		font-size: 0.72rem;
		letter-spacing: 0.09em;
		text-transform: uppercase;
	}

	/* Each block is one link: the title's ::after covers the whole block. */
	.showcase,
	.home-pick,
	.latest-item {
		position: relative;
	}

	.showcase-title a::after,
	.home-pick-title a::after,
	.latest-item a::after {
		content: "";
		position: absolute;
		inset: 0;
	}

	.showcase:has(a:focus-visible),
	.home-pick:has(a:focus-visible),
	.latest-item:has(a:focus-visible) {
		outline: 2px solid var(--color-accent);
		outline-offset: 4px;
	}

	.showcase-title a,
	.home-pick-title a,
	.latest-item a {
		color: var(--color-text);
		text-decoration: none;
	}

	@media (hover: hover) {
		.showcase-title a:hover,
		.home-pick-title a:hover,
		.latest-item a:hover {
			text-decoration: underline;
			text-underline-offset: 0.2em;
		}
	}

	/* The banner keeps the covers' own 2.4:1 shape, so nothing is cropped. */
	.showcase-media {
		aspect-ratio: 2.4 / 1;
		margin-bottom: 1rem;
		overflow: hidden;
		border-radius: 0.6rem;
		background: var(--color-wash-1);
	}

	.showcase-media img,
	.home-pick-media img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.showcase .home-label {
		margin-bottom: 0.35rem;
	}

	.showcase-title {
		margin: 0 0 0.5rem;
		font-family: var(--font-reading);
		font-weight: 400;
		font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
		line-height: 1.2;
		text-wrap: balance;
	}

	.showcase-desc {
		margin: 0;
		max-width: 46ch;
		color: var(--color-muted);
		line-height: 1.55;
		/* Balance would split a just-over-two-line description into three short lines. */
		text-wrap: pretty;
	}

	.home-picks,
	.latest-list {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	/* Every pick takes the tallest pick's height, so the row reads as one. */
	.home-picks {
		display: grid;
		grid-template-columns: 1fr;
		grid-auto-rows: 1fr;
		gap: 1rem 1.5rem;
		margin-top: 1.75rem;
	}

	.home-pick {
		display: grid;
		grid-template-columns: 6rem 1fr;
		gap: 0.9rem;
		align-items: start;
		align-content: start;
		padding-top: 0.9rem;
		border-top: 1px solid var(--color-border);
	}

	.home-pick-media {
		aspect-ratio: 16 / 9;
		overflow: hidden;
		border-radius: 0.35rem;
		background: var(--color-wash-1);
	}

	/* Titles and descriptions stop at two lines to keep the picks equal. */
	.home-pick-title,
	.home-pick-desc {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}

	/*
	 * Balanced like the hero. Descriptions stay unbalanced: balancing a
	 * clamped line spreads the full text first and cuts more of it.
	 */
	.home-pick-title {
		margin: 0.2rem 0 0;
		font-family: var(--font-reading);
		font-weight: 400;
		font-size: 1.05rem;
		line-height: 1.3;
		text-wrap: balance;
	}

	.home-pick-desc {
		margin: 0.3rem 0 0;
		color: var(--color-muted);
		font-size: 0.86rem;
		line-height: 1.45;
	}

	.latest-list {
		border-bottom: 1px solid var(--color-border);
	}

	.latest-item {
		display: grid;
		grid-template-columns: 6.5rem 1fr;
		gap: 0.25rem 1rem;
		align-items: baseline;
		padding-block: 0.6rem;
		border-top: 1px solid var(--color-border);
	}

	.latest-item time {
		grid-row: span 2;
		color: var(--color-muted);
		font-size: 0.85rem;
		font-variant-numeric: tabular-nums;
	}

	.latest-section {
		color: var(--color-muted);
		font-family: var(--font-ui);
		font-size: 0.72rem;
		letter-spacing: 0.08em;
		text-transform: uppercase;
	}

	.latest-item a {
		font-family: var(--font-reading);
		font-size: 1.05rem;
	}
}

@layer responsive {
	@media (min-width: 42rem) {
		.latest-item {
			grid-template-columns: 7rem 9rem 1fr;
		}

		.latest-item time {
			grid-row: auto;
		}
	}

	@media (min-width: 52rem) {
		/* The text block centres beside the image in the spare rows. */
		.showcase {
			display: grid;
			grid-template-columns: 3fr 2fr;
			grid-template-rows: 1fr auto auto auto 1fr;
			column-gap: 2.5rem;
		}

		.showcase-media {
			grid-column: 1;
			grid-row: 1 / -1;
			margin: 0;
		}

		.showcase .home-label,
		.showcase-title,
		.showcase-desc {
			grid-column: 2;
		}

		.showcase .home-label {
			grid-row: 2;
		}

		.showcase-title {
			grid-row: 3;
		}

		.showcase-desc {
			grid-row: 4;
		}

		.home-picks {
			grid-template-columns: repeat(4, 1fr);
		}

		.home-pick {
			grid-template-columns: 1fr;
			grid-template-rows: auto 1fr;
			gap: 0.6rem;
		}

		/*
		 * Descriptions sit on the pick's bottom edge in a two-line slot,
		 * so a one-line title moves no description out of line.
		 */
		.home-pick-text {
			display: flex;
			flex-direction: column;
			align-self: stretch;
		}

		.home-pick-desc {
			min-height: 2.9em;
			margin-top: auto;
			padding-top: 0.3rem;
		}
	}
}
