/* bsv_library - the craigwright.net Archive in the reading look (cwa, 8-9 Nov 2026).
   SAFETY (cwa3i, 9 Nov): this file is attached only on archive pages (bsv_library_page_attachments),
   and every rule below also requires body.cwa-archive, a class bsv_library adds on archive pages only.
   Creations pages never load this file and never carry that class. */

/* Links follow the reader theme like body links. */
.cwa-archive .reader-main .cwa-provenance a,
.cwa-archive .reader-main .cwa-page a,
.cwa-archive .reader-main .view-cwa-archive-search a,
.cwa-archive .reader .cwa-search-box a { color: var(--r-link); }
.cwa-archive .reader-main .cwa-provenance { margin-top: 2em; }

/* Search box in the right-hand rail. The site's theme.css gives every exposed
   filter form a white card with a coloured top line; in the reading look the
   box follows the reader theme instead. */
.cwa-archive .reader .cwa-search.views-exposed-form,
.cwa-archive .reader .cwa-search {
  background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; color: inherit;
}
.cwa-archive .reader .cwa-search label,
.cwa-archive .reader .cwa-search legend,
.cwa-archive .reader .cwa-search .fieldset-legend { color: inherit; }
.cwa-archive .reader .cwa-search input::placeholder { color: inherit; opacity: .5; }
/* theme.css paints the exposed form (teal top line) and its fieldsets (white) with
   rules that win on order and weight, so these two are forced, inside the rail only. */
.cwa-archive .reader .cwa-search-box form.cwa-search { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; }
.cwa-archive .reader .cwa-search-box fieldset { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 0 .9em !important; }

.cwa-archive .reader .cwa-search-box { margin: 0 0 2em; }
.cwa-archive .reader .cwa-search-box .cwa-search-title { font-size: 1.05em; margin: 0 0 .6em; }
.cwa-archive .reader .cwa-search .form-item,
.cwa-archive .reader .cwa-search .js-form-item { margin: 0 0 .9em; }
.cwa-archive .reader .cwa-search label { display: block; font-size: .85em; margin: 0 0 .3em; font-weight: 600; }
.cwa-archive .reader .cwa-search fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cwa-archive .reader .cwa-search legend { font-size: .85em; font-weight: 600; padding: 0; margin: 0 0 .3em; }
.cwa-archive .reader .cwa-search input[type="text"],
.cwa-archive .reader .cwa-search input[type="search"],
.cwa-archive .reader .cwa-search input[type="date"] {
  display: block; width: 100%; box-sizing: border-box;
  background: transparent; color: inherit; font: inherit; font-size: .95em;
  border: 1px solid currentColor; border-radius: 6px; padding: .45em .55em; opacity: .9;
}
.cwa-archive .reader .cwa-search .description { display: none; }
.cwa-archive .reader .cwa-search .form-actions { display: flex; gap: .5em; flex-wrap: wrap; margin-top: .4em; }
.cwa-archive .reader .cwa-search .form-actions input,
.cwa-archive .reader .cwa-search .form-actions button {
  background: transparent; color: var(--r-link); border: 1px solid var(--r-link);
  border-radius: 999px; padding: .4em 1.1em; font: inherit; font-size: .9em; cursor: pointer;
}
.cwa-archive .reader .cwa-search .form-actions input:hover,
.cwa-archive .reader .cwa-search .form-actions button:hover { text-decoration: underline; }
:root:is([data-reader-theme="dark"], [data-reader-theme="night"]) .cwa-archive .reader .cwa-search input { color-scheme: dark; }

/* Results and the archive list. */
.cwa-archive .reader-main .view-cwa-archive-search .view-header { font-size: .9em; opacity: .8; margin-bottom: 1em; }
.cwa-archive .reader-main .view-cwa-archive-search ul,
.cwa-archive .reader-main .cwa-page ul.cwa-articles { list-style: none; padding: 0; margin: 0; }
.cwa-archive .reader-main .view-cwa-archive-search li,
.cwa-archive .reader-main .cwa-page ul.cwa-articles li { margin: 0 0 .8em; }
.cwa-archive .reader-main .view-cwa-archive-search .cwa-date,
.cwa-archive .reader-main .view-cwa-archive-search .views-field-created,
.cwa-archive .reader-main .cwa-page .cwa-date { display: block; font-size: .85em; opacity: .75; }

