/**
 * Journal listings (Figma "Journal"): JN1 header, JN2 featured note, V3 photo strip "From the drives",
 * JN3 note cards, page links and the search box. Topics, archives and search reuse JN1 and JN3.
 * Templates: home.php and the other listings via template-parts/listing-page.php.
 */

/* ------------------------------------------------------------------ */
/* JN1 Header                                                         */
/* ------------------------------------------------------------------ */

.sl-journal-head {
	padding: 96px 0 48px;
}

.sl-journal-head__label {
	margin-bottom: 16px;
}

.sl-journal-head__title {
	overflow-wrap: break-word;
}

.sl-journal-head__text {
	max-width: 792px;
	margin-top: 16px;
}

/* ------------------------------------------------------------------ */
/* JN2 Featured note                                                  */
/* ------------------------------------------------------------------ */

.sl-journal-featured {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: flex-end;
	min-height: 720px;
	overflow: hidden;
}

.sl-journal-featured__photo {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--sl-c-ink);
}

.sl .sl-journal-featured__photo img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.sl-journal-featured__photo::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(18, 18, 18, 0.35);
}

.sl-journal-featured__inner {
	padding-top: 96px;
	padding-bottom: 56px;
}

.sl-journal-featured__text {
	max-width: 708px;
	min-width: 0;
}

.sl-journal-featured__label {
	margin-bottom: 16px;
	color: var(--sl-text);
}

.sl-journal-featured__title {
	margin-bottom: 16px;
	overflow-wrap: break-word;
}

/* Credit chip: bottom right, level with the link (the title may run above it). */
.sl-journal-featured .sl-chip.sl-journal-featured__credit {
	right: max(var(--sl-gutter), (100% - var(--sl-max)) / 2);
	bottom: 56px;
	left: auto;
	max-width: 40%;
	margin: 0;
	padding: 6px 10px;
}

/* ------------------------------------------------------------------ */
/* V3 Photo strip "From the drives"                                   */
/* ------------------------------------------------------------------ */

.sl-journal-strip {
	padding: 96px 0;
}

.sl-journal-strip__title {
	margin-bottom: 24px;
}

.sl-journal-strip__row {
	display: grid;
	grid-template-columns: 552fr 300fr 300fr;
	gap: 24px;
}

.sl-journal-strip__item {
	height: 360px;
	border-radius: var(--sl-radius);
}

.sl-journal-strip__row:focus-visible {
	outline-offset: 4px;
}

/* ------------------------------------------------------------------ */
/* JN3 Note cards                                                     */
/* ------------------------------------------------------------------ */

.sl-journal-notes {
	padding: 56px 0 96px;
	border-top: 1px solid var(--sl-c-line-dark);
}

.sl-journal-notes__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: start;
	gap: 0 24px;
}

.sl-journal-card {
	position: relative;
	padding: 40px 0;
	border-bottom: 1px solid var(--sl-c-line-dark);
}

.sl-journal-card__figure {
	margin: 0 0 16px;
}

.sl-journal-card__photo {
	aspect-ratio: 4 / 3;
}

.sl-journal-card__caption {
	margin-top: 8px;
	color: var(--sl-muted);
}

.sl-journal-card__label {
	margin-bottom: 14px;
}

.sl-journal-card__title {
	overflow-wrap: break-word;
}

.sl .sl-journal-card__link {
	color: inherit;
	text-decoration: none;
}

/* The title link covers the card, so the photo is clickable too. */
.sl-journal-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.sl .sl-journal-card:hover .sl-journal-card__link,
.sl .sl-journal-card__link:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 6px;
}

.sl-journal-card__link:focus-visible {
	outline: 0;
}

.sl-journal-card__link:focus-visible::after {
	outline: 2px solid var(--sl-c-gold);
	outline-offset: 4px;
}

/* Empty state, "All field notes" */
.sl-journal-notes__empty {
	padding: 40px 0;
}

.sl-journal-notes__empty-text {
	margin-top: 8px;
	color: var(--sl-muted);
}

.sl-journal-notes__all {
	margin-top: 32px;
}

