/**
 * Field notes listings: blog index, older pages, topics and search results.
 * Figma: "Field notes", "Field notes page 2", "Search results", "Topic / *".
 */

.nb-listing,
.nb-listing-topics,
.nb-listing-hero {
	--nb-listing-border: #8a8273;
	--nb-listing-ink: var(--nb-c-ink-text);
}

/* ------------------------------------------------------------------ */
/* Hero                                                               */
/* ------------------------------------------------------------------ */

/* The desktop and tablet frames show the photo almost black behind the title; phones show it plain above. */
.nb-listing-hero {
	--nb-hero-overlay: 0.8;
	--nb-hero-min-h: 640px;
	--nb-hero-photo-h: 420px;
	--nb-pad-t: 96px;
	--nb-pad-b: 120px;
}

/* Long topic names ("Uncategorized") must not run off a phone screen. */
.nb-listing-hero .nb-hero__title {
	overflow-wrap: break-word;
}

@media (max-width: 1024px) {
	.nb-listing-hero {
		--nb-hero-min-h: 560px;
		--nb-pad-b: 112px;
	}
}

@media (max-width: 767px) {
	.nb-listing-hero {
		--nb-hero-min-h: 0px;
		--nb-pad-t: 28px;
		--nb-pad-b: 28px;
	}
}

/* ------------------------------------------------------------------ */
/* Topic chips                                                        */
/* ------------------------------------------------------------------ */

.nb-listing-topics {
	padding: 40px 0 8px;
}

.nb-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 8px;
}

.nb .nb-chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 16px;
	border: 1px solid var(--nb-listing-border, #8a8273);
	border-radius: 100px;
	background: transparent;
	color: var(--nb-heading);
	font-family: var(--nb-font-body);
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* 44px tap target around the 36px chip. */
.nb .nb-chip::before {
	content: "";
	position: absolute;
	inset: -5px 0;
}

.nb .nb-chip:hover {
	border-color: var(--nb-heading);
	color: var(--nb-heading);
}

.nb .nb-chip.is-current {
	border-color: var(--nb-listing-ink, #12171c);
	background: var(--nb-listing-ink, #12171c);
	color: var(--nb-c-text);
}

/* Tablet and phone frames sit the chip row right under the hero (4px hit-area inset). */
@media (max-width: 1024px) {
	.nb-listing-topics {
		padding: 4px 0 44px;
	}
}

@media (max-width: 767px) {
	.nb-listing-topics {
		padding-bottom: 36px;
	}
}

/* ------------------------------------------------------------------ */
/* Notes                                                              */
/* ------------------------------------------------------------------ */

.nb-listing {
	--nb-pad-t: 96px;
	--nb-pad-b: 96px;
	--nb-listing-border: #8a8273;
}

.nb-listing__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	margin-bottom: 40px;
}

.nb-listing__head--rule {
	align-items: center;
	margin-bottom: 32px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--nb-line);
}

.nb-listing__order {
	flex: none;
	color: var(--nb-muted);
	font-size: var(--nb-fs-small);
	line-height: var(--nb-lh-small);
}

.nb-listing .nb-note__media {
	aspect-ratio: 4 / 5;
}

.nb-listing__rule {
	height: 0;
	margin: 32px 0 0;
	border: 0;
	border-top: 1px solid var(--nb-line);
}

/* Search box and result count */
.nb-listing__query {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
	margin-bottom: 32px;
	scroll-margin-top: 24px;
}

.nb-listing__query .nb-search-form {
	flex: 0 1 400px;
}

.nb-listing__count {
	display: flex;
	align-items: center;
	gap: 16px;
	color: var(--nb-heading);
}

.nb .nb-listing__clear {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--nb-heading);
	font-size: 16px;
	line-height: 16px;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.nb .nb-listing__clear:hover {
	text-decoration-thickness: 2px;
}

/* Empty states */
.nb-listing__empty {
	max-width: 640px;
}

.nb-listing__empty-text {
	margin-top: 12px;
	color: var(--nb-muted);
}

.nb-listing__empty .nb-chips {
	margin-top: 24px;
}

/* Page links and "All field notes" */
.nb-listing-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 64px;
}

.nb-listing-pager--center {
	justify-content: center;
}

.nb .nb-listing-pager .page-numbers,
.nb .nb-listing-pager__step,
.nb .nb-listing-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--nb-listing-border, #8a8273);
	border-radius: 8px;
	background: transparent;
	color: var(--nb-heading);
	font-family: var(--nb-font-body);
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nb .nb-listing-pager__step {
	padding: 0 16px;
}

.nb .nb-listing-button {
	padding: 0 20px;
	font-size: 16px;
	line-height: 16px;
}

.nb .nb-listing-pager a.page-numbers:hover,
.nb .nb-listing-pager__step:hover,
.nb .nb-listing-button:hover {
	border-color: var(--nb-heading);
	color: var(--nb-heading);
}

