/* layout.css — sidebar nav, page shell, content grid */

.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  padding: 2.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  margin-bottom: 2.5rem;
}

.sidebar-brand h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.sidebar-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}

.sidebar-nav a:hover {
  color: var(--text);
  background: var(--bg-surface);
  opacity: 1;
}

.sidebar-nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.sidebar-nav a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 12px; /* Separates the CV download and theme switch */
}

.cv-download, .theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim); /* Match your layout's current text theme color variable */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.cv-download svg, .theme-toggle svg {
  width: 20px;
  height: 20px;
}

.cv-download:hover, .theme-toggle:hover {
  background-color: var(--hover-bg-color); /* Subtle background highlight on mouse hover */
}

.sidebar-socials {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-socials a {
  display: inline-flex;
  align-items: center;
  color: var(--text-dim);
  transition: color var(--transition);
}

.sidebar-socials a:hover {
  color: var(--text);
  opacity: 1;
}

.sidebar-socials svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Main content ── */

.main {
  margin-left: var(--nav-width);
  flex: 1;
  padding: 3rem 4rem;
  max-width: calc(var(--nav-width) + var(--content-max) + 8rem);
}

.page-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 0.9rem;
}

/* ── Mobile nav toggle ── */

.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}

.mobile-nav-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: 2rem 1.5rem;
  }
}
