/* archie web search: shared by index.html, archie.html, archie-adv.html, archie-help.html */

:root {
  --bg: #f6f7fb; --card: #fff; --fg: #1d2330; --muted: #5b6475; --line: #dde1ea;
  --accent: #2f5bd3; --accent-fg: #fff; --err: #b3261e; --hover: #eef1f8;
  --logo-bg: transparent;
  color-scheme: light dark;
}
/* dark: by the system unless chosen by hand (theme.js sets data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c; --card: #1b2029; --fg: #e6e9ef; --muted: #9aa3b5; --line: #2c3340;
    --accent: #8fb0ff; --accent-fg: #0d1220; --err: #ff8a80; --hover: #232a36;
    --logo-bg: #e8ecf4; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151c; --card: #1b2029; --fg: #e6e9ef; --muted: #9aa3b5; --line: #2c3340;
  --accent: #8fb0ff; --accent-fg: #0d1220; --err: #ff8a80; --hover: #232a36;
  --logo-bg: #e8ecf4; color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 72rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
a { color: var(--accent); }

header.brand { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
header.brand h1 { margin: 0; font-size: 2rem; letter-spacing: .04em; }
header.brand h1 a { color: inherit; text-decoration: none; }
header.brand p { margin: 0; color: var(--muted); }
/* the 1996 Bunyip logo: dark blue on transparent, so it gets a light
   ground of its own in dark mode */
header.brand { align-items: center; }
img.logo { display: block; width: 100%; max-width: 387px; height: auto; }
.results-logo { display: block; max-width: 100%; height: auto; }
img.logo, .results-logo { background: var(--logo-bg); border-radius: .6rem; padding: .3rem .6rem; }

/* the light/dark switch, at the right of the header */
.theme-switch { margin-left: auto; position: relative; display: inline-block; width: 3.4rem; height: 1.8rem; cursor: pointer; }
.theme-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.theme-switch .slider { position: absolute; inset: 0; border-radius: 1rem; background: var(--line); transition: background .2s; }
.theme-switch .slider::before { content: "\2600"; position: absolute; left: .2rem; top: .2rem; width: 1.4rem; height: 1.4rem;
  border-radius: 50%; background: var(--card); color: #c98a00; font-size: .9rem; line-height: 1.4rem; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.theme-switch input:checked + .slider { background: var(--accent); }
.theme-switch input:checked + .slider::before { content: "\263E"; color: #5b6fb3; transform: translateX(1.6rem); }
.theme-switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: .7rem;
        padding: 1rem 1.2rem; margin: 1rem 0; }

form.search .row { display: flex; gap: .5rem; flex-wrap: wrap; }
form.search input[type=text], form.search input[type=search], form.search input[type=number] {
  padding: .6rem .75rem; font: inherit; border: 1px solid var(--line); border-radius: .45rem;
  background: var(--bg); color: var(--fg); min-width: 0; }
form.search .row input[type=search], form.search .row input[type=text] { flex: 1 1 22rem; font-size: 1.05rem; }
button, input[type=submit] { padding: .6rem 1.2rem; font: inherit; border: 0; border-radius: .45rem;
  background: var(--accent); color: var(--accent-fg); cursor: pointer; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button:disabled { opacity: .6; cursor: wait; }

fieldset { border: 0; padding: 0; margin: .7rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: center; }
fieldset legend { float: left; font-weight: 600; color: var(--muted); padding: 0; margin-right: .3rem; min-width: 8rem; }
details { margin-top: .8rem; }
details summary { cursor: pointer; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .6rem 1.2rem; margin-top: .6rem; }
.grid label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); font-size: .9rem; }
.domains { display: flex; gap: .3rem; }
.domains input { width: 4.5rem; }

.status { color: var(--muted); margin: .8rem 0; min-height: 1.5em; }
.error { color: var(--err); font-weight: 600; }

.site { margin: 1.1rem 0 .3rem; font-weight: 600; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.site small { color: var(--muted); font-weight: normal; }
.scroll { overflow-x: auto; }
table.hits { border-collapse: collapse; width: 100%; }
table.hits td { padding: .25rem .6rem; border-top: 1px solid var(--line);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
table.hits tr:hover td { background: var(--hover); }
td.size { text-align: right; }
.path { color: var(--muted); }
.excerpt { margin: .2rem 0 .9rem 1.2rem; color: var(--muted); }
ol.strings { columns: 18rem; }

nav.links, footer { color: var(--muted); font-size: .9rem; }
nav.links { margin: 1rem 0; }
footer { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }

.help h2 { margin-top: 1.8rem; font-size: 1.15rem; }
.help dt { font-weight: 600; margin-top: .8rem; }
.help dd { margin: .2rem 0 0 1.2rem; }
.help pre { background: var(--hover); padding: .6rem .8rem; border-radius: .4rem; overflow-x: auto; }
.help code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
