/*
 * The editions on the WordPress site (inc/editions.php): story cards from an
 * edition, the carousel of past editions, and an edition's own page. Set in
 * Poppins like the hero; each edition's colour comes in as --tl-accent or
 * --tl-edition-colour.
 */

.tl-stories,
.tl-archive,
.tl-cta {
	--tl-accent: #1f3a68;
	box-sizing: border-box;
	font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.tl-stories *,
.tl-archive *,
.tl-cta * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------- stories -- */

.tl-stories {
	width: 100%;
	background: #ffffff;
	color: #1c1917;
}

.tl-stories__inner {
	max-width: 76rem;
	margin: 0 auto;
	padding: clamp(4.5rem, 9vw, 7.5rem) 1.25rem;
}

@media (min-width: 900px) {
	.tl-stories__inner {
		padding-left: 2.5rem;
		padding-right: 2.5rem;
	}
}

.tl-stories__header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem 2rem;
	margin-bottom: 2.25rem;
}

.tl-stories__kicker,
.tl-archive__kicker {
	margin: 0 0 0.35rem;
	color: var(--tl-accent);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.tl-stories__heading {
	margin: 0;
	color: #1c1917;
	font-family: var(--tl-font-poppins, "Poppins", sans-serif);
	font-size: clamp(1.6rem, 2.8vw, 2.15rem);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.1;
}

.tl-stories__all {
	color: var(--tl-accent);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
}

.tl-stories__all:hover {
	text-decoration: underline;
}

.tl-stories__empty {
	margin: 0;
	color: #57534e;
	font-size: 1.05rem;
}

.tl-stories__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
	gap: 2.5rem 2rem;
}

.tl-story {
	display: flex;
	flex-direction: column;
}

.tl-story__link {
	display: flex;
	flex: 1;
	flex-direction: column;
	color: inherit;
	text-decoration: none;
}

.tl-story__media {
	overflow: hidden;
	aspect-ratio: 3 / 2;
	border-radius: 0.75rem;
	background: #e7e5e4;
}

.tl-story__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms ease;
}

.tl-story__link:hover .tl-story__media img {
	transform: scale(1.04);
}

.tl-story__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding-top: 1.25rem;
}

.tl-story__section {
	margin: 0 0 0.5rem;
	color: var(--tl-accent);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.tl-story__title {
	margin: 0;
	color: #1c1917;
	font-family: inherit;
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.25;
}

.tl-story__link:hover .tl-story__title {
	color: var(--tl-accent);
}

.tl-story__byline {
	margin: 0.4rem 0 0;
	color: #78716c;
	font-size: 0.875rem;
	font-weight: 400;
}

.tl-story__excerpt {
	display: -webkit-box;
	overflow: hidden;
	margin: 0.75rem 0 0;
	color: #57534e;
	font-size: 1rem;
	/* Regular, whatever the card's link or the page builder sets around it. */
	font-weight: 400;
	line-height: 1.6;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
}

.tl-story__more {
	margin-top: auto;
	padding-top: 1rem;
	color: var(--tl-accent);
	font-size: 0.95rem;
	font-weight: 600;
}

.tl-story__credit {
	margin: 0.5rem 0 0;
	color: #a8a29e;
	font-size: 0.7rem;
}

.tl-story__link:focus-visible,
.tl-stories__all:focus-visible {
	outline: 3px solid var(--tl-accent);
	outline-offset: 4px;
	border-radius: 0.75rem;
}

/* ------------------------------------------------------ past editions -- */

.tl-archive {
	width: 100%;
	background: linear-gradient(180deg, #152a4d 0%, #0f1f3a 100%);
	color: #ffffff;
}

.tl-archive__inner {
	max-width: 76rem;
	margin: 0 auto;
	padding: clamp(4.5rem, 9vw, 7rem) 1.25rem;
}

@media (min-width: 900px) {
	.tl-archive__inner {
		padding-left: 2.5rem;
		padding-right: 2.5rem;
	}
}

.tl-archive__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.tl-archive__kicker {
	color: rgba(255, 255, 255, 0.65);
}

.tl-archive__heading {
	margin: 0;
	color: #ffffff;
	font-family: var(--tl-font-poppins, "Poppins", sans-serif);
	font-size: clamp(1.6rem, 2.8vw, 2.15rem);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.1;
}

.tl-archive__controls {
	display: flex;
	gap: 0.5rem;
}

.tl-archive--static .tl-archive__controls {
	visibility: hidden;
}

.tl-archive__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.9rem;
	height: 2.9rem;
	border: 1.5px solid rgba(255, 255, 255, 0.45);
	border-radius: 999px;
	background: transparent;
	color: #ffffff;
	font-size: 1.15rem;
	cursor: pointer;
	transition: background-color 150ms ease, opacity 150ms ease;
}

.tl-archive__button:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.12);
}

