/*
 * Search results inherit the redesigned archive language.
 * The site's original redesign only targets body.archive; WordPress search
 * pages use body.search, which is why they fall back to the older card UI.
 */

body.search.tp-page .tp-archive-head {
	padding: clamp(52px, 7vw, 92px) 0 clamp(48px, 6vw, 78px);
	background: #eee9df;
}

body.search.tp-page .tp-archive-head .tp-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(340px, 560px);
	grid-template-areas:
		"kicker form"
		"title form"
		"summary form"
		"filter filter";
	column-gap: clamp(40px, 7vw, 110px);
	align-items: end;
}

body.search.tp-page .tp-archive-head .tp-kicker {
	grid-area: kicker;
	color: #6f2734;
}

body.search.tp-page .tp-archive-head h1 {
	grid-area: title;
	max-width: 760px;
	margin: 18px 0 0;
	font-size: clamp(42px, 5.4vw, 72px);
	line-height: 1.18;
	letter-spacing: -.05em;
	text-wrap: balance;
}

body.search.tp-page .tp-search-summary {
	grid-area: summary;
	margin: 24px 0 0;
	font-size: 13px;
	color: #5f5a52;
}

body.search.tp-page .tp-search-page-form {
	grid-area: form;
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	width: 100%;
	max-width: none;
	margin: 0;
	border-bottom: 1px solid #817c72;
}

body.search.tp-page .tp-search-page-form input[type="search"] {
	height: 64px;
	border: 0;
	background: transparent;
	padding: 0 20px 0 0;
	font: 400 19px/1.2 var(--tp-serif);
	color: #171613;
	outline: none;
}

body.search.tp-page .tp-search-page-form input[type="search"]:focus {
	box-shadow: inset 0 -2px #742532;
}

body.search.tp-page .tp-search-page-form button {
	min-width: 118px;
	height: 64px;
	border: 0;
	background: transparent;
	color: #171613;
	padding: 0 6px 0 22px;
	font-size: 10px;
	letter-spacing: .1em;
	transition: color .25s ease, transform .25s ease;
}

body.search.tp-page .tp-search-page-form button::after {
	content: "↗";
	display: inline-block;
	margin-left: 18px;
	font-size: 16px;
	font-weight: 400;
}

body.search.tp-page .tp-search-page-form button:hover {
	background: transparent;
	color: #742532;
	transform: translateX(3px);
}

/* Spirit navigation shared by search and the all-articles archive. */
.tp-archive-main .sjsux-spirit-filter {
	grid-area: filter;
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 28px;
	align-items: center;
	width: 100%;
	margin-top: 44px;
	padding-top: 22px;
	border-top: 1px solid #c9c4b9;
}

.tp-archive-main .sjsux-spirit-filter__label {
	font: 700 9px/1.4 var(--tp-sans);
	letter-spacing: .16em;
	color: #6f2734;
}

.tp-archive-main .sjsux-spirit-filter__links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tp-archive-main .sjsux-spirit-filter__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 0 18px;
	border: 1px solid #bdb7ad;
	background: transparent;
	font: 700 9px/1 var(--tp-sans);
	letter-spacing: .08em;
	color: #4e4a43;
	text-decoration: none;
	transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.tp-archive-main .sjsux-spirit-filter__link:hover {
	border-color: #742532;
	color: #742532;
}

.tp-archive-main .sjsux-spirit-filter__link.is-active {
	border-color: #742532;
	background: #742532;
	color: #f6f3ec;
}

/* Article-list header receives the same filter without changing its archive grid. */
body.page.tp-page .tp-archive-main .tp-archive-head .tp-inner {
	display: grid;
	grid-template-columns: 1fr;
}

body.page.tp-page .tp-archive-main .sjsux-spirit-filter {
	margin-top: 42px;
}

/* Keep editorial category and spirit type readable as separate dimensions. */
.tp-archive-main .sjsux-card-taxonomies {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px 10px;
}

.tp-archive-main .sjsux-card-taxonomies .tp-cat {
	margin: 0;
}

