/* Substack feed section and media badges. */

.feed-section {
	background: var(--paper);
}

.feed-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 30px;
	margin-bottom: 56px;

	.section-sub,
	.feed-intro {
		max-width: 657px;
		margin-bottom: 0;
	}

	@media (max-width: 767.98px) {
		align-items: flex-start;
		flex-direction: column;
		gap: 20px;
		margin-bottom: 32px;
	}
}

.feed-view-all {
	margin: 0;
	color: var(--bronze);
	font-size: 13px;
	letter-spacing: 0.08em;

	&::after {
		margin-left: 8px;
		color: var(--gold-mid);
		content: "→";
	}
}

/* Featured post left, two stacked posts right. */
.feed-grid {
	display: grid;
	grid-template-columns: minmax(0, 2.04fr) minmax(0, 1fr);
	gap: 2px;

	@media (max-width: 1279.98px) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	@media (max-width: 767.98px) {
		grid-template-columns: 1fr;
	}
}

.feed-card {
	display: flex;
	flex-direction: column;
	background: var(--white);

	&.featured {
		grid-row: span 2;

		@media (max-width: 1279.98px) {
			grid-column: 1 / -1;
			grid-row: auto;
		}
	}

	&:hover img {
		transform: scale(1.025);
	}

	time {
		display: block;
		margin-bottom: 10px;
		color: var(--slate);
		font-size: 11px;
		font-weight: 600;
		letter-spacing: 0.08em;
		text-transform: uppercase;
	}

	h3 {
		margin: 0 0 12px;
		color: var(--navy-nav);
		font-size: 22px;
		font-weight: 700;
		line-height: 1.6;

		a {
			text-decoration: none;
		}
	}

	p {
		display: -webkit-box;
		margin: 0;
		overflow: hidden;
		color: var(--slate);
		font-size: 15px;
		line-height: 1.6;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
	}
}

.feed-card-image {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--navy-mid);
	text-decoration: none;

	img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		transition: transform 0.35s ease;
	}

	/* Small cards share one fixed ratio; their body absorbs leftover height. */
	.feed-card:not(.featured) & {
		aspect-ratio: 420 / 200;
	}

	.featured & {
		aspect-ratio: 858 / 536;

		@media (max-width: 767.98px) {
			aspect-ratio: 16 / 9;
		}
	}

	@media (max-width: 767.98px) {
		.feed-card:not(.featured) & {
			aspect-ratio: 16 / 9;
		}
	}
}

.feed-image-fallback {
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, var(--navy), var(--navy-light));

	> span:first-child {
		color: rgb(255 255 255 / 28%);
		font: italic 18px var(--display);
	}
}

.feed-card-tag {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 1;
	padding: 4px 10px;
	background: var(--gold-light);
	color: var(--navy-nav);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.6;
	text-transform: uppercase;
}

.feed-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 24px;
}

.feed-card-link {
	margin-top: 20px;
	color: var(--bronze);
	font-size: 12px;
	letter-spacing: 0.06em;

	&::after {
		margin-left: 6px;
		color: var(--gold-mid);
		content: "→";
	}
}

.feed-empty {
	padding: 48px;
	background: var(--white);
	text-align: center;

	.btn-primary {
		margin-top: 14px;
	}
}

.media-badges {
	margin-top: 48px;
}

.media-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 22px;
	background: var(--navy-nav);
	color: rgb(255 255 255 / 75%);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease;

	svg {
		flex-shrink: 0;
	}

	strong {
		color: var(--gold-mid);
		font-weight: 700;
		transition: color 0.2s ease;
	}

	&:hover,
	&:focus-visible {
		background: var(--navy-mid);

		strong {
			color: var(--gold-light);
		}
	}

	&:active {
		background: var(--navy);

		strong {
			color: var(--gold);
		}
	}

	@media (max-width: 767.98px) {
		width: 100%;
		align-items: flex-start;
	}
}
