/* ── pgvitals shared shell styles ─────────────────────────────────────────
   Included by every page. Contains: CSS variables, reset, nav, footer.
   Page-specific styles remain inline in each page's <style> block.
   ──────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:        #1d4ed8;
  --accent-light:  #2563eb;
  --accent-pale:   #eff6ff;
  --accent-border: #bfdbfe;
  --accent-text:   #93c5fd;
  --hero-bg:       #0f172a;
  --dark-surface:  #1e293b;
  --dark-surface2: #273349;
  --ink:           #0f172a;
  --ink-mid:       #334155;
  --slate:         #64748b;
  --slate-light:   #94a3b8;
  --border:        #e2e8f0;
  --bg:            #f8fafc;
  --white:         #ffffff;
  --green:         #15803d;
  --green-pale:    #f0fdf4;
  --green-border:  #bbf7d0;
  --wrap:          1160px;
  --px:            32px;
  --radius:        6px;
  --radius-lg:     12px;
  --radius-xl:     18px;

  /* area colours */
  --col-query:       #3b82f6;
  --col-index:       #22c55e;
  --col-table:       #f97316;
  --col-vacuum:      #a855f7;
  --col-connections: #f59e0b;
  --col-replication: #06b6d4;
  --col-risk:        #ef4444;
  --col-config:      #64748b;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--white);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Utility ───────────────────────────────────────────────────────────── */
.container { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--px); }
.sr-only    { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Nav ───────────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--px);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.4px;
  flex-shrink: 0;
}

.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mid);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.12s, color 0.12s;
}

.nav-links a:hover  { background: var(--bg); color: var(--ink); }
.nav-links a.active { color: var(--accent); font-weight: 600; }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.12s;
  background: var(--white);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.12s;
}

.btn-primary:hover { background: var(--accent-light); }

/* ── Footer ────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px var(--px);
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
  color: var(--slate);
  flex-wrap: wrap;
}

.footer-inner a { color: var(--accent); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

/* ── Accessibility: visible keyboard focus ─────────────────────────────── */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Nav responsive ────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  :root { --px: 20px; }
  .nav-links { display: none; }
}
