body { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;           
  max-height: 100vh;       
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0; left: 0;
  overflow-y: auto;        
  flex-shrink: 0;
  box-sizing: border-box;  
}

.sidebar-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}
.site-title {
  display: block;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--size-sm);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 0.1rem; }
.sidebar-nav a {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--size-sm);
  color: var(--color-text);
  padding: 0.4rem 0.6rem;
  border-radius: 3px;
  transition: background 0.15s;
}
.sidebar-nav a:hover { background: var(--color-accent-soft); text-decoration: none; }
.sidebar-nav a.active { background: var(--color-accent-soft); color: var(--color-accent); font-weight: 600; }

.page-wrap {
  margin-left: var(--sidebar-width);
  flex: 1;
  /* FIX: Changed from "2.5rem 3rem" to "1rem 3rem 2rem 3rem" to remove the huge top gap */
  padding: 1rem 3rem 2rem 3rem; 
  max-width: 100%;
}

/* ── MOBILE FIXES ─────────────────────────────────────── */
@media (max-width: 768px) {
  body { flex-direction: column; }
  
  .sidebar { 
    position: relative; 
    width: 100%; 
    height: auto;       
    max-height: none;   
    border-right: none; 
    border-bottom: 1px solid var(--color-border); 
    padding: 1rem;      
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .sidebar-nav li { 
    margin-bottom: 0; 
  }
  .sidebar-nav a {
    font-size: 1.1rem;  
    padding: 0.5rem 0.9rem; 
    background: var(--color-accent-soft); 
  }

  .page-wrap { 
    margin-left: 0; 
    /* FIX: Reduced top padding on mobile from 1.5rem to 1rem */
    padding: 1rem; 
  }
}
