/* Site search (includes/template-search.php, js/customscript_search.js), in
   the events page's look: its colours, rounded field and pill chips.
   Loaded on the search page only (includes/header-css.php).

   main.css styles this page under .template-search at up to (0,3,2) -- the
   pink uppercase h2 bar, the grey tab blocks, the input widths -- so every
   rule here starts .template-search plus a class of its own, and goes one
   class deeper wherever main.css does. Event results are drawn by the
   article calendar component and styled by yodel-embed.css. */

/* On the page, not the form: the results heading sits outside both blocks. */
.template-search {
	--sr-accent: #e11383;
	--sr-ink: #1f2937;
	--sr-muted: #5b6472;
	--sr-line: #e5e7eb;
	--sr-navy: #123a63;
}
.template-search .mk-search,
.template-search .mk-search-results {
	font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--sr-ink);
}

/* ---------- search box ---------- */
.template-search .mk-search .mk-search__box {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 6px 0 12px;
}
.template-search .mk-search .mk-search__ico {
	position: absolute;
	left: 16px;
	display: flex;
	color: var(--sr-muted);
	pointer-events: none;   /* clicks reach the field */
}
.template-search .mk-search input.searchinput {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	margin: 0;
	font: inherit;
	font-size: 16px;   /* 16px keeps iOS from zooming in on focus */
	padding: 12px 18px 12px 44px;
	border: 1px solid var(--sr-line);
	border-radius: 999px;
	background: #fff;
	color: var(--sr-ink);
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}
.template-search .mk-search input.searchinput:focus {
	outline: none;
	border-color: var(--sr-accent);
	box-shadow: 0 0 0 3px rgba(225, 19, 131, .12);
}
.template-search .mk-search input.searchinput::-webkit-search-cancel-button { cursor: pointer; }
.template-search .mk-search button.searchsubmit {
	flex: 0 0 auto;
	width: auto;
	margin: 0;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	padding: 12px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--sr-accent);
	color: #fff;
	text-shadow: none;   /* main.css's .button has one */
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}
.template-search .mk-search button.searchsubmit:hover { background: #c40f71; }

/* This town or every site: two quiet choices under the field. */
.template-search .mk-search .mk-search__range {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	padding-left: 6px;
}
.template-search .mk-search .mk-search__opt {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	text-transform: none;   /* main.css uppercases and spaces out labels */
	letter-spacing: normal;
	color: var(--sr-muted);
	cursor: pointer;
}
.template-search .mk-search .mk-search__opt input { margin: 0; accent-color: var(--sr-accent); }

/* ---------- results ---------- */
/* main.css paints every h2 here as a pink uppercase bar. */
.template-search .mk-search__heading {
	margin: 28px 0 14px;
	padding: 0;
	background: none;
	color: var(--sr-navy);
	font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 24px;
	font-weight: 700;
	text-transform: none;
}

/* Tabs as the events page's chips, each with its count. */
.template-search .mk-search-results .resultstabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 18px;
	padding: 0;
	border: 0;
	list-style: none;
}
.template-search .mk-search-results .resultstabs li { display: block; margin: 0; padding: 0; }
.template-search .mk-search-results .resultstabs li a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border: 1px solid var(--sr-line);
	border-radius: 999px;
	background: #fff;
	color: var(--sr-ink);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background .15s, color .15s, border-color .15s;
}
.template-search .mk-search-results .resultstabs li a:hover { border-color: var(--sr-accent); }
.template-search .mk-search-results .resultstabs li a.active {
	background: var(--sr-accent);
	border-color: var(--sr-accent);
	color: #fff;
}
/* The label and its count share one line. */
.template-search .mk-search-results .resultstabs li a br { display: none; }
.template-search .mk-search-results .resultstabs li a .resultcount {
	min-width: 22px;
	padding: 1px 8px;
	border-radius: 999px;
	background: #f3f4f6;
	color: var(--sr-muted);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}
.template-search .mk-search-results .resultstabs li a .resultcount:empty { display: none; }
.template-search .mk-search-results .resultstabs li a.active .resultcount {
	background: rgba(255, 255, 255, .25);
	color: #fff;
}

.template-search .mk-search-results .mk-search-note {
	margin: 0 0 12px;
	font-size: 14px;
	font-style: italic;
	color: var(--sr-muted);
}

/* ---------- article and business rows ---------- */
/* The events results' look, for the other two tabs. Rows are divs: main.css
   styles ul/li in these containers as the articles page's cards (some of it
   !important), and none of that reaches a div. */