.nb .nb-listing-pager .page-numbers.current {
	border-color: var(--nb-listing-ink, #12171c);
	background: var(--nb-listing-ink, #12171c);
	color: var(--nb-c-text);
}

.nb .nb-listing-pager .page-numbers.dots {
	border-color: transparent;
}

.nb .nb-listing-pager__step:hover .nb-icon--arrow-right {
	transform: translateX(3px);
}

.nb .nb-listing-pager__step .nb-icon {
	flex: none;
	transition: transform 0.2s ease;
}

.nb .nb-listing-pager__step--prev:hover .nb-icon {
	transform: translateX(-3px);
}

.nb-listing__all {
	margin-top: 32px;
}

@media (max-width: 1024px) {
	.nb-listing {
		--nb-pad-t: 64px;
		--nb-pad-b: 64px;
	}

	/* Title and "Newest first" share a bottom edge, as in the frames. */
	.nb-listing__head:not(.nb-listing__head--rule) {
		align-items: flex-end;
	}
}

@media (max-width: 767px) {
	.nb-listing {
		--nb-pad-t: 48px;
		--nb-pad-b: 48px;
	}

	.nb-listing .nb-note__media {
		aspect-ratio: 350 / 263;
	}

	.nb-listing__query {
		flex-direction: column;
		align-items: stretch;
	}

	.nb-listing__query .nb-search-form {
		flex: none;
	}

	.nb-listing__count {
		justify-content: space-between;
	}
}

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

.nb-search-form {
	--nb-search-bg: var(--nb-c-surface);
	--nb-search-border: var(--nb-c-border);
	position: relative;
	width: 100%;
}

.nb--sand .nb-search-form {
	--nb-search-bg: #fbfaf7;
	--nb-search-border: #8a8273;
}

.nb-search-form__field {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 48px;
	padding: 0 16px;
	border: 1px solid var(--nb-search-border);
	border-radius: 8px;
	background: var(--nb-search-bg);
	color: var(--nb-muted, var(--nb-c-muted));
	cursor: text;
}

.nb-search-form__field:focus-within {
	border-color: var(--nb-heading, var(--nb-c-text));
}

.nb-search-form__field .nb-icon {
	flex: none;
}

.nb .nb-search-form__input,
.nb-search-form__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: var(--nb-heading, var(--nb-c-text));
	font-family: var(--nb-font-body);
	font-size: 17px;
	line-height: 28px;
	-webkit-appearance: none;
	appearance: none;
}

.nb .nb-search-form__input::placeholder {
	color: var(--nb-muted, var(--nb-c-muted));
	opacity: 1;
}

.nb .nb-search-form__input::-webkit-search-decoration {
	-webkit-appearance: none;
}

/* ------------------------------------------------------------------ */
/* From the field                                                     */
/* ------------------------------------------------------------------ */

.nb-listing-gallery {
	--nb-pad-t: 80px;
	--nb-pad-b: 80px;
	--nb-row1-h: 520px;
}

.nb-listing-gallery .nb-section-head {
	margin-bottom: 40px;
}

@media (max-width: 1024px) {
	.nb-listing-gallery {
		--nb-pad-t: 64px;
		--nb-pad-b: 64px;
		--nb-row1-h: 340px;
	}

	.nb-listing-gallery .nb-section-head {
		margin-bottom: 32px;
	}

	.nb-listing-gallery .nb-gallery__item {
		--ratio: 1.4118;
	}

	.nb-listing-gallery .nb-gallery__item.is-narrow {
		--ratio: 0.8;
	}
}

@media (max-width: 767px) {
	.nb-listing-gallery {
		--nb-pad-t: 56px;
		--nb-pad-b: 56px;
		--nb-row1-h: 280px;
	}

	.nb-listing-gallery .nb-section-head {
		margin-bottom: 24px;
	}

	.nb-listing-gallery .nb-gallery__item {
		--ratio: 1.3571;
	}

	.nb-listing-gallery .nb-gallery__item.is-narrow {
		--ratio: 0.7857;
	}

	.nb-listing-gallery .nb-gallery__item .nb-caption {
		left: 10px;
		bottom: 10px;
		max-width: calc(100% - 20px);
	}
}

/* ------------------------------------------------------------------ */
/* Newsletter band                                                    */
/* ------------------------------------------------------------------ */

.nb-listing-dispatch {
	--nb-pad-t: 96px;
	--nb-pad-b: 96px;
}

.nb-listing-dispatch__inner {
	display: grid;
	grid-template-columns: minmax(0, 616px) minmax(0, 520px);
	justify-content: space-between;
	align-items: end;
	gap: 32px 64px;
}

.nb-listing-dispatch .nb-eyebrow {
	margin-bottom: 16px;
}

.nb-listing-dispatch__text {
	max-width: 460px;
	margin-top: 16px;
	color: var(--nb-muted);
}

.nb-listing-dispatch .nb-listing-dispatch__form {
	max-width: 360px;
	margin-top: 0;
	font-size: var(--nb-fs-small);
	line-height: var(--nb-lh-small);
}

.nb-listing-dispatch .nb-btn--primary {
	flex: none;
}

@media (max-width: 1024px) {
	.nb-listing-dispatch {
		--nb-pad-t: 80px;
		--nb-pad-b: 80px;
	}

	.nb-listing-dispatch__inner {
		grid-template-columns: minmax(0, 1fr);
	}

	.nb-listing-dispatch__text {
		max-width: none;
	}

	.nb-listing-dispatch .nb-listing-dispatch__form {
		max-width: none;
	}
}

@media (max-width: 767px) {
	.nb-listing-dispatch {
		--nb-pad-t: 64px;
		--nb-pad-b: 64px;
	}

	.nb-listing-dispatch__inner {
		row-gap: 28px;
	}

	/* The phone frame keeps the desktop label and intro of the newsletter block. */
	.nb-listing-dispatch .nb-news__label {
		font-size: 13px;
		line-height: 16px;
	}

	.nb-listing-dispatch .nb-news__text {
		font-size: 15px;
		line-height: 22px;
	}
}
