/* microk8s-mcp documentation
   Brand: Kubernetes blue #326CE5, Canonical orange #E95420, ink #1D1F20 */

:root {
  --blue: #326ce5;
  --blue-dark: #2456bd;
  /* The top bar matches the lockup's brand blue exactly, in both themes, so
     the bar and the banner beneath it read as one surface. White on #326ce5
     measures 4.76:1, which clears AA for normal text. Dark mode must not
     substitute the lightened link blue here: white on #58a6ff is 2.53:1. */
  --chrome: #326ce5;
  --chrome-text: #ffffff;
  --orange: #e95420;
  --ink: #1d1f20;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-code: #f6f8fa;
  --text: #24292f;
  --text-muted: #57606a;
  --border: #d8dee4;
  --warn-bg: #fff8e6;
  --warn-border: #d4a72c;
  --danger-bg: #fff1f0;
  --danger-border: #cf222e;
  --radius: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #58a6ff;
    --blue-dark: #79b8ff;
    --orange: #ff7b52;
    --bg: #0d1117;
    --bg-soft: #161b22;
    --bg-code: #161b22;
    --text: #e6edf3;
    --text-muted: #9198a1;
    --border: #30363d;
    --warn-bg: #272115;
    --warn-border: #d29922;
    --danger-bg: #25171c;
    --danger-border: #f85149;
    /* Brand blue here too — the chrome tracks the lockup, not the theme. */
    --chrome: #326ce5;
    --chrome-text: #ffffff;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: .75rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 1.5rem;
  background: var(--chrome);
  border-bottom: 1px solid rgba(0, 0, 0, .15);
}

.topbar a.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .02em;
}

.topbar .brand svg { width: 26px; height: 26px; display: block; }

.topbar .spacer { flex: 1; }

.topbar .gh {
  color: #fff;
  text-decoration: none;
  font-size: .9rem;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius);
  padding: .3rem .7rem;
  white-space: nowrap;
}
.topbar .gh:hover { background: rgba(255, 255, 255, .15); }

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.sidebar nav { position: sticky; top: 5rem; }

.sidebar h2 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin: 1.5rem 0 .5rem;
}
.sidebar h2:first-child { margin-top: 0; }

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

.sidebar a {
  display: block;
  padding: .3rem .6rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  font-size: .93rem;
}
.sidebar a:hover { background: var(--bg-soft); }
.sidebar a[aria-current="page"] {
  /* --blue on --bg-soft is 4.47:1, a hair under AA; the darker tone clears it. */
  color: var(--blue-dark);
  font-weight: 600;
  border-left-color: var(--blue);
  background: var(--bg-soft);
}

main { min-width: 0; }

/* ---------- typography ---------- */

h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 .5rem;
  letter-spacing: -.02em;
}

h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 .75rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -.01em;
}

h3 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }

.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: .35rem; }

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .12em .35em;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; font-size: 1em; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: .92rem;
}
th, td {
  text-align: left;
  padding: .5rem .7rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
th { background: var(--bg-soft); font-weight: 600; }
td code { white-space: nowrap; }

/* ---------- callouts ---------- */

.note, .warn, .danger {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin: 0 0 1.25rem;
  background: var(--bg-soft);
}
.note { border-left-color: var(--blue); }
.warn { border-left-color: var(--warn-border); background: var(--warn-bg); }
.danger { border-left-color: var(--danger-border); background: var(--danger-bg); }

.note > :last-child, .warn > :last-child, .danger > :last-child { margin-bottom: 0; }
.note strong, .warn strong, .danger strong { display: inline; }

/* ---------- home page bits ---------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.hero img { max-width: 100%; height: auto; border-radius: var(--radius); }

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1.5rem 0 0;
}
.btn {
  display: inline-block;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid var(--blue);
}
/* Same brand blue as the bar and the lockup, in both themes. */
.btn-primary { background: var(--chrome); color: var(--chrome-text); border-color: var(--chrome); }
.btn-primary:hover { filter: brightness(1.12); color: var(--chrome-text); }
.btn-ghost { color: var(--blue); }
.btn-ghost:hover { background: var(--bg-soft); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  background: var(--bg-soft);
}
.card h3 { margin: 0 0 .4rem; font-size: 1rem; }
.card p { margin: 0; font-size: .92rem; color: var(--text-muted); }
.card a { text-decoration: none; }
.card a::after { content: " \2192"; }

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .12rem .45rem;
  border-radius: 4px;
  vertical-align: middle;
}
.badge-read { background: rgba(50, 108, 229, .15); color: var(--blue); }
.badge-write { background: rgba(233, 84, 32, .15); color: var(--orange); }
.badge-danger { background: rgba(207, 34, 46, .15); color: var(--danger-border); }

/* ---------- tool entries ---------- */

.tool {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.tool h3 { margin: 0 0 .4rem; font-family: var(--mono); font-size: 1rem; }
.tool p { margin: 0 0 .5rem; }
.tool p:last-child { margin-bottom: 0; }
.tool .args { font-size: .88rem; color: var(--text-muted); }
.tool .args code { font-size: .95em; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}
footer a { color: var(--text-muted); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem 1rem 3rem;
  }
  .sidebar nav { position: static; }
  .sidebar {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
  .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
  }
  .sidebar a { border-left: 0; border: 1px solid var(--border); }
  .sidebar a[aria-current="page"] { border-color: var(--blue); }
  .sidebar h2 { margin: .75rem 0 .4rem; }
  h1 { font-size: 1.7rem; }
  .topbar { padding: .6rem 1rem; }

  /* Keep the nav compact so content starts near the top of the first screen. */
  .sidebar a { font-size: .85rem; padding: .25rem .5rem; }
  .sidebar ul { gap: .25rem; }

  /* Stack table rows into labelled blocks. A three-column reference table
     squeezed into 390px puts one word per line and hides the column that
     matters; each row becomes its own small card instead. */
  .table-wrap { overflow-x: visible; }

  table, tbody, tr, td { display: block; width: 100%; }

  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    padding: .25rem .75rem .5rem;
  }

  td { border: 0; padding: .4rem 0; }
  td + td { border-top: 1px solid var(--border); }

  td::before {
    content: attr(data-label);
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .15rem;
  }
  td:not([data-label])::before { content: none; }

  /* Long variable names must wrap rather than force a wide row. */
  td code { white-space: normal; overflow-wrap: anywhere; }
}