/**
 * Homepage layout — loaded only on the front page / posts index.
 * Tokens, cards, pills, plates and section heads all live in style.css.
 */

/* ==========================================================================
   Section rhythm
   ========================================================================== */

.lead {
	padding-block: var(--space-6);
	border-bottom: 1px solid var(--color-line);
}

.home-latest,
.home-empty,
.index-listing {
	padding-block: var(--space-7);
}

.home-topics {
	padding-bottom: var(--space-8);
}

/* ==========================================================================
   Lead story — mobile: plate above the text
   ========================================================================== */

.lead__inner {
	display: grid;
	gap: var(--space-5);
}

.lead__media {
	display: block;
}

.lead__media .duotone-plate {
	aspect-ratio: 16 / 9;
}

.lead__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lead__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-3);
}

.lead__title {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: var(--text-2xl);
	line-height: 1.04;
	letter-spacing: -0.02em;
	margin: 0;
}

.lead__title a {
	color: var(--color-ink);
	text-decoration: none;
}

.lead__title a:hover,
.lead__title a:focus {
	color: var(--color-signal);
}

.lead__dek {
	font-size: var(--text-md);
	line-height: 1.5;
	color: var(--color-ink-soft);
	max-width: 46ch;
	margin: 0;
}

.lead__meta {
	margin-top: var(--space-2);
}

@media (min-width: 900px) {
	.lead {
		padding-block: var(--space-7) var(--space-8);
	}

	.lead__inner {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
		gap: var(--space-7);
		align-items: center;
	}

	/* no featured image: let the text run the full width instead of half of it */
	.lead__body:only-child {
		grid-column: 1 / -1;
	}
}

/* ==========================================================================
   Topic pills — scroll sideways on narrow screens, wrap once there's room
   ========================================================================== */

.topic-pills {
	flex-wrap: nowrap;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
	padding-bottom: var(--space-2);
}

.topic-pills > li {
	flex: none;
}

@media (min-width: 640px) {
	.topic-pills {
		flex-wrap: wrap;
		overflow-x: visible;
		padding-bottom: 0;
	}
}