.sl .sl-journal-notes__all-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--sl-heading);
	font-size: var(--sl-fs-small);
	line-height: var(--sl-lh-small);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Page links                                                         */
/* ------------------------------------------------------------------ */

.sl-journal-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 24px;
	margin-top: 48px;
	font-size: var(--sl-fs-small);
	line-height: var(--sl-lh-small);
}

.sl-journal-pager__numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.sl-journal-pager__numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	border-radius: 8px;
	color: var(--sl-heading);
	text-decoration: none;
}

.sl-journal-pager__numbers a.page-numbers:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sl-journal-pager__numbers .page-numbers.current {
	background: var(--sl-c-ink);
	color: var(--sl-c-light);
}

.sl .sl-journal-pager__step {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	color: var(--sl-heading);
	font-weight: 600;
	text-decoration: none;
}

.sl .sl-journal-pager__step:hover span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Search box (searchform.php)                                        */
/* ------------------------------------------------------------------ */

.sl-journal-notes__search {
	max-width: 588px;
	margin-bottom: 8px;
}

.sl-search-form__label {
	display: block;
	margin-bottom: 8px;
}

.sl-search-form__row {
	display: flex;
	gap: 12px;
}

.sl .sl-search-form__input {
	flex: 1 1 auto;
	min-width: 0;
}

.sl .sl-search-form__submit {
	flex: none;
}

/* ------------------------------------------------------------------ */
/* Tablet                                                             */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.sl-journal-head {
		padding-top: 72px;
	}

	.sl-journal-featured {
		min-height: 560px;
	}

	.sl-journal-featured__inner {
		padding-top: 72px;
	}

	/* 607px in the design; a little more so the title keeps to one line as in Figma. */
	.sl-journal-featured__text {
		max-width: 640px;
	}

	.sl-journal-strip {
		padding: 72px 0;
	}

	/* Swipe row that runs to the right edge of the screen. */
	.sl-journal-strip__row {
		display: flex;
		margin-right: calc(-1 * var(--sl-gutter));
		padding-right: var(--sl-gutter);
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-left: 0;
		scrollbar-width: none;
	}

	.sl-journal-strip__row::-webkit-scrollbar {
		display: none;
	}

	.sl-journal-strip__item {
		flex: 0 0 250px;
		height: 300px;
		scroll-snap-align: start;
	}

	.sl-journal-strip__item:first-child {
		flex-basis: 460px;
	}

	.sl-journal-notes {
		padding-bottom: 72px;
	}

	.sl-journal-notes__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 48px;
	}
}

/* Mouse users on narrow windows get a thin scrollbar under the swipe row. */
@media (max-width: 1024px) and (hover: hover) and (pointer: fine) {
	.sl-journal-strip__row {
		scrollbar-width: thin;
	}
}

/* ------------------------------------------------------------------ */
/* Phone                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	.sl-journal-head {
		padding: 56px 0 32px;
	}

	.sl-journal-head .sl-journal-head__text {
		font-size: 17px;
		line-height: 28px;
	}

	.sl-journal-featured {
		min-height: 520px;
	}

	.sl-journal-featured__inner {
		padding-top: 72px;
		padding-bottom: 32px;
	}

	.sl-journal-featured__label,
	.sl-journal-featured__title {
		margin-bottom: 12px;
	}

	/* The credit moves to the top left corner of the photo. */
	.sl-journal-featured .sl-chip.sl-journal-featured__credit {
		top: 20px;
		right: auto;
		bottom: auto;
		left: var(--sl-gutter);
		max-width: calc(100% - 2 * var(--sl-gutter));
	}

	.sl-journal-strip {
		padding: 56px 0;
	}

	.sl-journal-strip__item {
		flex-basis: 216px;
		height: 260px;
	}

	.sl-journal-strip__item:first-child {
		flex-basis: 390px;
	}

	.sl-journal-notes {
		padding: 40px 0 56px;
	}

	.sl-journal-notes__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.sl-journal-card {
		padding: 28px 0;
	}

	.sl-search-form__row {
		flex-wrap: wrap;
	}

	.sl .sl-search-form__submit {
		width: 100%;
	}
}