.template-search .mk-search-results .mk-sr-list { display: block; margin: 0; padding: 0; }
.template-search .mk-search-results .mk-sr-item {
	border-bottom: 1px solid var(--sr-line);
}
.template-search .mk-search-results .mk-sr-row {
	position: relative;
	display: grid;
	grid-template-columns: 138px minmax(0, 1fr) 22px;
	align-items: center;
	gap: 16px;
	padding: 14px 8px;
	color: inherit;
	text-decoration: none;
	transition: background .15s ease;
}
.template-search .mk-search-results a.mk-sr-row:hover,
.template-search .mk-search-results .mk-sr-item--biz .mk-sr-row:hover { background: #fafbfc; text-decoration: none; }
.template-search .mk-search-results .mk-sr-thumb {
	display: block;
	aspect-ratio: 1.91 / 1;   /* the calendar rows' thumbnail shape */
	border-radius: 8px;
	overflow: hidden;
	background: #e5e7eb;
}
.template-search .mk-search-results .mk-sr-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.template-search .mk-search-results .mk-sr-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.template-search .mk-search-results .mk-sr-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--sr-ink);
	text-decoration: none;
}
.template-search .mk-search-results .mk-sr-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	font-size: 13px;
	color: var(--sr-muted);
}
.template-search .mk-search-results .mk-sr-tag {
	padding: 1px 9px;
	border: 1px solid var(--sr-line);
	border-radius: 999px;
	font-size: 12px;
	color: var(--sr-muted);
}
.template-search .mk-search-results .mk-sr-sponsored { color: var(--sr-accent); font-weight: 600; }
.template-search .mk-search-results .mk-sr-town { color: #0f6f97; font-weight: 600; }
.template-search .mk-search-results .mk-sr-desc {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.45;
	color: var(--sr-muted);
}
.template-search .mk-search-results .searchscore { font-size: 11px; font-style: italic; color: var(--sr-muted); }
.template-search .mk-search-results .mk-sr-chev { color: #667085; font-size: 20px; text-align: center; }

/* Businesses: image or initials, and Website / Details on the right. The
   name is the row's link, stretched over it; the buttons sit above that. */
.template-search .mk-search-results .mk-sr-item--biz .mk-sr-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
.template-search .mk-search-results .mk-sr-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 12px;
	overflow: hidden;
	background: #fdf2f8;
	color: var(--sr-accent);
	font-size: 18px;
	font-weight: 700;
}
.template-search .mk-search-results .mk-sr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.template-search .mk-search-results .mk-sr-link::after { content: ""; position: absolute; inset: 0; }
.template-search .mk-search-results .mk-sr-link:hover { color: var(--sr-ink); text-decoration: none; }
.template-search .mk-search-results .mk-sr-acts {
	position: relative;
	z-index: 1;   /* above the name's full-row link */
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.template-search .mk-search-results .mk-sr-act {
	padding: 5px 14px;
	border: 1px solid var(--sr-line);
	border-radius: 999px;
	background: #fff;
	color: var(--sr-accent);
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
}
.template-search .mk-search-results .mk-sr-act:hover { border-color: var(--sr-accent); text-decoration: none; }

/* Newest / Best match, as chips above the articles. */
.template-search .mk-search-results .articleSorter {
	display: flex;
	gap: 8px;
	margin: 0 0 6px;
	text-align: left;
}
.template-search .mk-search-results .mk-sr-group { display: flex; gap: 8px; }
.template-search .mk-search-results .mk-sr-sort .sortby {
	margin: 0;
	line-height: 1.4;
	padding: 6px 14px;
	border: 1px solid var(--sr-line);
	border-radius: 999px;
	background: #fff;
	color: var(--sr-ink);
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	text-transform: none;
	text-shadow: none;
	cursor: pointer;
}
.template-search .mk-search-results .mk-sr-sort .sortby:hover { border-color: var(--sr-accent); background: #fff; }
.template-search .mk-search-results .mk-sr-sort .sortby.active {
	background: var(--sr-accent);
	border-color: var(--sr-accent);
	color: #fff;
}

/* Articles as image cards, the readers' alternative to the rows (List /
   Cards switch; see articleView in customscript_search.js). */
.template-search .mk-search-results .mk-sr-list--cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
	margin-top: 12px;
}
.template-search .mk-search-results .mk-sr-item--card { border-bottom: 0; }
.template-search .mk-search-results .mk-sr-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid var(--sr-line);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: border-color .15s ease;
}
.template-search .mk-search-results .mk-sr-card:hover { border-color: var(--sr-accent); text-decoration: none; }
.template-search .mk-search-results .mk-sr-cardimg { border-radius: 0; }
.template-search .mk-search-results .mk-sr-cardbody {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px 14px 14px;
}
.template-search .mk-search-results .mk-sr-viewsw { display: flex; gap: 6px; margin-left: auto; }
.template-search .mk-search-results .mk-sr-view {
	margin: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	background: #fff;
	padding: 0;
	border: 1px solid var(--sr-line);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	color: var(--sr-muted);
	cursor: pointer;
}
.template-search .mk-search-results .mk-sr-view.active { border-color: var(--sr-navy); color: var(--sr-navy); }
.template-search .mk-search-results .mk-sr-sort .sortby:focus-visible,
.template-search .mk-search-results .mk-sr-view:focus-visible { outline: 2px solid var(--sr-accent); outline-offset: 2px; }

@media (max-width: 600px) {
	.template-search .mk-search button.searchsubmit { padding: 12px 18px; }
	.template-search .mk-search-results .mk-sr-row { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; }
	.template-search .mk-search-results .mk-sr-chev { display: none; }
	.template-search .mk-search-results .mk-sr-title { font-size: 15px; }
	/* Website / Details move under the text. */
	.template-search .mk-search-results .mk-sr-item--biz .mk-sr-row { grid-template-columns: 56px minmax(0, 1fr); }
	.template-search .mk-search-results .mk-sr-avatar { width: 56px; height: 56px; }
	.template-search .mk-search-results .mk-sr-acts { grid-column: 2; flex-direction: row; }
}
