/* Brand restyle for the three archive routes still served by the legacy theme:
   tag archives, search results, and date archives. Everything else on the site
   renders through a site-seo shell that paints its own light paper; these fall
   through to site-background.css's deep canvas instead, so they arrived as a
   near-black page with EB Garamond headings and 15px Mulish story titles. A
   reader clicking one of the six tag chips at the foot of every article landed
   on what looked like a different publication.

   This file used to do the opposite: it forced labels to near-white so they
   stayed legible "against its midnight background". That was a patch on the
   symptom. The pages are now put on the same paper as the rest of the site,
   and the white overrides are gone with the background that required them.

   Filename kept as tag-archives.css so the asset keeps its identity across
   deploys; the module simply covers all three legacy routes now. See
   tag-archives.php for the matching enqueue condition.

   Scope discipline, learned the hard way while building this: `main` here also
   contains the sidebar, whose panels are deliberately dark with white text.
   Recolouring by element type alone turned 18 sidebar links ink-on-navy at a
   1.0 contrast ratio. The sidebar rules at the bottom restate its treatment and
   must stay last. */

/* Same value as body below, not --yh-brand-snow: that token is #f6f8fa, and
   the lighter html canvas showed as a band under any archive shorter than the
   viewport. */
html:has(> body.tag),
html:has(> body.search),
html:has(> body.date) {
  background: #e8edec !important;
}

/* The theme paints a dark gradient on body and site-background.css sets a deep
   canvas on html; both are replaced rather than layered over. */
body.tag,
body.search,
body.date {
  background: #e8edec !important;
  color: #16272f !important;
}

/* ---------- archive heading ---------- */

body.tag main .wp-block-query-title,
body.search main .wp-block-query-title,
body.date main .wp-block-query-title,
body.search .yh-search-hero h1 {
  color: #16272f !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: clamp(30px, 4vw, 42px) !important;
  line-height: 1.12 !important;
}

/* The search hero is its own template part with a transparent background, so
   its kicker and summary were tuned for the dark canvas and would otherwise
   disappear on paper. */
body.search .yh-search-hero > p:first-child {
  color: #0e5a46 !important;
}

body.search .yh-search-summary {
  color: #5d7078 !important;
}

/* ---------- story list ---------- */

body.tag main .wp-block-post-title,
body.tag main .wp-block-post-title a,
body.search main .wp-block-post-title,
body.search main .wp-block-post-title a,
body.date main .wp-block-post-title,
body.date main .wp-block-post-title a {
  color: #16272f !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 25px !important;
  line-height: 1.15 !important;
}

body.tag main .wp-block-post-title a:hover,
body.tag main .wp-block-post-title a:focus-visible,
body.search main .wp-block-post-title a:hover,
body.search main .wp-block-post-title a:focus-visible,
body.date main .wp-block-post-title a:hover,
body.date main .wp-block-post-title a:focus-visible {
  color: #0e5a46 !important;
}

/* post-excerpt and post-date each carry the colour on an inner element as well
   as the block wrapper, and the date's is on the bare <time>. */
body.tag main .wp-block-post-excerpt,
body.tag main .wp-block-post-excerpt__excerpt,
body.tag main .wp-block-post-date,
body.tag main .wp-block-post-date time,
body.tag main .wp-block-post-author,
body.tag main .wp-block-post-author-name,
body.tag main .wp-block-post-author-name__link,
body.tag main .wp-block-query-pagination,
body.search main .wp-block-post-excerpt,
body.search main .wp-block-post-excerpt__excerpt,
body.search main .wp-block-post-date,
body.search main .wp-block-post-date time,
body.search main .wp-block-post-author,
body.search main .wp-block-post-author-name,
body.search main .wp-block-post-author-name__link,
body.search main .wp-block-query-pagination,
body.date main .wp-block-post-excerpt,
body.date main .wp-block-post-excerpt__excerpt,
body.date main .wp-block-post-date,
body.date main .wp-block-post-date time,
body.date main .wp-block-post-author,
body.date main .wp-block-post-author-name,
body.date main .wp-block-post-author-name__link,
body.date main .wp-block-query-pagination {
  color: #5d7078 !important;
}

body.tag main .wp-block-query-pagination a,
body.search main .wp-block-query-pagination a,
body.date main .wp-block-query-pagination a {
  color: #0e5a46 !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

body.tag main .wp-block-query-pagination a:hover,
body.tag main .wp-block-query-pagination a:focus-visible,
body.search main .wp-block-query-pagination a:hover,
body.date main .wp-block-query-pagination a:hover {
  color: #0b2233 !important;
}

/* ---------- off-brand accents ----------
   The category pills and the search button shipped in the theme's blue
   (#115cef / #0b5bd3). Both are self-contained white-on-colour, so they were
   legible, just not Yooper. Moved onto the evergreen the rest of the site uses
   for actions; white on #0e5a46 clears 8:1. */

body.search .yh-search-hero button,
body.tag main .taxonomy-category a,
body.search main .taxonomy-category a,
body.date main .taxonomy-category a {
  background: #0e5a46 !important;
}

body.tag main a:focus-visible,
body.search main a:focus-visible,
body.date main a:focus-visible {
  outline: 3px solid #0e5a46;
  outline-offset: 3px;
}

/* ---------- sidebar: keep its own dark panels ----------
   These must remain the last colour rules in the file. `main` contains the
   aside, so every selector above also matches the sidebar's story titles; this
   restates the panel treatment and wins on order. */

body.tag aside .wp-block-post-title,
body.tag aside .wp-block-post-title a,
body.search aside .wp-block-post-title,
body.search aside .wp-block-post-title a,
body.date aside .wp-block-post-title,
body.date aside .wp-block-post-title a {
  color: #f4f8fc !important;
  font-family: Mulish, Arial, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.3 !important;
}

body.tag aside .wp-block-post-title a:hover,
body.tag aside .wp-block-post-title a:focus-visible,
body.search aside .wp-block-post-title a:hover,
body.date aside .wp-block-post-title a:hover {
  color: #7de0c9 !important;
}
