/* Custom layer on top of Pico.css. Pico handles typography, forms, buttons,
   tables, code, links, containers, and light/dark theming. This file styles
   only the bespoke widgets Pico doesn't cover, reusing Pico's theme variables
   (--pico-*) so everything tracks Pico's palette and dark mode automatically. */

/* Pin the root font size. Pico's default scales it up to 131% on wide
   viewports, which reads as "zoomed in"; 100% keeps a normal 16px base. */
:root {
  font-size: 100%;
  --add-bg: #e6ffed;
  --del-bg: #ffeef0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --add-bg: #133a1e;
    --del-bg: #3a1416;
  }
}

/* Sticky application header. */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--pico-border-color);
  position: sticky;
  top: 0;
  background: var(--pico-background-color);
  z-index: 10;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  color: var(--pico-color);
  text-decoration: none;
}
.site-header .search {
  flex: 1;
  margin: 0;
}
.site-header .search input {
  margin: 0;
  max-width: 28rem;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-nav form {
  margin: 0;
}
.site-nav button {
  margin: 0;
  width: auto;
  padding: 0.35rem 0.7rem;
}
.site-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
}
.breadcrumb [aria-current="page"] {
  color: var(--pico-color);
  font-weight: 600;
}

/* Breadcrumb trail. */
.breadcrumb {
  padding: 0.6rem 1.25rem;
  color: var(--pico-muted-color);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--pico-border-color);
}
.breadcrumb .sep {
  margin: 0 0.4rem;
  color: var(--pico-border-color);
}

/* Reading column. */
.content {
  max-width: 72ch;
  margin: 2rem auto;
  padding: 0 1.25rem;
}

.meta {
  color: var(--pico-muted-color);
  font-size: 0.9rem;
}

/* Tag pills. */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
}
.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
  font-size: 0.8rem;
  text-decoration: none;
}

.cols {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.cols section {
  flex: 1;
  min-width: 12rem;
}
.linklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

/* Version-history timeline. */
.history {
  list-style: none;
  padding: 0;
  border-left: 2px solid var(--pico-border-color);
}
.history li {
  padding: 0.5rem 0 0.5rem 1rem;
}
.history .when {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}
.history .controls {
  margin-left: 0.5rem;
}

/* Change-kind badges. */
.badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--pico-code-background-color);
  color: var(--pico-muted-color);
}
.badge.deleted {
  background: var(--del-bg);
}
.badge.created {
  background: var(--add-bg);
}

.result {
  margin: 1.2rem 0;
}
.result .excerpt {
  color: var(--pico-muted-color);
}

/* Version diff (legacy styles; retained only for any non-shell pages). */
.compare-form {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.compare-form label {
  margin: 0;
}
.compare-form select {
  margin: 0;
}
.compare-form button {
  margin: 0;
  width: auto;
}
.diff-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  margin: 0.5rem 0;
}
.diff-legend .swatch {
  padding: 0 0.4rem;
  border-radius: 3px;
}
.diff-legend .add {
  background: var(--add-bg);
}
.diff-legend .del {
  background: var(--del-bg);
}
.diff {
  font-family: var(--pico-font-family-monospace);
  white-space: pre-wrap;
  font-size: 0.9rem;
}
.diff .add {
  background: var(--add-bg);
}
.diff .del {
  background: var(--del-bg);
}

.banner {
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
  padding: 0.6rem 1rem;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1.5rem;
}
.banner a {
  color: inherit;
}
.empty {
  color: var(--pico-muted-color);
}

/* Auth pages (login, verify, link-sent): a narrow centered column. */
.auth {
  max-width: 26rem;
  margin: 4rem auto;
  padding: 0 1.25rem;
}

/* Dev-only magic-link shortcut on the login page. */
a.devbtn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #b58100;
  color: #fff;
  text-decoration: none;
  border-radius: var(--pico-border-radius);
}
