:root{
  --site-max-width: 1100px;    
  --sidebar-width: 240px;      
  --content-max-width: 760px;  
  --base-font-size: 14.5px;      
  --sidebar-bg: #1C5B46;       
  --accent: #71BE44; 
}

/* Reset / base */
* { box-sizing: border-box; }
html,body { height:100%; }
body {
  margin: 0;
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--base-font-size);
  line-height: 1.55;
  color: #222;
  background: #ffffff;
  overflow-x: hidden; /* prevent sideways scroll on mobile */
  overflow-y: auto;   /* allow natural vertical scroll everywhere */
  height: auto;
}

/* Outer wrapper keeps the whole block centered and gives side whitespace */
.page-outer {
  display: flex;
  justify-content: center;
  padding: 2rem; 
}

/* Centered site block that contains both columns */
.site-wrapper {
  display: flex;
  width: 100%;
  max-width: var(--site-max-width);
  /*min-height: calc(100vh - 0px); */
  background: transparent;
  gap: 2rem;            
  align-items: flex-start;
  position: relative; /* allows sidebar to fix within this centered container */
}

html, body, .page-outer, .site-wrapper {
  height: auto;
  min-height: 100%;
}

/* Sidebar */
.sidebar{
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: fixed;       
  top: 2rem;              /* keeps same top spacing as before */  
  font-family: 'JetBrains Mono', monospace;
  align-self: flex-start; /* aligns top of sidebar with top of content */
  height: calc(100vh - 4rem); /* full viewport height minus padding */
}

.sidebar .logo{
  max-width: 100%;
  height: auto;
  margin-bottom: 0.75rem;
}
.site-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.site-title a {
  color: #fff;
  text-decoration: none;
}

.site-title {
  margin: 0;
  font-weight: 600;
  display: flex;
  flex-direction: column; /* stack words vertically */
  line-height: 1.2;         /* ensure consistent vertical spacing */
}

.site-title a {
  text-decoration: none;
  color: #fff;
}

/* Wrap each part in span */
.site-title .title-large,
.site-title .title-small {
  display: block;         /* stack blocks vertically */
  margin: 0;
  line-height: 1.2;         /* removes extra spacing caused by font height */
}

/* Larger part of title */
.site-title .title-large {
  font-size: 4rem;   /* adjust bigger if needed */
  font-weight: 700;
  margin-right: 0.25rem;
}

/* Smaller part of title */
.site-title .title-small {
  font-size: 1.7rem;     /* adjust smaller if needed */
  font-weight: 500;
  /*opacity: 0.85;       /* optional subtle difference */
}


/* nav */
.sidebar-nav {
  margin-top: 1rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-nav li { margin: 0.75rem 0; }
.sidebar-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  display: inline-block;
}
.sidebar-nav a:hover { color: #d1f0f0; text-decoration: underline; }

/* Custom colors for each menu item */
.sidebar-nav li:nth-child(1) a { color: #FAAE17; }       /* a design brief */
.sidebar-nav li:nth-child(2) a { color: #ffffff; }       /* companion paper */
.sidebar-nav li:nth-child(3) a { color: #ffffff; }       /* repository */
.sidebar-nav li:nth-child(4) a { color: #ffffff; }       /* about */

/* Hover colors (lighter blend toward white) */
.sidebar-nav li:nth-child(1) a:hover { color: #ffffff; } /* stays white */
.sidebar-nav li:nth-child(2) a:hover { color: #00ADEE; }
.sidebar-nav li:nth-child(3) a:hover { color: #71BE44; }
.sidebar-nav li:nth-child(4) a:hover { color: #00ADEE; }

/* Main content */
.main-content{
  margin-left: calc(var(--sidebar-width) + 2rem);
  flex: 1 1 auto;
  max-width: var(--content-max-width);
  padding: 2.5rem;
  background: #fff;
  border-radius: 6px;
}

/* Typography */
.main-content h1, .main-content h2, .main-content h3 {
  margin-top: 1rem;
  margin-bottom: 0.45rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.main-content p { margin: 0.45rem 0; }
.main-content a { color: var(--accent); text-decoration: underline; }
code, pre { font-family: 'JetBrains Mono', monospace; }


/* ---------- Page background (desktop only) ---------- */
@media (min-width: 769px) {
  .main-content { 
    background-image: url('/assets/css/background-tall-right.png'); /* tall image with content on the right */ 
    background-repeat: no-repeat; 
    background-attachment: fixed;       /* stays in place while scrolling on desktop */
    background-size: auto 100%;         /* height fills viewport, width auto */
    background-position: right 230px top 25px; /* shift 230px left from right */
    position: relative;                  /* ensures text is above background */
    background-color: #ffffff;          /* fallback */
  }
}


/* subtle divider between columns on large screens */
@media (min-width: 900px){
  .site-wrapper { align-items: flex-start; }
  .sidebar { box-shadow: 2px 0 0 rgba(0,0,0,0.03) inset; }
} 

/* ---------- Mobile fallback (stacking restored) ---------- */
@media (max-width: 768px) {
  .main-content {
    background: none !important; /* remove background completely */
    margin-left: 0;               /* ensure content stays full width */
    max-width: 100%;
    overflow: visible;
    padding: 1.25rem;             /* keep spacing consistent */
    position: relative;
  }

  /* Optional: reinforce stacking rules if needed */
  .page-outer {
    padding: 1rem;
  }
  .site-wrapper {
    flex-direction: column;
    gap: 1rem;
  }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    position: relative;
    overflow: visible;
    border-radius: 6px;
  }
}
  
/* Mobile stacking old code
@media (max-width: 768px) {
  :root { --site-max-width: 100%; }
  .page-outer { padding: 1rem; }
  .site-wrapper { flex-direction: column; gap: 1rem; }
  .sidebar {
    position: relative;
    top: 0;
    left: 0;
    height: auto;
    width: 100%;
    flex: 0 0 auto;
    overflow: visible;
    border-radius: 6px;
  }
  .main-content {
    margin-left: 0;
    height: auto;
    overflow: visible;
    max-width: 100%;
    padding: 1.25rem;
    border-radius: 6px;
    background: none !important; /* remove background to avoid stacking issues 
    position: relative;          /* reset position */
  }
}
