/*
 * The home page hero: the latest edition (inc/edition-hero.php).
 *
 * Colours come from the edition, as --tl-hero-from and --tl-hero-to on the
 * section. Poppins for the words, and Brooklyn Destiny (assets/fonts.css), the
 * handwriting on the magazine's own cover, for the handwritten lines.
 */
.tl-hero-wrap {
	width: 100%;
}

.tl-hero {
	--tl-hero-from: #1f3a68;
	--tl-hero-to: #152a4d;
	position: relative;
	overflow: hidden;
	/* The second colour is reached beyond the far corner, so a dark one never
	   runs all the way to black at the bottom right. */
	background: linear-gradient(135deg, var(--tl-hero-from) 0%, var(--tl-hero-to) 160%);
	color: #fff;
	font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.tl-hero *,
.tl-hero *::before,
.tl-hero *::after {
	box-sizing: border-box;
}

.tl-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 3rem;
	align-items: center;
	max-width: 76rem;
	margin: 0 auto;
	padding: clamp(4.5rem, 9vw, 8rem) 1.25rem;
}

@media (min-width: 900px) {
	.tl-hero__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
		gap: 4rem;
		padding-left: 2.5rem;
		padding-right: 2.5rem;
	}
}

.tl-hero__kicker {
	display: inline-block;
	margin: 0;
	padding: 0.65rem 1.5rem;
	border: 1.5px solid rgba(255, 255, 255, 0.5);
	border-radius: 999px;
	font-size: clamp(0.95rem, 1.4vw, 1.125rem);
	font-weight: 500;
	line-height: 1.3;
}

.tl-hero__heading {
	margin: 1.75rem 0 0;
	color: #fff;
	font-family: inherit;
	font-size: clamp(3.25rem, 9vw, 6.5rem);
	font-weight: 500;
	line-height: 0.9;
	letter-spacing: -0.015em;
}

.tl-hero__script {
	display: block;
	/* The handwriting's own line spacing is generous: pull it up to the line above. */
	margin-top: -0.2em;
	font-family: var(--tl-font-script, "Brooklyn Destiny", cursive);
	font-size: 1.12em;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 0.95;
}

.tl-hero__intro {
	max-width: 32rem;
	margin: 1.75rem 0 0;
	color: rgba(255, 255, 255, 0.85);
	font-size: clamp(1.05rem, 1.6vw, 1.3rem);
	line-height: 1.55;
}

.tl-hero__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.875rem;
	margin-top: 2.25rem;
}

.tl-hero__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3.5rem;
	padding: 0.85rem 1.85rem;
	border: 2px solid #fff;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.tl-hero__button--primary {
	background: #fff;
	color: var(--tl-hero-from);
}

.tl-hero__button--primary:hover {
	background: rgba(255, 255, 255, 0.88);
	color: var(--tl-hero-from);
}

.tl-hero__button--secondary {
	background: transparent;
	color: #fff;
}

.tl-hero__button--secondary:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.tl-hero__button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.tl-hero__quote {
	max-width: 27rem;
	margin: 2.75rem 0 0;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.tl-hero__quote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
}

.tl-hero__quote p {
	margin: 0;
	color: #fff;
	font-family: var(--tl-font-poppins, "Poppins", sans-serif);
	font-size: clamp(1.05rem, 1.5vw, 1.25rem);
	font-weight: 400;
	line-height: 1.5;
}

.tl-hero__quote figcaption {
	margin-top: 0.6rem;
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.9rem;
	font-weight: 600;
}

/* The covers: the latest in front, tilted a little; the one before behind it. */
.tl-hero__covers {
	position: relative;
	justify-self: center;
	width: min(100%, 38rem);
	/* Tall enough for the back cover, which sits lower than the front one. */
	aspect-ratio: 1 / 1.1;
}


.tl-hero__cover {
	position: absolute;
	width: 70%;
	height: auto;
	border-radius: 3px;
	box-shadow: 0 30px 60px -18px rgba(0, 0, 0, 0.6), 0 12px 24px -12px rgba(0, 0, 0, 0.4);
}

.tl-hero__cover--current {
	top: 1%;
	right: 3%;
	z-index: 2;
	transform: rotate(2.5deg);
}

/* One cover on its own (an edition's page): the same size as the front cover
   on the home page, centred where the pair would be. */
.tl-hero__covers--single .tl-hero__cover--current {
	right: auto;
	left: 50%;
	transform: translateX(-50%) rotate(2.5deg);
}

.tl-hero__cover--previous {
	top: 10%;
	left: 3%;
	transform: rotate(-6deg);
	filter: saturate(0.85) brightness(0.92);
}

