/* Kawasaki Versys 1000 manual site — single stylesheet, no dependencies. */

:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --border: #d9d7d1;
  --text: #1d1d1b;
  --muted: #5f5d57;
  --accent: #0b7a45;
  --accent-ink: #ffffff;
  --focus: #0b7a45;
  --radius: 10px;
  --maxw: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #1f2125;
    --border: #34373d;
    --text: #e9e9e6;
    --muted: #a3a49f;
    --accent: #3ec27c;
    --accent-ink: #10241a;
    --focus: #3ec27c;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 0.9rem; }

/* --- top bar -------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  flex-wrap: wrap;
}
.topbar a { text-decoration: none; font-weight: 600; }
.topbar .sep { color: var(--muted); }
.topbar .spacer { flex: 1 1 auto; }
.topbar .here { color: var(--muted); font-weight: 500; }

/* --- headings ------------------------------------------------------------- */
h1 { font-size: 1.4rem; line-height: 1.25; margin: 1.1rem 0 0.3rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; }
h1 .sub { font-weight: 400; color: var(--muted); font-size: 0.85em; }
.lede { color: var(--muted); margin: 0.2rem 0 1rem; }
.crumb-line {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.8rem;
  word-break: break-word;
}

/* --- pager ---------------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  flex-wrap: wrap;
}
.pager .btn { flex: 0 0 auto; }
.pager form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin: 0 auto;
}
.pager input[type="number"] {
  width: 5.2rem;
  padding: 0.45rem 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.pager .of { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

.btn {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* --- page image ----------------------------------------------------------- */
.page-figure { margin: 0; }
.page-viewport {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.page-image {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}
.page-viewport.zoomed .page-image {
  width: auto;
  max-width: none;
  cursor: zoom-out;
}
.img-note {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.4rem 0 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* --- cards / lists -------------------------------------------------------- */
.cards { display: grid; gap: 0.8rem; grid-template-columns: 1fr; margin: 1rem 0; }
@media (min-width: 42rem) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.9rem 1rem;
}
.card h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.card h3 a { text-decoration: none; }
.card .meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.5rem; }
.card p { margin: 0.35rem 0; }
.card .src { color: var(--muted); font-size: 0.8rem; }

details.chapter {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 0.5rem 0;
  padding: 0.2rem 0.75rem;
}
details.chapter > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.55rem 0;
  list-style-position: inside;
}
details.chapter > summary .pg { font-weight: 400; color: var(--muted); font-size: 0.85em; }
.toc { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.toc li { margin: 0.12rem 0; }
.toc a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0.2rem;
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}
.toc a:hover { background: rgba(127, 127, 127, 0.09); }
.toc .pg { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.toc .d1 { padding-left: 0; }
.toc .d2 { padding-left: 1rem; }
.toc .d3 { padding-left: 2rem; }
.toc .d4 { padding-left: 3rem; }

.grid-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.4rem, 1fr));
  gap: 0.35rem;
  padding: 0.4rem 0 0.8rem;
}
.grid-pages a {
  text-align: center;
  padding: 0.45rem 0.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  background: var(--bg);
}

/* --- search --------------------------------------------------------------- */
#search-ui { margin: 0.5rem 0 1.5rem; }
.search-note { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0 0; }
:root { --pagefind-ui-scale: 0.85; }

/* --- misc ----------------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.notice {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.7rem 0.9rem;
  margin: 0.9rem 0;
  font-size: 0.9rem;
}

/* Text kept for the search index but not shown on screen. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.full-image { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
