/* Wikinews search: light grey page, near-black type, square corners, thin rules.
   The three retrieval families keep the colours of the presentation:
   BM25 dark slate, kNN teal, hybrid orange. */

:root {
  --page: #f1f1f1;
  --paper: #ffffff;
  --ink: #181818;
  --muted: #6b7275;
  --line: #d6d9da;
  --night: #141414;
  --bm25: #23373b;
  --knn: #4e7c8a;
  --hybrid: #eb811b;
  --font: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--ink);
}

[hidden] {
  display: none !important;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--ink);
}

/* ---- header: dark band with the search form ---------------------------------------------- */

header {
  background: var(--night);
  color: #fff;
  padding: 26px 0 30px;
}

h1 {
  margin: 0 0 4px;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 a {
  color: #fff;
  text-decoration: none;
}

.tagline {
  margin: 0 0 22px;
  color: #a7adb0;
  font-size: 14px;
  font-weight: 300;
}

/* Corner marks around the form, the one decorative motif of the page. */
form {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px;
}

form::before,
form::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid #8b9295;
  pointer-events: none;
}

form::before {
  top: 0;
  left: 0;
  border-top-width: 1px;
  border-left-width: 1px;
}

form::after {
  right: 0;
  bottom: 0;
  border-right-width: 1px;
  border-bottom-width: 1px;
}

input, select, button {
  font-family: inherit;
  border-radius: 0;
}

input[type="search"] {
  flex: 1 1 320px;
  height: 44px;
  padding: 0 14px;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #fff;
  outline: none;
}

input[type="search"]:focus {
  border-color: var(--hybrid);
  box-shadow: inset 0 0 0 1px var(--hybrid);
}

header select {
  height: 44px;
  padding: 0 34px 0 12px;
  font-size: 14px;
  color: #fff;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid #5a6164;
  appearance: none;
  cursor: pointer;
}

header select:hover,
header select:focus {
  border-color: #fff;
  outline: none;
}

header select option {
  color: var(--ink);
  background: #fff;
}

header label.inline {
  color: #d9dcdd;
}

header input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--hybrid);
}

button {
  height: 44px;
  padding: 0 22px;
  font-size: 15px;
  color: #fff;
  background: var(--hybrid);
  border: 1px solid var(--hybrid);
  cursor: pointer;
}

button:hover {
  background: #d4700e;
  border-color: #d4700e;
}

button:disabled {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}

button.link {
  height: auto;
  padding: 0;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.link:hover {
  color: var(--hybrid);
  background: none;
}

label.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

/* ---- layout: filters on the left, results on the right ----------------------------------- */

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 36px;
  margin-top: 28px;
}

h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}

aside section {
  padding: 0 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

label.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="date"] {
  height: 32px;
  padding: 0 6px;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
}

ul.facet {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13.5px;
}

ul.facet li label {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 2px 0;
  cursor: pointer;
}

ul.facet li label:hover span:not(.count) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

ul.facet .count {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

ul.facet .empty {
  color: var(--muted);
}

#status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ---- results: one column, or two in compare mode ----------------------------------------- */

#columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

#columns.compare {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Column header in compare mode: a band in the colour of the configuration's family. */
.column h2 {
  margin: 0;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--mono);
  color: #fff;
  background: var(--bm25);
}

.column[data-family="knn"] h2 {
  background: var(--knn);
}

.column[data-family="hybrid"] h2 {
  background: var(--hybrid);
}

.column > .column-status {
  margin: 6px 0 4px;
  color: var(--muted);
  font-size: 12.5px;
}

ol.results {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
}

ol.results > .column-status {
  padding: 16px;
  color: var(--muted);
}

.hit {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.hit:last-child {
  border-bottom: none;
}

.hit .rank {
  flex: none;
  min-width: 22px;
  padding-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

.hit img {
  flex: none;
  width: 84px;
  height: 63px;
  object-fit: cover;
  filter: grayscale(0.15);
}

.compare .hit img {
  width: 56px;
  height: 42px;
}

.hit a.title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-decoration: none;
}

.compare .hit a.title {
  font-size: 15.5px;
}

.hit a.title:hover {
  text-decoration: underline;
  text-decoration-color: var(--hybrid);
  text-underline-offset: 3px;
}

.hit .meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.hit .snippet {
  margin-top: 6px;
  font-size: 14px;
  color: #3a3f42;
}

.hit .snippet em, #doc em {
  font-style: normal;
  font-weight: 600;
  background: #fbe3cb;
}

.hit .tags {
  margin-top: 6px;
}

.tag {
  display: inline-block;
  margin: 2px 4px 0 0;
  padding: 0 6px;
  font-size: 11.5px;
  color: #3d4447;
  border: 1px solid var(--line);
  background: var(--page);
}

.unpublished {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 11.5px;
  color: #b0600f;
  border: 1px solid #f0c08f;
  vertical-align: 2px;
}

#pager {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 20px 0 40px;
  font-size: 13px;
  color: var(--muted);
}

#pager button {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
}

#pager button:hover:not(:disabled) {
  color: #fff;
  background: var(--ink);
}

#pager button:disabled {
  border-color: var(--line);
  color: var(--muted);
}

/* ---- document view ----------------------------------------------------------------------- */

#doc-view {
  max-width: 860px;
  margin-top: 24px;
}

#back {
  font-size: 13px;
  text-underline-offset: 3px;
}

#doc {
  margin-top: 12px;
  padding: 32px 36px 40px;
  background: var(--paper);
  border: 1px solid var(--line);
}

#doc h1 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--ink);
}

#doc .meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

#doc img {
  float: right;
  max-width: 260px;
  margin: 0 0 16px 20px;
}

#doc .tags {
  margin-bottom: 20px;
}

#doc .body {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.65;
  white-space: pre-line;
}

#doc h2 {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

#doc ul {
  padding-left: 18px;
  font-size: 14px;
}

#doc a {
  text-underline-offset: 3px;
}

/* ---- footer ------------------------------------------------------------------------------ */

footer {
  margin-top: 48px;
  padding: 18px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer a {
  color: var(--muted);
}

@media (max-width: 760px) {
  .layout, #columns.compare {
    grid-template-columns: minmax(0, 1fr);
  }
  /* On a phone the results come first, the filters after them. */
  .layout main {
    order: -1;
  }
  h1 {
    font-size: 28px;
  }
  #doc {
    padding: 20px;
  }
}
