/* Hero: three layouts (full / side / wide), see CHANGE-hero-layouts.md.
   --lop-header-h (style.css) is the sticky header's real height, used
   by every "fit near the first screen" formula below. */

.hero {
	display: block;
}

/* full: natural proportions, no cropping, centered in the page column.
   Default for landscape/square covers. */

.hero--full {
	max-width: 1360px;
	margin: 16px auto 0;
	box-sizing: border-box;
	padding: 0 20px;
	text-align: center;
}

@media ( min-width: 640px ) {
	.hero--full {
		margin-top: 24px;
		padding: 0 40px;
	}
}

.hero--full .hero__img {
	display: inline-block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 70svh;
	transition: opacity 0.6s ease;
}

@media ( min-width: 640px ) and ( max-width: 959px ) {
	.hero--full .hero__img {
		max-height: max( 360px, calc( 100svh - var( --lop-header-h ) - 330px ) );
	}
}

@media ( min-width: 960px ) {
	.hero--full .hero__img {
		max-height: max( 420px, calc( 100svh - var( --lop-header-h ) - 280px ) );
	}
}

.hero--full:hover .hero__img {
	opacity: 0.94;
}

/* wide: edge-to-edge, cropped. Previous (and still available) default. */

.hero--wide {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: var( --wp--preset--color--surface );
	height: calc( 100svh - var( --lop-header-h ) - 230px );
}

@media ( min-width: 640px ) and ( max-width: 959px ) {
	.hero--wide {
		height: min( 56.25vw, max( 380px, calc( 100svh - var( --lop-header-h ) - 300px ) ) );
	}
}

@media ( min-width: 960px ) {
	.hero--wide {
		height: min( 56.25vw, max( 420px, calc( 100svh - var( --lop-header-h ) - 250px ) ) );
	}
}

.hero--wide .hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.6s ease, transform 1.6s cubic-bezier( 0.2, 0.7, 0.2, 1 );
}

.hero--wide:hover .hero__img {
	opacity: 0.94;
	transform: scale( 1.015 );
}

/* side: image beside the title/meta column. Default for portrait covers. */

.hero--side {
	max-width: 1360px;
	margin: 0 auto;
	box-sizing: border-box;
	padding: 16px 20px 0;
	display: flex;
	flex-direction: column;
	gap: 28px;
}

@media ( min-width: 640px ) {
	.hero--side {
		padding: 24px 40px 0;
	}
}

/* Side by side only from 960px: on tablets the text column got so narrow
   that the eyebrow broke into four lines; below 960px it stacks.
   The text sits next to the image, centred on its height rather than
   pinned to its bottom edge (client decision). */
@media ( min-width: 960px ) {
	.hero--side {
		flex-direction: row;
		align-items: center;
		gap: 64px;
	}
}

.hero--side__image {
	display: block;
}

.hero--side__image .hero__img {
	display: block;
	margin: 0 auto;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 72svh;
	transition: opacity 0.6s ease;
}

@media ( min-width: 960px ) {
	.hero--side__image {
		flex: none;
		max-width: 62%;
	}

	.hero--side__image .hero__img {
		margin: 0;
		height: max( 480px, min( calc( 100svh - var( --lop-header-h ) - 48px ), 980px ) );
		width: auto;
		max-width: 100%;
		max-height: none;
		object-fit: cover;
	}
}

.hero--side__image:hover .hero__img {
	opacity: 0.94;
}

.hero--side__text {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 28px;
	max-width: 560px;
}

/* Hero meta row: title + eyebrow/excerpt/link */

.home-meta {
	max-width: 1360px;
	margin: 0 auto;
	box-sizing: border-box;
	padding: 24px 20px 0;
	display: grid;
	grid-template-columns: minmax( 0, 1fr );
	gap: 28px 24px;
	align-items: start;
}

@media ( min-width: 640px ) {
	.home-meta {
		padding: 32px 40px 0;
	}
}

@media ( min-width: 960px ) {
	.home-meta {
		grid-template-columns: repeat( 12, minmax( 0, 1fr ) );
	}
}

.home-meta__title-row {
	grid-column: 1 / -1;
	margin: 0;
}

@media ( min-width: 960px ) {
	.home-meta__title-row {
		grid-column: 1 / span 8;
	}
}

.home-meta__title {
	display: block;
	font-size: 34px;
	line-height: 1;
	font-weight: 500;
	letter-spacing: -0.035em;
	text-wrap: balance;
	color: var( --wp--preset--color--foreground );
	text-decoration: none;
}

@media ( min-width: 640px ) and ( max-width: 959px ) {
	.home-meta__title {
		font-size: clamp( 40px, 5.6vw, 52px );
	}
}

@media ( min-width: 960px ) {
	.home-meta__title {
		font-size: clamp( 44px, 4.4vw, 64px );
	}
}

.home-meta__info {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding-bottom: 6px;
	max-width: 400px;
}

@media ( min-width: 960px ) {
	.home-meta__info {
		grid-column: 9 / span 4;
	}
}

.home-meta__eyebrow {
	display: flex;
	gap: 12px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #8d8c87;
}

