/* PDT Search — results list, facets, typeahead, masthead box.
   Colors and faces come from the theme's tokens (desert-v4.css) with plain fallbacks. */

/* ── Typeahead ── */
.pdt-suggest {
	position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
	background: var(--color-surface-raised, #fff);
	border: 1px solid var(--color-border, rgba(196,98,45,0.28));
	box-shadow: 0 10px 30px rgba(28,23,18,0.14);
	max-height: 70vh; overflow-y: auto; text-align: left;
	font-family: var(--font-accent, 'Libre Franklin', sans-serif);
}
.pdt-suggest-group { padding: 6px 0; border-bottom: 1px solid var(--color-border-subtle, rgba(196,98,45,0.14)); }
.pdt-suggest-group:last-of-type { border-bottom: 0; }
.pdt-suggest-h { font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--color-text-muted, #9A7A5A); padding: 6px 14px 2px; }
.pdt-suggest-item { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 7px 14px; text-decoration: none; color: var(--ink, #1C1712); font-size: 14px; line-height: 1.3; }
.pdt-suggest-item:hover, .pdt-suggest-item.active { background: var(--color-surface-sunken, #FBF6E9); color: var(--canyon, #8B3A1E); }
.pdt-suggest-title { font-family: 'Libre Baskerville', Georgia, serif; }
.pdt-suggest-meta { font-size: 12px; color: var(--color-text-muted, #7A5A3A); white-space: nowrap; }
.pdt-suggest-all { font-weight: 600; color: var(--terracotta, #C4622D); padding: 10px 14px; }

/* ── Masthead search box ──
   Always open, in the utility bar next to Log In: a dark field with an ochre button so it
   reads as the one bright control in the bar. The masthead clips overflow, so it is
   unclipped while the dropdown is open (JS adds .search-open; :has() covers it too). */
.masthead-top { position: relative; z-index: 1000; } /* the bar and its dropdown stack above the logo block and the sticky nav */
.masthead-search { display: inline-flex; align-items: stretch; position: relative; margin: 0 4px 0 6px; z-index: 70; }
.masthead-search input[name="s"] {
	width: 190px; padding: 5px 12px; margin: 0; border: 1px solid rgba(232,168,32,0.75); border-right: 0; border-radius: 3px 0 0 3px;
	background: rgba(255,244,220,0.10); color: #fff4dc; font-family: 'Libre Baskerville', Georgia, serif; font-size: 13px; line-height: 1.3;
	transition: width .15s ease, background .15s ease;
}
.masthead-search input[name="s"]:focus { outline: none; background: rgba(255,244,220,0.16); width: 240px; }
.masthead-search input[name="s"]::placeholder { color: rgba(255,244,220,0.6); }
.masthead-search-toggle {
	display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; margin: 0; border: 1px solid var(--ochre-light, #E8A820); border-radius: 0 3px 3px 0;
	background: var(--ochre-light, #E8A820); color: #1a0a02; cursor: pointer; font: inherit; font-weight: 700; letter-spacing: inherit; text-transform: inherit;
}
.masthead-search-toggle:hover { background: #f2b93a; }
.masthead-search-toggle svg { width: 14px; height: 14px; }
.masthead-search .pdt-suggest { top: calc(100% + 8px); right: 0; left: auto; width: 400px; max-width: 90vw; z-index: 1001; }
header.masthead.search-open, header.masthead:has(.masthead-search.open), header.masthead:has(.masthead-search input:focus) { overflow: visible; }
/* The masthead redefines the ink tokens for its dark ground; the dropdown is a light panel. */
.masthead-search .pdt-suggest, .masthead-search .pdt-suggest-item { background: #fff; color: #1C1712; }
.masthead-search .pdt-suggest a { text-transform: none; letter-spacing: 0; border-radius: 0; padding: 7px 14px; font-size: 14px; }
.masthead-search .pdt-suggest-item:hover, .masthead-search .pdt-suggest-item.active { background: #FBF6E9; color: #8B3A1E; }
.masthead-search .pdt-suggest-h, .masthead-search .pdt-suggest-meta { color: #7A5A3A; }
.masthead-search .pdt-suggest-all { color: #C4622D; }
/* The utility bar must stay on one line; below 1400px the box is fixed-width and the button is icon-only. */
.masthead-util { flex-shrink: 0; }
.masthead-util a, .masthead-search { white-space: nowrap; }
@media (max-width: 1400px) { .masthead-util { gap: 6px; } .masthead-util a { padding: 4px 5px; } .masthead-search input[name="s"], .masthead-search input[name="s"]:focus { width: 110px; } .masthead-search-toggle span { display: none; } .masthead-search-toggle { padding: 0 9px; } }
@media (max-width: 1100px) { .masthead-search input[name="s"], .masthead-search input[name="s"]:focus { width: 100px; } }
@media (max-width: 900px) { .masthead-search { display: none; } }

/* ── Results page ── */
.pdt-search-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: 4px 0 18px; font-family: var(--font-accent, 'Libre Franklin', sans-serif); font-size: 13px; color: var(--color-text-muted, #7A5A3A); }
.pdt-search-sort { display: flex; gap: 2px; align-items: center; }
.pdt-search-sort span { margin-right: 6px; letter-spacing: 1.2px; text-transform: uppercase; font-size: 11px; font-weight: 600; }
.pdt-search-sort a { padding: 4px 10px; text-decoration: none; color: var(--canyon, #8B3A1E); border: 1px solid transparent; border-radius: 2px; }
.pdt-search-sort a.active { background: var(--canyon, #8B3A1E); color: #fff; }
.pdt-search-note { background: var(--color-surface-sunken, #FBF6E9); border-left: 3px solid var(--ochre, #E8A820); padding: 10px 14px; margin: 0 0 16px; font-family: 'Libre Baskerville', Georgia, serif; font-size: 14px; }
.pdt-search-note a { color: var(--canyon, #8B3A1E); font-weight: 700; }

.pdt-search-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; align-items: start; }
@media (max-width: 900px) { .pdt-search-layout { grid-template-columns: 1fr; } }

.pdt-search-results { display: flex; flex-direction: column; }
.pdt-sr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px 0; border-top: 1px solid var(--color-border-subtle, rgba(196,98,45,0.18)); }
.pdt-sr.has-image { grid-template-columns: minmax(0, 1fr) 150px; }
.pdt-sr:first-child { border-top: 0; padding-top: 4px; }
/* A result keeps its own section's colour: the label in the section's ink,
   with the ribbon band itself as a swatch in front of it. */
.pdt-sr-kicker { display: flex; align-items: center; gap: 10px; font-family: var(--font-accent, 'Libre Franklin', sans-serif); font-weight: 600; font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--tone-ink, #B55825); margin-bottom: 4px; }
.pdt-sr-section::before { content: ''; display: inline-block; width: 16px; height: 6px; margin-right: 7px; vertical-align: 1px; background: var(--tone, #C4622D); }
.pdt-sr[class*="tone-"] .pdt-sr-title a:hover { color: var(--tone-ink, #B55825); }
.pdt-sr-kind { color: var(--color-text-muted, #9A7A5A); }
.pdt-sr-title { font-family: 'Noto Serif', Georgia, serif; font-weight: 700; font-size: 21px; line-height: 1.22; margin: 0 0 6px; }
.pdt-sr-title a { color: var(--ink, #1C1712); text-decoration: none; }
.pdt-sr-title a:hover { color: var(--canyon, #8B3A1E); }
.pdt-sr-page .pdt-sr-title { font-size: 17px; }
.pdt-sr-snippet { font-family: 'Libre Baskerville', Georgia, serif; font-size: 14.5px; line-height: 1.6; color: rgba(28,23,18,0.78); margin: 0 0 8px; }
.pdt-sr mark { background: var(--color-mark, #F6E7B0); color: inherit; padding: 0 1px; }
.pdt-sr-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--font-accent, 'Libre Franklin', sans-serif); font-size: 12.5px; color: var(--color-text-muted, #7A5A3A); }
.pdt-sr-byline { font-weight: 600; color: var(--ink, #1C1712); }
.pdt-sr-print { color: var(--canyon, #8B3A1E); text-decoration: none; }
a.pdt-sr-print:hover { text-decoration: underline; }
.pdt-sr-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--color-surface-sunken, #F3EBDD); }
.pdt-sr-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdt-sr-pagethumb { aspect-ratio: 3 / 4; }
@media (max-width: 600px) { .pdt-sr.has-image { grid-template-columns: minmax(0, 1fr) 96px; } .pdt-sr-title { font-size: 19px; } }

/* Facets: a quiet sidebar, not a box per facet */
.pdt-facets { position: sticky; top: 16px; font-family: var(--font-accent, 'Libre Franklin', sans-serif); }
.pdt-facet { padding: 12px 0 14px; border-top: 1px solid var(--color-border-subtle, rgba(196,98,45,0.18)); }
.pdt-facet:first-child { border-top: 0; padding-top: 0; }
.pdt-facet-h { font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--color-text-muted, #9A7A5A); margin-bottom: 8px; }
.pdt-facet ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pdt-facet li a { display: flex; justify-content: space-between; gap: 10px; padding: 4px 6px; margin: 0 -6px; text-decoration: none; color: var(--ink, #1C1712); font-size: 13.5px; border-radius: 2px; }
.pdt-facet li a:hover { background: var(--color-surface-sunken, #FBF6E9); color: var(--canyon, #8B3A1E); }
.pdt-facet li a.active { background: var(--canyon, #8B3A1E); color: #fff; }
.pdt-facet li a.active:hover { background: var(--canyon, #8B3A1E); color: #fff; }
.pdt-facet-n { font-variant-numeric: tabular-nums; color: var(--color-text-muted, #9A7A5A); font-size: 12px; }
.pdt-facet li a.active .pdt-facet-n { color: rgba(255,255,255,0.75); }
.pdt-facet.years ul { flex-direction: row; flex-wrap: wrap; gap: 4px; }
.pdt-facet.years li a { padding: 3px 9px; margin: 0; border: 1px solid var(--color-border, rgba(196,98,45,0.25)); font-size: 12.5px; gap: 5px; }
.pdt-facet-clear { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--canyon, #8B3A1E); }
@media (max-width: 900px) {
	.pdt-facets { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 24px; }
}

/* Printed paper hits */
.pdt-print-hits { margin-top: 36px; padding-top: 18px; border-top: 3px double var(--color-border, rgba(196,98,45,0.35)); }
.pdt-print-hits-h { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.pdt-print-hits-h h2 { font-family: 'Noto Serif', Georgia, serif; font-size: 20px; margin: 0; }
.pdt-print-hits-h a { font-family: var(--font-accent, 'Libre Franklin', sans-serif); font-size: 13px; color: var(--canyon, #8B3A1E); }
.pdt-print-hits-lede { font-family: 'Libre Baskerville', Georgia, serif; font-style: italic; font-size: 13.5px; color: var(--color-text-muted, #7A5A3A); margin: 0 0 6px; }
.pdt-sr.pdt-sr-page { grid-template-columns: minmax(0, 1fr) 90px; }

/* Pagination reuse: the theme styles .archive-pagination */

/* ── The recent window and the whole-archive box ── */
.pdt-search-archive { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin: 0 0 18px; padding: 14px 18px; text-decoration: none; background: var(--color-surface-sunken, #FBF6E9); border: 1px solid var(--color-border, rgba(196,98,45,0.3)); border-left: 4px solid var(--canyon, #8B3A1E); color: var(--ink, #1C1712); transition: border-color .15s, background .15s; }
a.pdt-search-archive:hover { background: #fff; border-color: var(--canyon, #8B3A1E); }
.pdt-search-archive-k { font-family: var(--font-accent, 'Libre Franklin', sans-serif); font-weight: 600; font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--color-text-muted, #9A7A5A); }
.pdt-search-archive-t { font-family: 'Noto Serif', Georgia, serif; font-weight: 700; font-size: 17px; color: var(--canyon, #8B3A1E); }
.pdt-search-archive-t em { font-style: normal; font-family: var(--font-accent, 'Libre Franklin', sans-serif); font-weight: 600; font-size: 12px; letter-spacing: .6px; color: var(--color-text-muted, #7A5A3A); margin-left: 8px; }
.pdt-search-archive.is-open { border-left-color: var(--ochre, #E8A820); }
.pdt-search-archive.is-open a { font-family: var(--font-accent, 'Libre Franklin', sans-serif); font-size: 13px; color: var(--canyon, #8B3A1E); }
