/****** FILE: themes/gamry/css/pages/AlgoliaSearchResultsPage.css *****/
/* Site search results. Auto-required by PageController for this class name.

   The page renders outside the legacy `.typography` wrapper now, so none of that stylesheet's
   link and heading rules apply here and nothing needs to be fought with !important. */

.rd-srch {
	font-family: var(--gm-font-body, 'IBM Plex Sans', sans-serif);
	color: var(--gm-ink, #16232b);
	background: var(--gm-bg, #fbfbfa);
}
.rd-srch-inner { max-width: 880px; margin: 0 auto; padding: 22px 24px 76px; }

/* ---------------------------------------------------------------- head */

.rd-srch-kicker {
	font-family: var(--gm-font-mono, 'IBM Plex Mono', monospace);
	font-size: 11.5px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--gm-muted, #5f6b72);
	margin-bottom: 10px;
}
.rd-srch-title {
	font-family: var(--gm-font-display, 'Space Grotesk', sans-serif);
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.14;
	font-weight: 700;
	margin: 0 0 16px;
}
.rd-srch-prose { font-size: 16.5px; line-height: 1.65; color: var(--gm-body, #3d4a52); }

/* ---------------------------------------------------------------- the form */

.rd-srch-form { margin: 22px 0 34px; }
/* Visually hidden, not display:none — the label has to stay in the accessibility tree. */
.rd-srch-label {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.rd-srch-row { display: flex; gap: 10px; align-items: stretch; }
.rd-srch-input {
	flex: 1 1 auto;
	min-width: 0;                     /* or a long value pushes the row past the viewport */
	font-family: inherit;
	font-size: 16px;                  /* 16px exactly: iOS zooms the page on focus below it */
	padding: 13px 15px;
	border: 1px solid var(--gm-border, #e6eaec);
	border-radius: 10px;
	background: #fff;
	color: var(--gm-ink, #16232b);
}
.rd-srch-input:focus-visible { outline: 2px solid var(--gm-navy, #003e69); outline-offset: 1px; }
.rd-srch-go {
	flex: 0 0 auto;
	font-family: inherit; font-size: 16px; font-weight: 600;
	padding: 13px 24px;
	border: 0; border-radius: 10px;
	background: var(--gm-navy, #003e69); color: #fff; cursor: pointer;
	transition: background .15s ease;
}
.rd-srch-go:hover { background: var(--gm-navy-hover, #00567f); }

/* ---------------------------------------------------------------- sections */

.rd-srch-sect { margin-top: 38px; }
.rd-srch-secthead {
	display: flex; align-items: baseline; gap: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--gm-border, #e6eaec);
	margin-bottom: 6px;
}
.rd-srch-secttitle {
	font-family: var(--gm-font-display, 'Space Grotesk', sans-serif);
	font-size: 19px; font-weight: 700; margin: 0;
}
.rd-srch-count {
	margin: 0;
	font-family: var(--gm-font-mono, 'IBM Plex Mono', monospace);
	font-size: 12.5px; color: var(--gm-muted, #5f6b72);
}
.rd-srch-empty { color: var(--gm-body, #3d4a52); font-size: 16px; padding: 14px 0; }

/* ---------------------------------------------------------------- page results */

.rd-srch-list { list-style: none; margin: 0; padding: 0; }
.rd-srch-item { padding: 20px 0; border-bottom: 1px solid var(--gm-border-soft, #eef1f2); }
.rd-srch-item:last-child { border-bottom: 0; }

.rd-srch-item-title {
	display: block;
	font-family: var(--gm-font-display, 'Space Grotesk', sans-serif);
	font-size: 18px; font-weight: 600; line-height: 1.3;
	color: var(--gm-navy, #003e69);
	text-decoration: none;
	margin-bottom: 6px;
}
.rd-srch-item-title:hover { text-decoration: underline; }

.rd-srch-item-excerpt {
	margin: 0 0 6px;
	font-size: 15.5px; line-height: 1.6;
	color: var(--gm-body, #3d4a52);
}

/* The URL under each result. It is orientation, not a control — see the template note. Broken
   anywhere rather than at spaces, because these paths have none and would otherwise be the one
   thing that forces a horizontal scrollbar at 320px. */
.rd-srch-item-url {
	display: block;
	font-family: var(--gm-font-mono, 'IBM Plex Mono', monospace);
	font-size: 12px;
	color: var(--gm-faint, #6c7981);
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* Algolia wraps matched terms in <em>. Highlighting them as emphasis-by-slant is easy to miss
   in a mono URL and in a long excerpt, so they get weight and a tint instead. */
.rd-srch-item-title em,
.rd-srch-item-excerpt em,
.rd-srch-item-url em {
	font-style: normal;
	font-weight: 700;
	background: #fdf3d3;
	border-radius: 2px;
	padding: 0 1px;
}

.rd-srch-pagination { margin-top: 22px; font-size: 15px; }
.rd-srch-pagination a { color: var(--gm-navy, #003e69); }

/* ---------------------------------------------------------------- product results */

.rd-srch-prods {
	list-style: none; margin: 16px 0 0; padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
	gap: 18px;
}
.rd-srch-prod-link {
	display: flex; flex-direction: column; gap: 10px;
	text-decoration: none; color: var(--gm-ink, #16232b);
}
.rd-srch-prod-img {
	display: block;
	aspect-ratio: 4 / 3;
	background: #fff;
	border: 1px solid var(--gm-border, #e6eaec);
	border-radius: 12px;
	overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	padding: 8px;
}
.rd-srch-prod-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.rd-srch-prod-name { font-size: 14.5px; line-height: 1.35; font-weight: 600; }
.rd-srch-prod-link:hover .rd-srch-prod-name { color: var(--gm-navy, #003e69); text-decoration: underline; }
.rd-srch-more { margin-top: 18px; font-size: 15px; }
.rd-srch-more a { color: var(--gm-navy, #003e69); font-weight: 600; }

/* ---------------------------------------------------------------- attribution */

.rd-srch-attrib {
	margin-top: 42px; padding-top: 16px;
	border-top: 1px solid var(--gm-border, #e6eaec);
	font-size: 13px; color: var(--gm-faint, #6c7981);
}
.rd-srch-attrib img { height: 1em; width: auto; vertical-align: middle; }

/* ---------------------------------------------------------------- narrow */

@media (max-width: 620px) {
	.rd-srch-inner { padding: 18px 16px 56px; }
	/* The button drops below the field rather than squeezing it: at 320px a side-by-side row
	   left the input too narrow to show a whole search term. */
	.rd-srch-row { flex-direction: column; }
	.rd-srch-go { width: 100%; }
}

/* ---------------------------------------------------------------- undoing the old page

   These IDs and classes come out of the module's markup, and three globally-loaded
   stylesheets style them for the layout this page used to have. They load on every page, so
   leaving the shell alone was never going to be enough — the old design reaches the new
   markup through its ids.

   Every selector below is scoped with .rd-srch purely to win on specificity: the originals are
   id-based (1,0,0), so a class alone loses no matter where it sits in the cascade. Nothing
   here uses !important — the extra class is enough, and it keeps these overrides confined to
   this page rather than quietly changing the retired /site-search/ page too.

   form.css floated the two sections into a 46% / 50% pair of columns. That was the old
   two-column results page; here it squeezed the excerpts to a third of the measure and set the
   product names one word per line. */
.rd-srch #search_pages,
.rd-srch #search_products {
	float: none;
	width: auto;
	padding-left: 0;
	border-left: 0;
}

/* The excerpt clip.

   layout.css clipped every excerpt to max-height:150px and painted a white gradient over the
   last 50px with a ::after — which read as a rendering fault, text dissolving mid-sentence
   behind a fade. My first attempt simply removed the clip. That was wrong, and worth recording:
   Algolia's $ContentHighlighted is not a snippet, it is the WHOLE page body. Unclipped, one
   Application Note result ran for two thousand words and buried every result under it. The clip
   was load-bearing; only its presentation was bad.

   Clamped to three lines instead, which ends on an ellipsis rather than a fade, is a fixed and
   predictable height, and does not need a gradient painted in the page background colour (the
   old ::after was hard-coded white, so it would have shown as a white smear now that the page
   sits on #fbfbfa). */
.rd-srch #SearchResults > li p {
	max-height: none;
	position: static;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.rd-srch #SearchResults > li p::after { content: none; }

/* layout.css also puts a hard 1px #666 rule above every result. The list has its own, lighter,
   separators — and that one drew above the first item too, under the section heading. */
.rd-srch #SearchResults > li { border-top: 0; margin: 0; }

/* form.css floats the product tiles at 49% with alternating borders. The grid handles the
   columns; float is inert on a grid item but the width is not. */
.rd-srch .searchProdResults > li {
	float: none;
	width: auto;
	padding: 0;
	border-top: 0;
	border-left: 0;
}
.rd-srch .searchProdResults::after { content: none; }

