/* ── Reset & Box Model ───────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:        #3b2a18;   /* beige brown*/
  --surface:   #ffffff;
  --border:    #ddd8d0;
  --text:      #d4b896;   /* a loghter brown now */
  --muted:     #5a5f66;
  --accent:    #2563eb;   /* blue — accessible on both --bg and --surface */
  --accent-hv: #1d4ed8;

  --font-body: Georgia, 'Times New Roman', serif;
  --font-ui:   system-ui, sans-serif;

  --max-w: 720px;
  --gap:   1.5rem;
}

/* ── Base ────────────────────────────────────────────────── */
html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  padding: var(--gap);
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
  color: var(--text);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; margin-top: 2rem; }
h3 { font-size: 1.2rem; margin-top: 1.5rem; }

p { margin-bottom: 1rem; }

small, .muted { color: var(--muted); font-size: 0.85rem; }

/* ── Links ───────────────────────────────────────────────── */
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-hv); }

/* ── Header / Nav ────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--gap);
  margin-bottom: calc(var(--gap) * 1.5);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

/* had to change from nav a to header nav a to stop conflict with sidebar */
header nav a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
  margin-right: 1rem;
}
header nav a:hover { color: var(--accent); }

/* ── Cards / Surfaces ────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--gap);
  margin-bottom: var(--gap);
}

/* ── Buttons ─────────────────────────────────────────────── */
button, .btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5em 1.2em;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s;
}
button:hover, .btn:hover { background: var(--accent-hv); }

/* ── Forms ───────────────────────────────────────────────── */
label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}

input, textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.45em 0.7em;
  margin-bottom: 1rem;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* ── Code ────────────────────────────────────────────────── */
code {
  font-family: 'Courier New', monospace;
  font-size: 0.88em;
  background: var(--border);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
pre {
  background: #1e2022;
  color: #f5f2ee;
  padding: var(--gap);
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}
pre code { background: none; color: inherit; padding: 0; }

/* ── Lists ───────────────────────────────────────────────── */
ul, ol { padding-left: 1.4rem; margin-bottom: 1rem; }
li { margin-bottom: 0.3rem; }

/* ── Divider ─────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: calc(var(--gap) * 1.5) 0;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding-top: var(--gap);
  margin-top: calc(var(--gap) * 2);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  html { font-size: 16px; }
  h1   { font-size: 1.8rem; }
}

/* ── Links Sidebar ──────────────────────────────────────────── */
 
 body {
  display: flex;
  min-height: 100vh;
}
 
.sidebar {
  width: 180px;
  min-height: 100vh;
  background: #1a1a2e;
  border-right: 3px double #9b59b6;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  /* Override your body's font and color for everything inside */
  font-family: 'Courier Prime', monospace;
  color: #e8e8d0;
}
 
.sidebar-header {
  background: #9b59b6;
  color: #fff !important;
  font-family: 'VT323', monospace;
  font-size: 22px;
  letter-spacing: 2px;
  padding: 10px 14px;
  text-shadow: 2px 2px 0 #4a235a;
}
 
.sidebar-label {
  font-family: 'VT323', monospace;
  font-size: 13px;
  letter-spacing: 3px;
  color: #7d6a9b;
  padding: 14px 14px 6px;
  text-transform: uppercase;
}
 
.sidebar-nav-box {
  margin: 10px 12px;
  background: #3b2a18;
  border: 1px solid #7a5230;
  border-radius: 4px;
  overflow: hidden;
}
 
/* Use !important on link styles to beat your global a {} and nav a {} rules */
.sidebar-nav-box a {
  display: block !important;
  padding: 8px 12px !important;
  color: #d4b896 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  border-left: 3px solid transparent !important;
  margin-right: 0 !important;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
 
.sidebar-nav-box a::before {
  content: '> ';
  color: #c87941;
  font-weight: 700;
}
 
.sidebar-nav-box a + a {
  border-top: 1px solid #5a3d20;
}
 
.sidebar-nav-box a:hover {
  background: #4f3820 !important;
  border-left-color: #c87941 !important;
  color: #f0d5b0 !important;
}
 
.sidebar-nav-box a.active {
  background: #4f3820 !important;
  border-left-color: #e09050 !important;
  color: #f0d5b0 !important;
  font-weight: 700 !important;
}
 
.page-content {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar Mobile ──────────────────────────────────────── */
@media (max-width: 600px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    min-height: unset;
    position: static;
    border-right: none;
    border-bottom: 3px double #9b59b6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .sidebar-header {
    font-size: 18px;
    padding: 6px 10px;
  }

  .sidebar-label {
    display: none;
  }

  .sidebar-nav-box {
    margin: 0;
    display: flex;
    flex-direction: row;
    border-radius: 4px;
    overflow: hidden;
  }

  .sidebar-nav-box a {
    border-left: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 6px 12px !important;
  }

  .sidebar-nav-box a + a {
    border-top: none;
    border-left: 1px solid #5a3d20 !important;
  }

  .sidebar-nav-box a:hover {
    border-bottom-color: #c87941 !important;
  }
}