/* The theme's views template prints no view-id class, so the results are styled
   by their own field classes (cwa-title / cwa-date, set in the view). */
.cwa-archive .reader-main .item-list ul:has(.cwa-title) { list-style: none; padding: 0; margin: 0; }
.cwa-archive .reader-main .item-list ul:has(.cwa-title) > li { margin: 0 0 .9em; }
.cwa-archive .reader-main .cwa-title a { color: var(--r-link); }
.cwa-archive .reader-main span.cwa-date { display: block; font-size: .85em; opacity: .75; }

/* Quick links under the search box: Browse by year / Browse by section (cwa3). */
/* The theme's item-list template prints the list title as an <h3> straight in the
   column (no wrapper), so it is styled as a direct child of the search box. */
.cwa-archive .reader .cwa-search-box > h3 {
  color: inherit; font-family: inherit; font-size: .78em; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; opacity: .75; margin: 2em 0 .5em; padding: 0 0 .4em;
  border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}
.cwa-archive .reader .cwa-search-box .cwa-browse ul { list-style: none; padding: 0; margin: 0; }
.cwa-archive .reader .cwa-search-box .cwa-browse li { display: flex; justify-content: space-between; gap: .75em; padding: .25em 0; border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent); font-size: .92em; }
.cwa-archive .reader .cwa-search-box .cwa-browse a { text-decoration: none; }
.cwa-archive .reader .cwa-search-box .cwa-browse a:hover { text-decoration: underline; }
.cwa-archive .reader .cwa-search-box .cwa-browse a.is-active { font-weight: 700; }
.cwa-archive .reader .cwa-search-box .cwa-browse .cwa-count { opacity: .6; font-variant-numeric: tabular-nums; }
.cwa-archive .reader .cwa-search select {
  display: block; width: 100%; box-sizing: border-box; background: transparent; color: inherit; font: inherit; font-size: .95em;
  border: 1px solid currentColor; border-radius: 6px; padding: .4em .5em; opacity: .9;
}
.cwa-archive .reader .cwa-search select option { color: #222; background: #fff; }
:root:is([data-reader-theme="dark"], [data-reader-theme="night"]) .cwa-archive .reader .cwa-search select { color-scheme: dark; }
:root:is([data-reader-theme="dark"], [data-reader-theme="night"]) .cwa-archive .reader .cwa-search select option { color: #e8e8e8; background: #1b1f24; }
.cwa-archive .reader-main .cwa-page .cwa-about-link,
.cwa-archive .reader-main .cwa-page .cwa-all-link { margin: 1em 0; }

/* Headings inside archive texts (cwa3h, Marquez 9 Nov): craigwright.net used h4/h5 for section
   headings, which the reader style keeps smaller than the text. Here every level is larger than
   the body text, measured from the reader's own text size (var(--r-size), set by Aa), so the
   headings stay larger at every size. */
.cwa-archive .reader-main .field--name-body :is(h2, h3, h4, h5, h6) { font-weight: 700; line-height: 1.3; margin: 1.7em 0 .55em; letter-spacing: 0; text-transform: none; }
.cwa-archive .reader-main .field--name-body h2 { font-size: calc(var(--r-size, 1.1875rem) * 1.45); }
.cwa-archive .reader-main .field--name-body h3 { font-size: calc(var(--r-size, 1.1875rem) * 1.3); }
.cwa-archive .reader-main .field--name-body h4 { font-size: calc(var(--r-size, 1.1875rem) * 1.2); }
.cwa-archive .reader-main .field--name-body h5 { font-size: calc(var(--r-size, 1.1875rem) * 1.12); }
.cwa-archive .reader-main .field--name-body h6 { font-size: calc(var(--r-size, 1.1875rem) * 1.06); }

