/* Blog archives: search box and "Load more posts" (issue #145).
   Loaded on the blog index, category, tag, author and date archives only.
   Tokens from lib.css; input and button rules from docs/brand/design-reference.html
   (inputs: 2px border, 10px radius, 16px text, teal focus ring; buttons: pill). */

/* lib.css sets margin-block-start: 0 !important on children of flow layouts
   inside .lib-page-wrap, so the spacing below uses padding. */

/* ── Search box under the archive title ─────────────────────── */

.lib-archive-header .tt-archive-search {
	max-width: 560px;
	padding-top: 1.5rem;
}

.tt-archive-search .wp-block-search__inside-wrapper {
	background: var(--white);
	border: 2px solid var(--border);
	border-radius: 10px;
	padding: 4px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tt-archive-search .wp-block-search__inside-wrapper:focus-within {
	border-color: var(--teal);
	box-shadow: 0 0 0 4px rgba(78, 165, 156, 0.10);
}

.tt-archive-search .wp-block-search__input {
	font-family: var(--font-body);
	font-size: 16px; /* iOS zooms on anything smaller */
	color: var(--primary);
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0.6rem 0.85rem;
	min-height: 44px;
	outline: none;
}

.tt-archive-search .wp-block-search__input::placeholder {
	color: var(--mid-grey);
	opacity: 1;
}

.tt-archive-search .wp-block-search__button {
	font-family: var(--font-body);
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	color: var(--white);
	/* Teal dark, not teal: white on teal (#4EA59C) is 2.9:1, under WCAG's 4.5:1. */
	background: var(--teal-dark);
	border: none;
	border-radius: 100px;
	margin: 0 0 0 4px;
	padding: 0 1.4rem;
	min-height: 44px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.tt-archive-search .wp-block-search__button:hover {
	background: var(--navy);
}

.tt-archive-search .wp-block-search__button:focus-visible {
	outline: 3px solid var(--teal-dark);
	outline-offset: 2px;
}

/* Shown under the box when the archive is filtered: "23 posts in
   Artificial Intelligence match "instagram". Clear search" */
.tt-archive-search__note {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.75rem;
	max-width: 560px;
	margin: 0;
	padding-top: 0.75rem;
	font-size: 0.95rem;
	color: var(--primary);
}

.tt-archive-search__note a {
	color: var(--teal-dark);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

.tt-archive-search__note a:hover {
	color: var(--navy);
}

/* ── Load more ───────────────────────────────────────────────── */

.tt-load-more__controls {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	padding-top: 3rem;
	text-align: center;
}

.tt-load-more__button {
	min-height: 48px;
	padding: 0.9rem 2.25rem;
}

.tt-load-more__button:focus-visible {
	outline: 3px solid var(--teal);
	outline-offset: 3px;
}

.tt-load-more__controls.is-loading .tt-load-more__button {
	cursor: progress;
	opacity: 0.75;
	transform: none;
}

.tt-load-more__status {
	margin: 0;
	font-size: 0.875rem;
	color: var(--mid-grey);
}

.tt-load-more__status:empty {
	display: none;
}

/* The numbered page links stay for jumping ahead; sit them closer to the button. */
.lib-pagination.tt-load-more__pages {
	margin-top: 0;
	padding-top: 0.5rem;
	font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
	.tt-load-more__button,
	.tt-load-more__button:hover {
		transform: none;
		transition: none;
	}
}
