/* ---------- Sidebar layout ----------
   Add this file as css/sidebar.css and link it
   in any page that needs a left-hand sub-menu,
   in addition to css/styles.css.
------------------------------------------------ */

.layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.sidebar {
  flex: 0 0 220px;
  position: sticky;
  top: 88px; /* clears the sticky site header */
}

.sidebar h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--color-border);
}

.sidebar-nav a {
  padding: 8px 16px;
  font-size: 0.95rem;
  color: var(--color-muted);
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.sidebar-nav a:hover {
  color: var(--color-text);
  background: #f7f7f7;
}

.sidebar-nav a.active {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  font-weight: 600;
}

.content {
  flex: 1;
  min-width: 0;
}

.content h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 16px;
}

.content p {
  color: var(--color-muted);
  max-width: 640px;
  margin-bottom: 16px;
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .layout {
    flex-direction: column;
    gap: 24px;
  }

  .sidebar {
    position: static;
    width: 100%;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-bottom: 2px solid var(--color-border);
    gap: 4px;
  }

  .sidebar-nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
    margin-left: 0;
    margin-bottom: -2px;
  }

  .sidebar-nav a.active {
    border-left-color: transparent;
    border-bottom-color: var(--color-accent);
  }
}