:root {
  --rind: #2f7d4f;
  --flesh: #e5484d;
  --text: #202124;
  --muted: #6b7178;
  --link: #1a0dab;
  --line: #e6e8eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: #fff;
}

/* home page: logo + box in the middle of the screen */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding-top: 26vh;
}

.logo {
  font-size: 60px;
  font-weight: 800;
  letter-spacing: -2px;
  text-decoration: none;
}
.logo .cat { color: var(--rind); }
.logo .melon { color: var(--flesh); }

.tagline { margin: 0; font-size: 14px; color: var(--muted); }

form { display: flex; width: min(600px, 100%); }

/* holds the text box and the suggestion dropdown under it */
.box { flex: 1; display: flex; position: relative; min-width: 0; }

input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  padding: 12px 18px;
  border: 1px solid #dfe1e5;
  border-right: none;
  border-radius: 24px 0 0 24px;
  outline: none;
}
input:focus { border-color: var(--rind); }

button {
  padding: 0 22px;
  font-size: 15px;
  color: #fff;
  background: var(--rind);
  border: 1px solid var(--rind);
  border-radius: 0 24px 24px 0;
  cursor: pointer;
}
button:hover { background: #276a43; }

/* search suggestions dropdown */
.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #dfe1e5;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(32, 33, 36, 0.15);
}
.suggestions[hidden] { display: none; }
.suggestions li { padding: 7px 18px; font-size: 15px; cursor: pointer; }
.suggestions li b { font-weight: 600; }
.suggestions li.active,
.suggestions li:hover { background: #f1f3f4; }

main { width: min(680px, 92vw); margin: 0 auto; padding-bottom: 60px; }

/* results page: the header shrinks into a bar */
body.has-results header {
  flex-direction: row;
  flex-wrap: wrap;            /* on phones the box drops under the logo */
  justify-content: center;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
body.has-results .logo { font-size: 28px; letter-spacing: -1px; }
body.has-results .tagline { display: none; }

#status { margin: 16px 0 20px; font-size: 14px; color: var(--muted); }

/* "Did you mean ...?" */
#spelling { margin: -8px 0 22px; font-size: 16px; color: var(--flesh); }
#spelling[hidden] { display: none; }
#spelling a { color: var(--link); font-weight: 600; font-style: italic; text-decoration: none; }
#spelling a:hover { text-decoration: underline; }

.result { margin-bottom: 26px; }

.result .title {
  font-size: 19px;
  line-height: 1.3;
  color: var(--link);
  text-decoration: none;
}
.result .title:hover { text-decoration: underline; }

.result .meta { margin: 3px 0; font-size: 13px; color: var(--rind); overflow-wrap: anywhere; }
.result .meta a { color: var(--muted); margin-left: 8px; text-decoration: none; }
.result .meta a:hover { text-decoration: underline; }

.snippet { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: #4d5156; }
.snippet b { color: var(--text); }

.debug {
  margin-top: 6px;
  padding: 4px 8px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: #8a4b00;
  background: #fff7e8;
  border-radius: 4px;
}

.debug-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

#sentinel { height: 1px; }
