/* gurkencheck documentation site */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-code: #f2f4f7;
  --text: #1a1d21;
  --text-soft: #5b636d;
  --border: #dfe3e8;
  --accent: #2f6f4f;
  --accent-soft: #e8f2ec;
  --good: #2f7d47;
  --good-soft: #eef7f0;
  --bad: #b3261e;
  --bad-soft: #fdeeed;
  --radius: 8px;
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --bg-soft: #1b1f23;
    --bg-code: #1e2329;
    --text: #e6e8ea;
    --text-soft: #a2aab4;
    --border: #2c333a;
    --accent: #7fc7a1;
    --accent-soft: #1d2a24;
    --good: #7fc7a1;
    --good-soft: #17241d;
    --bad: #f2837c;
    --bad-soft: #2a1a19;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--bg);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

header.site .inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
}

header.site .name {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
}

header.site .tagline {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.layout {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

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

nav.rules {
  position: sticky;
  top: 1.5rem;
  padding: 2rem 0;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  font-size: 0.9rem;
}

nav.rules h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin: 1.25rem 0 0.5rem;
}

nav.rules ul { list-style: none; margin: 0; padding: 0; }
nav.rules li { margin: 0.15rem 0; }
nav.rules a {
  display: block;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  text-decoration: none;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
nav.rules a:hover { background: var(--bg-soft); color: var(--text); }
nav.rules a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

main {
  padding: 2rem 0 4rem;
  min-width: 0;
}

main > * { max-width: var(--measure); }
main > .wide { max-width: none; }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 0.5rem; }
h2 { font-size: 1.3rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 1.75rem 0 0.5rem; }

.lede {
  font-size: 1.1rem;
  color: var(--text-soft);
  margin: 0 0 1.5rem;
}

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  background: var(--bg-code);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 0;
}

pre code, h1 code, h2 code { background: none; padding: 0; }

.example {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0.75rem 0 1.25rem;
}

.example .label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
}

.example.good .label { background: var(--good-soft); color: var(--good); }
.example.bad .label { background: var(--bad-soft); color: var(--bad); }

.example pre { border: 0; border-radius: 0; background: var(--bg); }

.example .outcome {
  border-top: 1px solid var(--border);
  background: var(--bad-soft);
  color: var(--bad);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.example .outcome code { background: transparent; padding: 0; }

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
}

td:first-child { white-space: nowrap; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
}

.rule-list { list-style: none; margin: 0; padding: 0; }

.rule-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.rule-list a { font-weight: 600; text-decoration: none; }
.rule-list a:hover { text-decoration: underline; }
.rule-list p { margin: 0.2rem 0 0; color: var(--text-soft); font-size: 0.94rem; }

.anchor {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
  padding-left: 0.35rem;
}
h3:hover .anchor, .anchor:focus { opacity: 1; }

footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}

@media (max-width: 52rem) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  nav.rules { position: static; max-height: none; padding: 1.5rem 0 0; }
}