.tl-archive__button:disabled {
	opacity: 0.35;
	cursor: default;
}

.tl-archive__button:focus-visible,
.tl-archive__track:focus-visible,
.tl-archive__link:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 3px;
}

/*
 * The row shows a whole number of covers, never one cut off at the edge: two
 * on a phone, then three, four and five as the screen widens. The arrows move
 * a whole row at a time.
 */
.tl-archive__track {
	--tl-per-view: 2;
	--tl-gap: clamp(1.25rem, 2.5vw, 2rem);
	display: flex;
	gap: var(--tl-gap);
	margin: 0;
	/* Room at the sides for the current edition's outline. */
	padding: 0.75rem 8px 1.5rem;
	scroll-padding-inline: 8px;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.tl-archive__track::-webkit-scrollbar {
	display: none;
}

@media (min-width: 640px) {
	.tl-archive__track {
		--tl-per-view: 3;
	}
}

@media (min-width: 900px) {
	.tl-archive__track {
		--tl-per-view: 4;
	}
}

@media (min-width: 1200px) {
	.tl-archive__track {
		--tl-per-view: 5;
	}
}

.tl-archive__item {
	flex: 0 0 calc((100% - (var(--tl-per-view) - 1) * var(--tl-gap)) / var(--tl-per-view));
	margin: 0;
	padding: 0;
	scroll-snap-align: start;
}

.tl-archive__link {
	display: block;
	color: #ffffff;
	text-decoration: none;
	border-radius: 4px;
}

.tl-archive__cover {
	position: relative;
	display: block;
	aspect-ratio: 760 / 1064;
	overflow: hidden;
	border-radius: 3px;
	background: var(--tl-edition-colour, #1f3a68);
	box-shadow: 0 18px 36px -14px rgba(0, 0, 0, 0.65);
	transition: transform 200ms ease, box-shadow 200ms ease;
}

.tl-archive__link:hover .tl-archive__cover {
	transform: translateY(-6px);
	box-shadow: 0 26px 44px -16px rgba(0, 0, 0, 0.7);
}

.tl-archive__link--current .tl-archive__cover {
	outline: 3px solid #ffffff;
	outline-offset: 4px;
}

.tl-archive__cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* An edition with no cover yet: the masthead and the edition, in its colour. */
.tl-archive__placeholder {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
	padding: 1rem 0.9rem;
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.2));
}

.tl-archive__placeholder-mark {
	font-size: 1.45rem;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.02em;
}

.tl-archive__placeholder-label {
	font-size: 0.85rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.8);
}

.tl-archive__badge {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	background: #ffffff;
	color: #1f3a68;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.tl-archive__label {
	display: block;
	margin-top: 1rem;
	font-size: 1rem;
	font-weight: 600;
}

.tl-archive__title {
	display: block;
	margin-top: 0.15rem;
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.875rem;
}

/* ------------------------------------------------- subscribe, on a page -- */

.tl-cta {
	width: 100%;
	/* The space under the panel belongs to this white section: a margin on
	   the panel would show the page's own background as a grey strip. */
	padding-bottom: clamp(2.5rem, 5vw, 4rem);
	background: #ffffff;
}

.tl-cta__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem 2.5rem;
	max-width: 76rem;
	margin: 0 auto;
	padding: clamp(2rem, 4vw, 3rem);
	border-radius: 1.25rem;
	background: #f5f5f4;
}