.tp-archive-main .sjsux-spirit-badge {
	display: inline-flex;
	align-items: center;
	min-height: 20px;
	padding: 0 8px;
	border: 1px solid #b9b1a5;
	font: 700 8px/1 var(--tp-sans);
	letter-spacing: .07em;
	color: #5b554d;
}

body.search.tp-page .tp-archive-list {
	padding: 68px 0 110px;
}

body.search.tp-page .tp-archive-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 68px 30px;
	align-items: start;
}

body.search.tp-page .tp-archive-card {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 0;
	padding-top: 14px;
	border-top: 1px solid #817c72;
}

body.search.tp-page .tp-archive-photo {
	width: 100%;
	aspect-ratio: 4 / 3;
	margin-bottom: 22px;
	background-color: #d4d0c7;
	filter: saturate(.82) contrast(.97);
	transition: filter .4s ease, transform .4s ease;
}

body.search.tp-page .tp-archive-card:hover .tp-archive-photo {
	filter: saturate(.98) contrast(1);
	transform: translateY(-3px);
}

body.search.tp-page .tp-archive-copy {
	min-width: 0;
}

body.search.tp-page .tp-archive-card .tp-cat {
	font-size: 10px;
	line-height: 1.5;
	letter-spacing: .1em;
	color: #6f2734;
}

body.search.tp-page .tp-archive-card h2 {
	margin: 8px 0 14px;
	font-size: 24px;
	line-height: 1.5;
	letter-spacing: -.025em;
	text-wrap: pretty;
}

body.search.tp-page .tp-archive-card h2 a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 5px;
}

body.search.tp-page .tp-archive-card p {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	margin: 0 0 20px;
	font: 400 13px/1.9 var(--tp-serif);
	color: #5e5951;
}

body.search.tp-page .tp-archive-card .tp-date {
	padding-top: 13px;
	border-top: 1px solid #c9c4b9;
	font-size: 8px;
	letter-spacing: .16em;
	color: #5e5951;
}

body.search.tp-page .tp-empty-state {
	max-width: 720px;
	margin: 10px auto 0;
	padding: 56px 42px;
	border-top: 1px solid #817c72;
	border-bottom: 1px solid #c9c4b9;
	text-align: center;
	font: 400 18px/1.9 var(--tp-serif);
	color: #5f5a52;
}

@media (max-width: 1024px) {
	body.search.tp-page .tp-archive-head .tp-inner {
		grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
		column-gap: 36px;
	}

	body.search.tp-page .tp-archive-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 58px 24px;
	}
}

@media (max-width: 760px) {
	body.search.tp-page .tp-archive-head .tp-inner {
		display: block;
	}

	body.search.tp-page .tp-archive-head h1 {
		font-size: clamp(38px, 10vw, 54px);
	}

	body.search.tp-page .tp-search-page-form {
		margin-top: 36px;
	}

	.tp-archive-main .sjsux-spirit-filter {
		display: block;
		margin-top: 34px;
		padding-top: 18px;
	}

	.tp-archive-main .sjsux-spirit-filter__links {
		margin-top: 14px;
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 8px;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.tp-archive-main .sjsux-spirit-filter__link {
		flex: 0 0 auto;
	}
}

@media (max-width: 700px) {
	body.search.tp-page .tp-archive-list {
		padding: 48px 0 78px;
	}

	body.search.tp-page .tp-archive-grid {
		grid-template-columns: 1fr;
		gap: 50px;
	}

	body.search.tp-page .tp-archive-card h2 {
		font-size: 23px;
	}
}

@media (max-width: 560px) {
	body.search.tp-page .tp-search-page-form {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
	}

	body.search.tp-page .tp-search-page-form input[type="search"],
	body.search.tp-page .tp-search-page-form button {
		height: 56px;
	}

	body.search.tp-page .tp-search-page-form button {
		width: auto;
		min-width: 96px;
		padding-left: 12px;
	}

	body.search.tp-page .tp-search-page-form button::after {
		margin-left: 9px;
	}

	body.search.tp-page .tp-empty-state {
		padding: 42px 20px;
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.search.tp-page .tp-archive-photo,
	body.search.tp-page .tp-search-page-form button,
	.tp-archive-main .sjsux-spirit-filter__link {
		transition: none;
	}
}