.home-meta__sep {
	color: #4a4a47;
}

.home-meta__date {
	color: var( --wp--preset--color--accent );
}

.home-meta__excerpt {
	margin: 0;
	font-size: 16px;
	line-height: 1.55;
	color: var( --wp--preset--color--foreground-secondary );
	text-wrap: pretty;
}

.home-meta__link {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	margin-top: 4px;
	color: var( --wp--preset--color--foreground );
	text-decoration: none;
	transition: color 0.25s ease;
}

.home-meta__link:hover {
	color: #ffffff;
}

/* Spacer where the design's "Zygapolis..." row would sit in variants A/B */

.home-spacer {
	height: 80px;
}

@media ( min-width: 640px ) {
	.home-spacer {
		height: 120px;
	}
}

/* "Previous stories" row */

.home-row {
	max-width: 1360px;
	margin: 0 auto;
	box-sizing: border-box;
	padding: 0 20px;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 40px;
}

@media ( min-width: 640px ) {
	.home-row {
		padding: 0 40px;
	}
}

.home-row__title {
	margin: 0;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #8d8c87;
}

.home-row__all {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #8d8c87;
	text-decoration: none;
	transition: color 0.25s ease;
}

.home-row__all:hover {
	color: #ffffff;
}

/* Editorial grid */

.cards-grid {
	max-width: 1360px;
	margin: 0 auto;
	box-sizing: border-box;
	padding: 0 20px;
	display: grid;
	grid-template-columns: minmax( 0, 1fr );
	gap: 56px 24px;
}

@media ( min-width: 640px ) {
	.cards-grid {
		padding: 0 40px;
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
		gap: 88px 24px;
	}
}

@media ( min-width: 960px ) {
	.cards-grid {
		grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	}
}

.cards-grid__item {
	display: flex;
	flex-direction: column;
	gap: 16px;
	text-decoration: none;
}

.cards-grid__thumb {
	overflow: hidden;
	background: var( --wp--preset--color--surface );
	aspect-ratio: 4 / 3;
}

@media ( min-width: 960px ) {
	.cards-grid__thumb {
		aspect-ratio: 3 / 4;
	}
}

.cards-grid__thumb .cover-image__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.6s ease, transform 1.4s cubic-bezier( 0.2, 0.7, 0.2, 1 );
}

.cards-grid__item:hover .cover-image__img {
	opacity: 0.9;
	transform: scale( 1.025 );
}

.cards-grid__text {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 640px;
}

.cards-grid__title {
	font-size: 20px;
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var( --wp--preset--color--foreground );
	text-wrap: pretty;
}

.cards-grid__date {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var( --wp--preset--color--accent );
}

/* Tablet: every 3rd card ("mid") is wider with a landscape crop */

@media ( min-width: 640px ) and ( max-width: 959px ) {
	.cards-grid__item:nth-child( 3n + 1 ) {
		grid-column: span 2;
	}

	.cards-grid__item:nth-child( 3n + 1 ) .cards-grid__thumb {
		aspect-ratio: 3 / 2;
	}

	.cards-grid__item:nth-child( 3n + 1 ) .cards-grid__title {
		font-size: 28px;
	}
}

/* Desktop: checkerboard "big" cards, plus a lone trailing card */

@media ( min-width: 960px ) {
	.cards-grid__item:nth-child( 4n + 1 ),
	.cards-grid__item:nth-child( 4n ) {
		grid-column: span 2;
	}

	.cards-grid__item:nth-child( 4n + 1 ) .cards-grid__thumb,
	.cards-grid__item:nth-child( 4n ) .cards-grid__thumb {
		aspect-ratio: 3 / 2;
	}

	.cards-grid__item:nth-child( 4n + 1 ) .cards-grid__title,
	.cards-grid__item:nth-child( 4n ) .cards-grid__title {
		font-size: 28px;
	}

	.cards-grid__item.is-solo-last {
		grid-column: span 2;
	}

	.cards-grid__item.is-solo-last .cards-grid__thumb {
		aspect-ratio: 3 / 2;
	}

	.cards-grid__item.is-solo-last .cards-grid__title {
		font-size: 28px;
	}
}

/* More stories / Full archive */

.home-more {
	max-width: 1360px;
	margin: 80px auto 0;
	box-sizing: border-box;
	padding: 0 20px;
	display: flex;
	justify-content: flex-start;
	gap: 32px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

@media ( min-width: 640px ) {
	.home-more {
		padding: 0 40px;
		margin-top: 112px;
	}
}

.home-more__button {
	color: var( --wp--preset--color--foreground );
	text-decoration: none;
	cursor: pointer;
	transition: color 0.25s ease;
}

.home-more__button:hover {
	color: #ffffff;
}

.home-more__archive {
	color: #8d8c87;
	text-decoration: none;
	transition: color 0.25s ease;
}

.home-more__archive:hover {
	color: #ffffff;
}

.home-empty {
	max-width: 1360px;
	margin: 0 auto;
	box-sizing: border-box;
	padding: 120px 20px;
	text-align: center;
	color: var( --wp--preset--color--foreground-secondary );
}