@media (min-width: 900px) {
	.tl-cta {
		padding-right: 2.5rem;
		padding-left: 2.5rem;
	}
}

@media (max-width: 899px) {
	.tl-cta {
		padding-right: 1.25rem;
		padding-left: 1.25rem;
	}
}

.tl-cta__heading {
	margin: 0;
	color: #1c1917;
	font-family: inherit;
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	font-weight: 700;
	line-height: 1.15;
}

.tl-cta__text {
	max-width: 34rem;
	margin: 0.6rem 0 0;
	color: #57534e;
	font-size: 1.05rem;
	line-height: 1.55;
}

.tl-cta__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.tl-cta__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3.25rem;
	padding: 0.8rem 1.7rem;
	border: 2px solid var(--tl-accent);
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
}

.tl-cta__button--primary {
	background: var(--tl-accent);
	color: #ffffff;
}

.tl-cta__button--secondary {
	background: transparent;
	color: var(--tl-accent);
}

.tl-cta__button:hover {
	opacity: 0.9;
}

.tl-cta__button:focus-visible {
	outline: 3px solid var(--tl-accent);
	outline-offset: 3px;
}

/* The hero on an edition's own page sits directly under the header. */
.tl-edition-page .tl-hero-wrap {
	margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	.tl-story__media img,
	.tl-archive__cover,
	.tl-archive__button {
		transition: none;
	}

	.tl-story__link:hover .tl-story__media img,
	.tl-archive__link:hover .tl-archive__cover {
		transform: none;
	}
}

/* The subscribe panel's heading in the hand-drawn capitals (SA Long Beach,
   assets/fonts.css). "Inside ..." and "Past editions" are Poppins. */
.tl-cta__heading {
	font-family: var(--tl-font-display, "SA Long Beach", sans-serif);
	font-weight: 400;
	letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------------
 * Preview this issue (lutheran_edition_preview_render()): the app's preview
 * flipbook in a frame, on a pale band of the edition's colour.
 * ------------------------------------------------------------------------ */
.tl-preview {
	width: 100%;
	scroll-margin-top: 1rem;
	background: var(--tl-preview-bg, #eef2f7);
	color: #1c1917;
	font-family: var(--tl-font-poppins, "Poppins", sans-serif);
	-webkit-font-smoothing: antialiased;
}

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

.tl-preview__inner {
	max-width: 76rem;
	margin: 0 auto;
	/* The hero's covers hang over the top of this band. */
	padding: clamp(5rem, 10vw, 8.5rem) 1.25rem clamp(4rem, 8vw, 6.5rem);
}

@media (min-width: 900px) {
	.tl-preview__inner {
		padding-left: 2.5rem;
		padding-right: 2.5rem;
	}
}

.tl-preview__header {
	max-width: 40rem;
	margin-bottom: 2.5rem;
}

.tl-preview__heading {
	margin: 0;
	color: #1c1917;
	font-family: var(--tl-font-poppins, "Poppins", sans-serif);
	font-size: clamp(1.6rem, 2.8vw, 2.15rem);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.01em;
}

.tl-preview__intro {
	margin: 0.75rem 0 0;
	color: #57534e;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.6;
}

/* The preview flipbook from the app (its own page, in a frame): as tall as a
   spread wants, within the screen. */
.tl-preview__frame {
	display: block;
	width: 100%;
	height: min(82vh, 48rem);
	border: 0;
	background: transparent;
	color-scheme: normal;
}

@media (max-width: 639px) {
	.tl-preview__frame {
		height: min(86vh, 44rem);
	}
}

.tl-preview__button:focus-visible,
.tl-preview__link:focus-visible {
	outline: 3px solid var(--tl-accent, #1f3a68);
	outline-offset: 3px;
}

.tl-preview__more {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 1rem 1.75rem;
	margin: 2.5rem 0 0;
}

.tl-preview__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	padding: 0.7rem 1.6rem;
	border-radius: 999px;
	background: var(--tl-accent, #1f3a68);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.tl-preview__button:hover {
	background: var(--tl-preview-ink, #152a4d);
	color: #fff;
}

.tl-preview__link {
	color: var(--tl-preview-ink, #1f3a68);
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
}

.tl-preview__link:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