@media (max-width: 899px) {
	.tl-hero__covers {
		width: min(100%, 24rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tl-hero__button {
		transition: none;
	}
}

/* The quote: beside the buttons on a wide screen, below the colour on a phone. */
.tl-hero__quote--below {
	display: none;
}

/* Phones and small tablets: covers first, buttons full width, quote on white. */
@media (max-width: 899px) {
	.tl-hero__inner {
		gap: 2.25rem;
		padding-top: 3.5rem;
		padding-bottom: 4rem;
	}

	.tl-hero__covers {
		order: -1;
		width: min(96%, 24rem);
	}

	.tl-hero__heading {
		margin-top: 1.25rem;
		font-size: clamp(3rem, 14vw, 4.25rem);
	}

	.tl-hero__intro {
		margin-top: 1.25rem;
	}

	.tl-hero__buttons {
		flex-direction: column;
		margin-top: 1.75rem;
	}

	.tl-hero__button {
		width: 100%;
	}

	.tl-hero__quote--beside {
		display: none;
	}

	.tl-hero__quote--below {
		display: block;
		max-width: none;
		margin: 0;
		padding: 2rem 1.25rem 2.25rem;
		border-top: 0;
		background: #fff;
	}

	.tl-hero__quote--below p {
		color: var(--tl-hero-from, #1f3a68);
	}

	.tl-hero__quote--below figcaption {
		color: #78716c;
	}
}

/*
 * Wide screens: bigger covers that run past the bottom of the colour. The
 * cover column is wider than the text column and the covers reach beyond it;
 * negative margins keep them from making the band taller, and the overhang
 * simply lies over the top of the next section, which stays where it is.
 */
@media (min-width: 900px) {
	.tl-hero-wrap {
		position: relative;
		z-index: 2;
	}

	.tl-hero {
		overflow-x: clip;
		overflow-y: visible;
	}

	.tl-hero__inner {
		grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
	}

	.tl-hero__covers {
		justify-self: start;
		width: 112%;
		max-width: 50rem;
		margin-top: -2rem;
		margin-bottom: -15rem;
		/* Up a little, so only the bottom few centimetres hang over. */
		transform: translateY(-3.5rem);
	}

	.tl-hero__cover {
		width: 72%;
	}
}


/* The handwritten line above the heading, when the edition says so. */
.tl-hero__script--above {
	margin-top: 0;
	margin-bottom: -0.16em;
}

/* The Poppins line smaller than the handwriting beside it, and a weight
   lighter, the same on the home page and on an edition's page. */
.tl-hero__main {
	display: block;
	font-size: 0.78em;
	font-weight: 500;
	line-height: 1.02;
	letter-spacing: -0.01em;
}

/* Wide screens: a single cover sits as low as the back cover of the pair, so
   it hangs over the edge of the band by the same amount. */
@media (min-width: 900px) {
	.tl-hero__covers--single .tl-hero__cover--current {
		top: 9%;
	}
}

/*
 * The reasons to read below the home page hero ([lutheran_highlight]s inside
 * [lutheran_edition_hero]): a pale band of the edition's colour, an icon in
 * the edition's colour beside each heading, Poppins headings in a deep shade of
 * the same colour.
 */
.tl-highlights {
	position: relative;
	z-index: 0;
	background: var(--tl-highlights-bg, #eef2f7);
	color: #44403c;
	font-family: var(--tl-font-poppins, "Poppins", sans-serif);
	-webkit-font-smoothing: antialiased;
}

.tl-highlights *,
.tl-highlights *::before,
.tl-highlights *::after {
	box-sizing: border-box;
}

.tl-highlights__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.5rem;
	max-width: 76rem;
	margin: 0 auto;
	padding: 3.5rem 1.25rem;
}

@media (min-width: 768px) {
	.tl-highlights__inner {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 3rem;
	}
}

@media (min-width: 900px) {
	.tl-highlights__inner {
		padding: clamp(2.75rem, 6.5vh, 4.5rem) 2.5rem;
	}
}

/* The icon on its own, in the edition's colour. */
.tl-highlight__icon {
	display: inline-flex;
	color: var(--tl-hero-from, #1f3a68);
}

.tl-highlight__icon svg {
	width: 2.25rem;
	height: 2.25rem;
}

.tl-highlight__title {
	margin: 1.1rem 0 0;
	color: var(--tl-highlights-ink, #1f3a68);
	font-family: var(--tl-font-poppins, "Poppins", sans-serif);
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.005em;
}

.tl-highlight__text {
	margin: 1rem 0 0;
	font-size: 1rem;
	line-height: 1.6;
}

.tl-highlight__text a {
	color: var(--tl-highlights-ink, #1f3a68);
}

/* The icon beside its heading, the words underneath both. */
.tl-highlight {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 1rem;
	align-items: center;
	/* From the top, whatever the neighbours' lengths: the band stretches every
	   column to the tallest, and that space must not open up between the rows. */
	align-content: start;
}

.tl-highlight__title {
	margin-top: 0;
}

.tl-highlight__text {
	grid-column: 1 / -1;
}

/*
 * Wide screens: the home page hero fills the screen under the header (and
 * the admin bar, when it shows), up to 55rem: about what a 1080p screen
 * leaves, so on a very tall screen it does not become a wall of colour. Its
 * words sit in the middle of that height.
 *
 * The covers sit on the bottom of the hero, so they always end at the same
 * place, about at its bottom edge, whatever the height: clear of the icons.
 */
@media (min-width: 900px) {
	.tl-hero-wrap--screen > .tl-hero {
		--tl-screen-pad: clamp(3rem, 6vh, 5rem);
		z-index: 1;
		display: flex;
		min-height: min(calc(100vh - 4.5rem - 1px - var(--wp-admin--admin-bar--height, 0px)), 55rem);
		min-height: min(calc(100svh - 4.5rem - 1px - var(--wp-admin--admin-bar--height, 0px)), 55rem);
	}

	.tl-hero-wrap--screen .tl-hero__inner {
		width: 100%;
		align-items: stretch;
		padding-top: var(--tl-screen-pad);
		padding-bottom: var(--tl-screen-pad);
	}

	.tl-hero-wrap--screen .tl-hero__text {
		align-self: center;
	}

	.tl-hero-wrap--screen .tl-hero__covers {
		align-self: end;
		/* Their foot about at the hero's edge (the tilt takes a corner past it), after the 3.5rem lift. */
		margin-bottom: calc(-3rem - var(--tl-screen-pad));
	}

	.tl-hero-wrap--screen .tl-highlights__inner {
		padding-top: 5.5rem;
		padding-bottom: 4.5rem;
	}
}
